[TriLUG] startup scripts, sendmail
Benjamin Reed
ranger at befunk.com
Sat Nov 10 15:03:43 EST 2001
Richard O. Hammer [ROHammer at EarthLink.net] wrote:
> Thank you, Benjamin,
>
> In addition to getting the job done, I'm also trying to
> understand what is happening. Guess I'll go read the
> chkconfig man page.
Basically, chkconfig manages /etc/rc#.d files automatically, instead
of having to add/remove the links manually. Every chkconfig-compatible
init script has a little header that says what runlevels it should be
in by default and what number it gets in the list, along with some other
miscellaneous information, like:
#!/bin/bash
#
# chkconfig: 2345 85 15 <--- the important line!!!
# description: GPM adds mouse support to text-based Linux applications such \
# the Midnight Commander. Is also allows mouse-based console \
# cut-and-paste operations, and includes support for pop-up \
# menus on the console.
# processname: gpm
# pidfile: /var/run/gpm.pid
# config: /etc/sysconfig/mouse
This means that if you run 'chkconfig gpm on', it will make an S85gpm file
in runlevels 2, 3, 4, and 5, to tell it to start, and a K15gpm file in
the rest (runlevels 0, 1, and 6) to tell it to stop.
It's not anything you can't do by hand (which is how it used to be done,
usually =) but it simplifies keeping track of it. You can also do stuff
like:
chkconfig --level 45 gpm off
...if don't want gpm to start in runlevels 4 and 5 anymore, and it will
Do The Right Thing. And the really handy part:
chkconfig --list
...which gives you a list of all the different scripts that are turned
on in each runlevel.
Quite handy. =)
This way you're not fiddling with the files themselves, which is usually
a no-no unless you really know what you're doing. You're much better off
enabling/disabling a package's init script than editing it to remove the
part that actually starts that package up, but still leaving the init
script turned "on", as far as init is concerned.
--
Ben Reed a.k.a. Ranger Rick (ranger at befunk.com)
http://defiance.dyndns.org/ / http://radio.scenespot.org/
It's ... clear that many self-identified "programmers" on /. are <ahem/>
"HTML programmers," the rodeo clowns of our profession. -- cthlptlk
More information about the TriLUG
mailing list