This is a discussion on Re: rc init scripts within the Linux Administration forums, part of the Linux Forums category; Me :) wrote: > Hi > Linux newbie here. I'm trying to get mysql / smb / httpd to auto-start on &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Me :) wrote:
> 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. |
|
|||
|
"renrutv" <renrutv@yahoo.com> wrote in message news:SNDQa.1682$Mc.154270@newsread1.prod.itd.earth link.net... > Me :) wrote: > > > 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 :) |
|
|||
|
Me :) wrote:
> > "renrutv" <renrutv@yahoo.com> wrote in message > news:SNDQa.1682$Mc.154270@newsread1.prod.itd.earth link.net... >> Me :) wrote: >> >> > 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. > 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). |