rc init scripts

rc init scripts

Post by Me :\ » Tue, 15 Jul 2003 18:31:57



Hi
Linux newbie here. I'm trying to get mysql / smb / httpd to auto-start on
bootup of the server. From most of the documentation I found on the web I
was supposed to
1) copy the startup script to /etc/init.d (Did this , scripts work by
invoking them with a start parameter)
2) create symbolic links prefaced with S and followed by a number in one of
the run level directories (I did this in rc3.d)
Rebooted the computer, they didnt work.
I then deleted the symbolic links and tried adding them using chkconfig -add
mysql.server (the mysql default script), following this chkconfig --list
showed mysql ON on runlevel 2 and 4. But it still didnt work. I also added
httpd at runlevel 3, no dice with that either (the httpd script did have the
chkconfig values preset).

Any idea what I'm doing wrong or not doing? Thanks a LOT :)

Muhammed

 
 
 

rc init scripts

Post by Xyer » Wed, 16 Jul 2003 03:31:11



> Hi
> Linux newbie here. I'm trying to get mysql / smb / httpd to auto-start on
> bootup of the server. From most of the documentation I found on the web I
> was supposed to
> 1) copy the startup script to /etc/init.d (Did this , scripts work by
> invoking them with a start parameter)
> 2) create symbolic links prefaced with S and followed by a number in one of
> the run level directories (I did this in rc3.d)
> Rebooted the computer, they didnt work.
> I then deleted the symbolic links and tried adding them using chkconfig -add
> mysql.server (the mysql default script), following this chkconfig --list
> showed mysql ON on runlevel 2 and 4. But it still didnt work. I also added
> httpd at runlevel 3, no dice with that either (the httpd script did have the
> chkconfig values preset).

> Any idea what I'm doing wrong or not doing? Thanks a LOT :)

> Muhammed

It does vary slightly, but in essence you are doing it OK.

Check the file permissions on the file in /etc/init.d, I believe they
need to be executable.

Check your log files also - they will tell you what (if anything) went
wrong.

eg.
cp foo-script /etc/init.d
chmod +x /etc/init.d/foo-script
ln -s /etc/init.d/foo-script /etc/rc.d/rc3.d/S97foo-script
ln -s /etc/init.d/foo-script /etc/rc.d/rc0.d/K97foo-script

 
 
 

rc init scripts

Post by renrut » Wed, 16 Jul 2003 04:48:02



> Hi
> Linux newbie here. I'm trying to get mysql / smb / httpd to auto-start on
> bootup of the server. From most of the documentation I found on the web I
> was supposed to
> 1) copy the startup script to /etc/init.d (Did this , scripts work by
> invoking them with a start parameter)
> 2) create symbolic links prefaced with S and followed by a number in one
> of the run level directories (I did this in rc3.d)
> Rebooted the computer, they didnt work.
> I then deleted the symbolic links and tried adding them using chkconfig
> -add mysql.server (the mysql default script), following this chkconfig
> --list showed mysql ON on runlevel 2 and 4. But it still didnt work. I
> also added httpd at runlevel 3, no dice with that either (the httpd script
> did have the chkconfig values preset).

> Any idea what I'm doing wrong or not doing? Thanks a LOT :)

> Muhammed

Are you sure you're booting into runlevel 3?  The default on most distros is
runlevel 5 (graphical logon mode).  Type /sbin/runlevel and check.  If you
see something like:

N 5

This means your in runlevel 5 (It's the last number that tells the current
runlevel).  

You can also check the runlevel by looking at /etc/inittab and looking for
the line that says:

# The default runlevel is defined here
id:5:initdefault:

If you are runlevel 5 you need to do your above changes to /etc/init.d/rc5.d
not /etc/init.d/rc3.d.

 
 
 

rc init scripts

Post by Me :\ » Wed, 16 Jul 2003 13:16:10




> > Hi
> > Linux newbie here. I'm trying to get mysql / smb / httpd to auto-start
on
> > bootup of the server. From most of the documentation I found on the web
I
> > was supposed to
> > 1) copy the startup script to /etc/init.d (Did this , scripts work by
> > invoking them with a start parameter)
> > 2) create symbolic links prefaced with S and followed by a number in one
> > of the run level directories (I did this in rc3.d)
> > Rebooted the computer, they didnt work.
> > I then deleted the symbolic links and tried adding them using chkconfig
> > -add mysql.server (the mysql default script), following this chkconfig
> > --list showed mysql ON on runlevel 2 and 4. But it still didnt work. I
> > also added httpd at runlevel 3, no dice with that either (the httpd
script
> > did have the chkconfig values preset).

> > Any idea what I'm doing wrong or not doing? Thanks a LOT :)

> > Muhammed

> Are you sure you're booting into runlevel 3?  The default on most distros
is
> runlevel 5 (graphical logon mode).  Type /sbin/runlevel and check.  If you
> see something like:

> N 5

> This means your in runlevel 5 (It's the last number that tells the current
> runlevel).

> You can also check the runlevel by looking at /etc/inittab and looking for
> the line that says:

> # The default runlevel is defined here
> id:5:initdefault:

> If you are runlevel 5 you need to do your above changes to
/etc/init.d/rc5.d
> not /etc/init.d/rc3.d.

Hi again,
Thanks a lot :), ur solution worked like a charm. I had erroneously thought
that all of the rcX.d scripts run , not only the ones in the same runlevel
ur logging in to. One other question, since the runlevel may be changed
later, to make sure that the services I want are running, should I add the
symbolic link to all the run levels 2 thru 5? No harm in doing that?

Muhammed
PS Thanks again :)

 
 
 

rc init scripts

Post by V. Turne » Fri, 18 Jul 2003 06:29:47






>> > Hi
>> > Linux newbie here. I'm trying to get mysql / smb / httpd to auto-start
> on
>> > bootup of the server. From most of the documentation I found on the web
> I
>> > was supposed to
>> > 1) copy the startup script to /etc/init.d (Did this , scripts work by
>> > invoking them with a start parameter)
>> > 2) create symbolic links prefaced with S and followed by a number in
>> > one of the run level directories (I did this in rc3.d)
>> > Rebooted the computer, they didnt work.
>> > I then deleted the symbolic links and tried adding them using chkconfig
>> > -add mysql.server (the mysql default script), following this chkconfig
>> > --list showed mysql ON on runlevel 2 and 4. But it still didnt work. I
>> > also added httpd at runlevel 3, no dice with that either (the httpd
> script
>> > did have the chkconfig values preset).

>> > Any idea what I'm doing wrong or not doing? Thanks a LOT :)

>> > Muhammed

>> Are you sure you're booting into runlevel 3?  The default on most distros
> is
>> runlevel 5 (graphical logon mode).  Type /sbin/runlevel and check.  If
>> you see something like:

>> N 5

>> This means your in runlevel 5 (It's the last number that tells the
>> current runlevel).

>> You can also check the runlevel by looking at /etc/inittab and looking
>> for the line that says:

>> # The default runlevel is defined here
>> id:5:initdefault:

>> If you are runlevel 5 you need to do your above changes to
> /etc/init.d/rc5.d
>> not /etc/init.d/rc3.d.

> Hi again,
> Thanks a lot :), ur solution worked like a charm. I had erroneously
> thought that all of the rcX.d scripts run , not only the ones in the same
> runlevel ur logging in to. One other question, since the runlevel may be

Actually, this is really not a bad assumption.  Other versions of Unix *do*
work this way.  On Solaris, runlevel 5 means execute the scripts for
runlevels 1,2,3,4 and then 5.  So all your network stuff is added to
runlevel3.  Runlevel 5 would just start the X stuff and wouldn't have to
bother with the network stuff because it had already been started.  On
Linux the runlevels are "orthogonal", and run independently of each other.  

Quote:> changed later, to make sure that the services I want are running, should I
> add the symbolic link to all the run levels 2 thru 5? No harm in doing
> that?

Yes, definitely, although practically speaking runlevels 3 and 5 are all
you have to be concerned with (at least that's my experience as I'm just
running a workstation for browsing the web etc).