Where is /etc/init.d

Started by Mayanabout 24 years ago5 messagesgeneral
Jump to latest
#1Mayan
escalante@canada.com

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...

#2Wyatt Draggoo
wyatt@draggoo.com
In reply to: Mayan (#1)
Re: Where is /etc/init.d

On some Linux boxes, the init scripts are in /etc/rc.d/init.d, not
/etc/init.d --- I'm not sure why.

Wyatt

Show quoted text

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

#3Jeff Davis
pgsql@j-davis.com
In reply to: Mayan (#1)
Re: Where is /etc/init.d

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

Show quoted text

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

#4Michael Meskes
meskes@postgresql.org
In reply to: Mayan (#1)
Re: Where is /etc/init.d

On Sat, Feb 09, 2002 at 05:07:44PM -0500, Mayan wrote:

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

Wait a moment, you mean you do not have /etc/init.d? That surely should
exists.

My start-up script is

mme@feivel:~$ stat /etc/init.d/postgresql
File: "/etc/init.d/postgresql"
Size: 1819 Blocks: 4 IO Block: 4096 Regular File
Device: 305h/773d Inode: 41055 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: Sun Feb 10 09:50:31 2002
Modify: Wed Jan 9 12:23:42 2002
Change: Sun Feb 3 11:50:26 2002

on a Debian Woody system using Postgresql 7.1.3-7 i.e. the Debian package.

I'm not sure why you try installing from source, but if you do I'd recommend
grabbing the Debian package sources and going from there. Then you can
create your own package file that fits into the system nicely.

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

#5Michael Meskes
meskes@postgresql.org
In reply to: Wyatt Draggoo (#2)
Re: Where is /etc/init.d

On Sat, Feb 09, 2002 at 07:29:53PM -0800, wyatt@draggoo.com wrote:

On some Linux boxes, the init scripts are in /etc/rc.d/init.d, not

And some even used /sbin/init.d but no longer do that. :-)

/etc/init.d --- I'm not sure why.

Debian does use /etc/init.d.

Michael
--
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!