Re: Where is /etc/init.d - Mailing list pgsql-general
From | Jeff Davis |
---|---|
Subject | Re: Where is /etc/init.d |
Date | |
Msg-id | 200202100517.VAA04886@mail.ucsd.edu Whole thread Raw |
In response to | Where is /etc/init.d (Mayan <escalante@canada.com>) |
List | pgsql-general |
For debian, upon entering runlevel 2 (the runlevel that is usually the default when you just start the computer), it looks in /etc/rc2.d/ and executes all the scripts beginning with "S##" with the argument "start", and all of the scripts beginning with "K##" with an argument of "stop". The lower the number denoted by "##" the earlier it's executed. What you want it to do is go in and execute something similar to: postgresql start (for power on) postgresql stop (for power off) The best way to do this is: make an init file that properly starts and stops postgresql when sent a "start" or "stop" argument respectively. I believe the script you are refering to is the one you want. So, copy that file into the /etc/init.d/ directory and give it the name "postgresql". You should now have a file "/etc/init.d/postgresql". Make sure it's executable (do "chmod 755 /etc/init.d/postgresql") then test it by doing: /etc/init.d/postgresql start and /etc/init.d/postgresql stop and see if it starts/stops the database. Now make links in the /etc/rc2.d/ for system startup: ln -s /etc/init.d/postgresql /etc/rc2.d/S80postgresql Now the stop scripts: ln -s /etc/init.d/postgresql /etc/rc0.d/K80postgresql ln -s /etc/init.d/postgresql /etc/rc6.d/K80postgresql now all those startup/shutdown directories link to one postgres script. It should work properly. Jeff On Saturday 09 February 2002 02:07 pm, Mayan wrote: > First of all, I'd like to thanks to all the member of this mailing list > that have helped me installed PostgreSQL. I really would have not been > possible w/o your help. > Now I am facing the last part of the installation, which is to start and > shutdown Postgresql at boot up time and shutdown time respectively. > I did locate the file that does this operation under the '../contrib' > subdirectory of the .../postgresql-7.1.3 tree. However, the notes in the > 'linux' file indicate that I should place this file in the > 'etc/init.d/postgresql'. The problem I have is that the > '...init.d/posgresql' does not exist in my Debian's '/etc' directory > and, being a new-B, I have no idea what to do. > > The options are clear, I can create the directory so that I can add the > file to it, or, ask if there is another directory where Debian is > expecting to find this file. I have chosen the latter. > > I hope one of you can give me a hand on this, thanks... > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html
pgsql-general by date: