LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-18-2004, 05:27 PM   #1
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Rep: Reputation: 16
starting server at boot


I am attempting to start postgreSQL on my computer at boot time. I can start the server from the command line but cannot figure out how to get it to start on boot.

The problem is that postgreSQL server must be run by a particular user (in this case "postgres"). I am wondering how to script that and where I should be putting it in the etc folder, and how to organize, and....

I would ask the postgres guys, but their documentation is fairly clear as to how to start their software, I'm more wondering how to execute the commands to automagically...

So to summarize:

How do I start run a command as the user "postgres" at system boot?
 
Old 02-18-2004, 05:39 PM   #2
Justin_Time
Member
 
Registered: Feb 2004
Posts: 53

Rep: Reputation: 15
Or you make a cron for the user "postgress" or you make a simple script (su postgress (no passwd needed), command to start). and put this into /etc/rc.d/rc.local
 
Old 02-18-2004, 06:26 PM   #3
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Original Poster
Rep: Reputation: 16
I tried that (rc.d). Wouldn't the user need to come back?

[code]
su postges
start server
exit ????
[code]

Will look into creating a cron for postgres. But I think the rc.d is preferred.
 
Old 02-18-2004, 06:40 PM   #4
subekk0
Member
 
Registered: Sep 2003
Location: Dallas, TX.
Distribution: Slacking since '94
Posts: 153

Rep: Reputation: 32
#!/bin/sh

su postgres &
cd /etc/rc.d/ &
./rc.postgre start

# end script

put that script in your rc.local and give it a shot.
 
Old 02-18-2004, 07:53 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Put this line
Code:
/bin/su - postgres /usr/local/pgsql/bin/pg_ctl start -l /home/postgres/logfile -D /usr/local/pgsql/data > /home/postgres/start 2>&1
into
/etc/rc.d/rc.local
(modify directories to match your system) ... ;)


Cheers,
Tink
 
Old 02-20-2004, 08:09 AM   #6
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Original Poster
Rep: Reputation: 16
I have it in place. Will let you know.

The wife needs me off the computer so I will shutdown right now and let you know after work.

Went with Tinkster's... It looks like he's running postgreSQL (mentions a couple things you would only know if you had read the manual or worked with postgres).
 
Old 02-23-2004, 05:25 PM   #7
kavius
Member
 
Registered: Feb 2003
Location: Halifax, NS, CAN
Distribution: Ubuntu
Posts: 71

Original Poster
Rep: Reputation: 16
That worked.

Sorry it took so long, but I am having trouble with my computer overheating and the reinstall of postgres kept cutting the power to my computer and ......

Anyway. I used tinkster's solution, it worked. I now have postgresql running everytime I turn my computer on.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
starting xprogram without starting X server. bruse Linux - Newbie 9 04-26-2005 07:05 PM
Won't Boot - Starting Printer Service - Starting CUPS jeansond Linux - Newbie 0 10-11-2004 06:39 PM
Starting a server... CrAzY G Linux - General 7 04-13-2004 02:02 PM
starting X server? Squall Slackware 5 04-02-2004 10:12 AM
X server not starting manthram Linux - General 1 06-28-2002 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration