Re: how to start postgresql server at machine startup?
On Tue, 28 Oct 2008 10:07:13 +0800
"Star Liu" <minxinjianxin@gmail.com> 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:
> 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
Normally when you install PostgreSQL in Debian it will automatically
install the startup script /etc/init.d/postgresql and by default that
will start when you boot the machine.
You also don't create the log or data directories manually so you must
have done something wrong during installation.
Try uninstall everything and reinstall it using "the debian way":
# apt-get --purge remove postgresql-8.1
or
# apt-get --purge remove postgresql-8.3 (if you are using lenny).
Remove any log and/or data directories, scripts etc. that you have
created manually.
Then just install PostgreSQL with:
# apt-get update && apt-get install postgresql-8.1 (or 8.3 if lenny).
Make sure you are ONLY using Debian repos and not something else that
might provide another version of PostgreSQL.
I manage several PostgreSQL installations daily, and I have never
experienced the problems you describe.
> --
> 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
>
>
---
Best regards
Kim Lesmer
Programmer/Unix systemadministrator
Web : www.bitflop.com
E-mail : knl@bitflop.com
Reply to: