how to start postgresql server at machine startup?
I installed postgresql server in my machine, but i does not start
automatically at startup time, so i need to mannually type these
commands to start it everytime when i restart system
Desktop:~# su postgres
Desktop:/root$ cd ~
Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
su -c "postgres -D /var/lib/postgresql/data >
/var/lib/postgresql/log/logfile 2>&1 &" postgres
but it doesn't work
how can i make these commands automatically executed at system startup? thanks
--
I'm a debian user and a web developer(XML+XSLT+AJAX+PostgreSQL+PHP) in
City of Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
10-28-2008, 01:58 AM
Ron Johnson
how to start postgresql server at machine startup?
On 10/27/08 21:07, Star Liu wrote:
I installed postgresql server in my machine, but i does not start
automatically at startup time, so i need to mannually type these
commands to start it everytime when i restart system
Desktop:~# su postgres
Desktop:/root$ cd ~
Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
Why the heck would you put it in an X script??????????
su -c "postgres -D /var/lib/postgresql/data >
/var/lib/postgresql/log/logfile 2>&1 &" postgres
but it doesn't work
how can i make these commands automatically executed at system startup? thanks
How did you install PostgreSQL? If thru a Debian package, then
Debian will handle all this for you.
--
Ron Johnson, Jr.
Jefferson LA USA
Help a man when he is in trouble and he will remember you when
he is in trouble again.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
10-28-2008, 02:36 AM
"Star Liu"
how to start postgresql server at machine startup?
On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:
> On 10/27/08 21:07, Star Liu wrote:
>>
>> I installed postgresql server in my machine, but i does not start
>> automatically at startup time, so i need to mannually type these
>> commands to start it everytime when i restart system
>>
>> Desktop:~# su postgres
>> Desktop:/root$ cd ~
>> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
>>
>> i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
>
> Why the heck would you put it in an X script??????????
I do not know, I just put all the things I want to do at system
startup into this file
>> su -c "postgres -D /var/lib/postgresql/data >
>> /var/lib/postgresql/log/logfile 2>&1 &" postgres
>> but it doesn't work
>>
>> how can i make these commands automatically executed at system startup?
>> thanks
>
> How did you install PostgreSQL? If thru a Debian package, then Debian will
> handle all this for you.
Yes, i installed it thru debian package, but it doesn't start up at
system startup, so i need to start it by myself, is there anyway to
automate it? thanks
("Help a man when he is in trouble and he will remember you when he is
in trouble again." - haha, it's interesting)
> --
> Ron Johnson, Jr.
> Jefferson LA USA
>
> Help a man when he is in trouble and he will remember you when
> he is in trouble again.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>
--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
10-28-2008, 03:23 AM
Ron Johnson
how to start postgresql server at machine startup?
On 10/27/08 22:36, Star Liu wrote:
On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:
On 10/27/08 21:07, Star Liu wrote:
I installed postgresql server in my machine, but i does not start
automatically at startup time, so i need to mannually type these
commands to start it everytime when i restart system
Desktop:~# su postgres
Desktop:/root$ cd ~
Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
Why the heck would you put it in an X script??????????
I do not know, I just put all the things I want to do at system
startup into this file
Stuff like that goes in /etc/init.d/ or /etc/rc.local.
su -c "postgres -D /var/lib/postgresql/data >
/var/lib/postgresql/log/logfile 2>&1 &" postgres
but it doesn't work
how can i make these commands automatically executed at system startup?
thanks
How did you install PostgreSQL? If thru a Debian package, then Debian will
handle all this for you.
Yes, i installed it thru debian package, but it doesn't start up at
system startup, so i need to start it by myself, is there anyway to
automate it? thanks
There *must* be a relevant /etc/init.d/postgre* file.
--
Ron Johnson, Jr.
Jefferson LA USA
Help a man when he is in trouble and he will remember you when
he is in trouble again.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
10-28-2008, 04:15 AM
"Star Liu"
how to start postgresql server at machine startup?
On Tue, Oct 28, 2008 at 12:23 PM, Ron Johnson <ron.l.johnson@cox.net> wrote:
> On 10/27/08 22:36, Star Liu wrote:
>>
>> On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net>
>> wrote:
>>>
>>> On 10/27/08 21:07, Star Liu wrote:
>>>>
>>>> I installed postgresql server in my machine, but i does not start
>>>> automatically at startup time, so i need to mannually type these
>>>> commands to start it everytime when i restart system
>>>>
>>>> Desktop:~# su postgres
>>>> Desktop:/root$ cd ~
>>>> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
>>>>
>>>> i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
>>>
>>> Why the heck would you put it in an X script??????????
>>
>> I do not know, I just put all the things I want to do at system
>> startup into this file
>
> Stuff like that goes in /etc/init.d/ or /etc/rc.local.
>
>>>> su -c "postgres -D /var/lib/postgresql/data >
>>>> /var/lib/postgresql/log/logfile 2>&1 &" postgres
>>>> but it doesn't work
>>>>
>>>> how can i make these commands automatically executed at system startup?
>>>> thanks
>>>
>>> How did you install PostgreSQL? If thru a Debian package, then Debian
>>> will
>>> handle all this for you.
>>
>> Yes, i installed it thru debian package, but it doesn't start up at
>> system startup, so i need to start it by myself, is there anyway to
>> automate it? thanks
>
> There *must* be a relevant /etc/init.d/postgre* file.
yes, there is a /etc/init.d/postgresql-8.3, its content is:
-----------------------------------------------------------------------------------------
[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0
exit 0
-----------------------------------------------------------------------------------------
so should i add the following line into this file?
su -c "postgres -D /var/lib/postgresql/data >
/var/lib/postgresql/log/logfile 2>&1 &" postgres
thanks
> --
> Ron Johnson, Jr.
> Jefferson LA USA
>
> Help a man when he is in trouble and he will remember you when
> he is in trouble again.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>
--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
10-28-2008, 04:38 AM
Ron Johnson
how to start postgresql server at machine startup?
On 10/28/08 00:15, Star Liu wrote:
On Tue, Oct 28, 2008 at 12:23 PM, Ron Johnson <ron.l.johnson@cox.net> wrote:
On 10/27/08 22:36, Star Liu wrote:
On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net>
wrote:
On 10/27/08 21:07, Star Liu wrote:
I installed postgresql server in my machine, but i does not start
automatically at startup time, so i need to mannually type these
commands to start it everytime when i restart system
Desktop:~# su postgres
Desktop:/root$ cd ~
Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
Why the heck would you put it in an X script??????????
I do not know, I just put all the things I want to do at system
startup into this file
Stuff like that goes in /etc/init.d/ or /etc/rc.local.
su -c "postgres -D /var/lib/postgresql/data >
/var/lib/postgresql/log/logfile 2>&1 &" postgres
but it doesn't work
how can i make these commands automatically executed at system startup?
thanks
How did you install PostgreSQL? If thru a Debian package, then Debian
will
handle all this for you.
Yes, i installed it thru debian package, but it doesn't start up at
system startup, so i need to start it by myself, is there anyway to
automate it? thanks
There *must* be a relevant /etc/init.d/postgre* file.
yes, there is a /etc/init.d/postgresql-8.3, its content is:
-----------------------------------------------------------------------------------------
[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0
exit 0
-----------------------------------------------------------------------------------------
so should i add the following line into this file?
su -c "postgres -D /var/lib/postgresql/data >
/var/lib/postgresql/log/logfile 2>&1 &" postgres
No. I had PostgreSQL installed for a long time, and it *always*
started up on boot.
Look in /usr/share/postgresql-common/init.d-functions to see if
there's some env variable that controls whether the boot script
immediately dies or not. It might reference a file in /etc/default.
--
Ron Johnson, Jr.
Jefferson LA USA
Help a man when he is in trouble and he will remember you when
he is in trouble again.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
10-28-2008, 06:10 AM
"Adrian Levi"
how to start postgresql server at machine startup?
2008/10/28 Star Liu <minxinjianxin@gmail.com>:
> On Tue, Oct 28, 2008 at 12:23 PM, Ron Johnson <ron.l.johnson@cox.net> wrote:
>> There *must* be a relevant /etc/init.d/postgre* file.
>
> yes, there is a /etc/init.d/postgresql-8.3, its content is:
try reading the contents of:
$ man update-rc.d
It will tell you how to set up the postgres-8.3 script to run at
different runlevels.
> so should i add the following line into this file?
> su -c "postgres -D /var/lib/postgresql/data >
> /var/lib/postgresql/log/logfile 2>&1 &" postgres
No it's already all in there, you can manually call this script by typing:
# /etc/init.d/postgresql-8.3 start
Adrian
--
24x7x365 != 24x7x52 Stupid or bad maths?
<erno> hm. I've lost a machine.. literally _lost_. it responds to
ping, it works completely, I just can't figure out where in my
apartment it is.
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
10-28-2008, 06:26 AM
Jeff D
how to start postgresql server at machine startup?
On Tue, 28 Oct 2008, Star Liu wrote:
> On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:
> > On 10/27/08 21:07, Star Liu wrote:
> >>
> >> I installed postgresql server in my machine, but i does not start
> >> automatically at startup time, so i need to mannually type these
> >> commands to start it everytime when i restart system
> >>
> >> Desktop:~# su postgres
> >> Desktop:/root$ cd ~
> >> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
> >>
> >> i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
> >
> > Why the heck would you put it in an X script??????????
> I do not know, I just put all the things I want to do at system
> startup into this file
>
> >> su -c "postgres -D /var/lib/postgresql/data >
> >> /var/lib/postgresql/log/logfile 2>&1 &" postgres
> >> but it doesn't work
> >>
> >> how can i make these commands automatically executed at system startup?
> >> thanks
> >
> > How did you install PostgreSQL? If thru a Debian package, then Debian will
> > handle all this for you.
> Yes, i installed it thru debian package, but it doesn't start up at
> system startup, so i need to start it by myself, is there anyway to
> automate it? thanks
>
Are you sure its not starting and just listening on the localhost
interface? This is how it comes configured by default. If you want it to
listen on a different interface you have to edit
/etc/postgresql/8.3/main/postgresql.conf to reflect that and restart it
through /etc/init.d/postgresql-8.3 restart .
jeff
--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
10-28-2008, 08:17 AM
"Star Liu"
how to start postgresql server at machine startup?
On Tue, Oct 28, 2008 at 1:38 PM, Ron Johnson <ron.l.johnson@cox.net> wrote:
> On 10/28/08 00:15, Star Liu wrote:
>>
>> On Tue, Oct 28, 2008 at 12:23 PM, Ron Johnson <ron.l.johnson@cox.net>
>> wrote:
>>>
>>> On 10/27/08 22:36, Star Liu wrote:
>>>>
>>>> On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net>
>>>> wrote:
>>>>>
>>>>> On 10/27/08 21:07, Star Liu wrote:
>>>>>>
>>>>>> I installed postgresql server in my machine, but i does not start
>>>>>> automatically at startup time, so i need to mannually type these
>>>>>> commands to start it everytime when i restart system
>>>>>>
>>>>>> Desktop:~# su postgres
>>>>>> Desktop:/root$ cd ~
>>>>>> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
>>>>>>
>>>>>> i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
>>>>>
>>>>> Why the heck would you put it in an X script??????????
>>>>
>>>> I do not know, I just put all the things I want to do at system
>>>> startup into this file
>>>
>>> Stuff like that goes in /etc/init.d/ or /etc/rc.local.
>>>
>>>>>> su -c "postgres -D /var/lib/postgresql/data >
>>>>>> /var/lib/postgresql/log/logfile 2>&1 &" postgres
>>>>>> but it doesn't work
>>>>>>
>>>>>> how can i make these commands automatically executed at system
>>>>>> startup?
>>>>>> thanks
>>>>>
>>>>> How did you install PostgreSQL? If thru a Debian package, then Debian
>>>>> will
>>>>> handle all this for you.
>>>>
>>>> Yes, i installed it thru debian package, but it doesn't start up at
>>>> system startup, so i need to start it by myself, is there anyway to
>>>> automate it? thanks
>>>
>>> There *must* be a relevant /etc/init.d/postgre* file.
>>
>> yes, there is a /etc/init.d/postgresql-8.3, its content is:
>>
>> -----------------------------------------------------------------------------------------
>> [ -r /usr/share/postgresql-common/init.d-functions ] || exit 0
>>
>> . /usr/share/postgresql-common/init.d-functions
>>
>> VERSION=8.3
>>
>> case "$1" in
>> start)
>> start $VERSION
>> ;;
>> stop)
>> stop "$VERSION"
>> ;;
>> restart)
>> restart "$VERSION"
>> ;;
>> force-reload | reload)
>> reload $VERSION
>> ;;
>> status)
>> status $VERSION
>> ;;
>> autovac-start)
>> autovac_start $VERSION
>> ;;
>> autovac-stop)
>> autovac_stop $VERSION
>> ;;
>> autovac-restart)
>> autovac_restart $VERSION
>> ;;
>> *)
>> echo "Usage: $0
>>
>> {start|stop|restart|reload|force-reload|status|autovac-start|autovac-stop|autovac-restart}"
>> exit 1
>> ;;
>> esac
>>
>> exit 0
>>
>> -----------------------------------------------------------------------------------------
>> so should i add the following line into this file?
>> su -c "postgres -D /var/lib/postgresql/data >
>> /var/lib/postgresql/log/logfile 2>&1 &" postgres
>
> No. I had PostgreSQL installed for a long time, and it *always* started up
> on boot.
I remember that after installing postgresql server, there was no data
and log folders, then i manually created the data and log folders, and
initiated the database, then i can start the database by "postgres -D
/var/lib/postgresql/data > /var/lib/postgresql/log/logfile 2>&1 &".
> Look in /usr/share/postgresql-common/init.d-functions to see if there's some
> env variable that controls whether the boot script immediately dies or not.
> It might reference a file in /etc/default.
this file is too complex for me to read, i know little about bash
script. but thanks
> --
> Ron Johnson, Jr.
> Jefferson LA USA
>
> Help a man when he is in trouble and he will remember you when
> he is in trouble again.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject
> of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>
--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]
10-28-2008, 08:26 AM
"Star Liu"
how to start postgresql server at machine startup?
On Tue, Oct 28, 2008 at 3:26 PM, Jeff D <fixedored@gmail.com> wrote:
> On Tue, 28 Oct 2008, Star Liu wrote:
>
>> On Tue, Oct 28, 2008 at 10:58 AM, Ron Johnson <ron.l.johnson@cox.net> wrote:
>> > On 10/27/08 21:07, Star Liu wrote:
>> >>
>> >> I installed postgresql server in my machine, but i does not start
>> >> automatically at startup time, so i need to mannually type these
>> >> commands to start it everytime when i restart system
>> >>
>> >> Desktop:~# su postgres
>> >> Desktop:/root$ cd ~
>> >> Desktop:~$ postgres -D ~/data >~/log/logfile 2>&1 &
>> >>
>> >> i tried to add this command line into /etc/X11/Xsession.d/95StarHabit:
>> >
>> > Why the heck would you put it in an X script??????????
>> I do not know, I just put all the things I want to do at system
>> startup into this file
>>
>> >> su -c "postgres -D /var/lib/postgresql/data >
>> >> /var/lib/postgresql/log/logfile 2>&1 &" postgres
>> >> but it doesn't work
>> >>
>> >> how can i make these commands automatically executed at system startup?
>> >> thanks
>> >
>> > How did you install PostgreSQL? If thru a Debian package, then Debian will
>> > handle all this for you.
>> Yes, i installed it thru debian package, but it doesn't start up at
>> system startup, so i need to start it by myself, is there anyway to
>> automate it? thanks
>>
>
> Are you sure its not starting and just listening on the localhost
> interface? This is how it comes configured by default. If you want it to
> listen on a different interface you have to edit
> /etc/postgresql/8.3/main/postgresql.conf to reflect that and restart it
> through /etc/init.d/postgresql-8.3 restart .
my /etc/postgresql folder has nothing inside, did i miss some process
for postgresql server? thanks
> jeff
>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>
--
I'm a debian user and a web
developer(XML+XSLT+AJAX+XHTML+CSS+PostgreSQL+MON O C#) in City of
Shanghai, China.
Welcome to add my IMs! (msn) starliu@live.com (xmpp) minxinjianxin@gmail.com
HomePage http://starliu dot 9966 dot com [It's only available when my
personal machine is running, on which it's hosted.]