[lug] init script that won't run stop() under F11

Ben Whaley bwhaley at gmail.com
Tue Sep 29 19:29:05 MDT 2009


Red Hat and derivatives are the only distros I know of that still do this.
SUSE did in past versions but OpenSUSE has moved away from it. Debian/Ubuntu
do not use it.

You'll sometimes see files there on almost any distro, however, due to Red
Hat-compatible init scripts from vendors. For instance, on my Ubuntu jaunty
Fusion VM, the vmware-tools script has this code for the start block:

[ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys
   touch /var/lock/subsys/"$subsys"


- Ben

On Tue, Sep 29, 2009 at 6:32 PM, Zan Lynx <zlynx at acm.org> wrote:

> Michael J. Hammel wrote:
> > On Tue, 2009-09-29 at 18:00 -0600, Zan Lynx wrote:
> >> RedHat init looks into /var/lock/subsys/* to see if it needs to run
> >> start/kill scripts during initlevel changes.
> >>
> >> The start should create a file in there with the right name and stop
> >> should remove it. Look at the rest of the scripts to see, but I think it
> >> is just the name of the init script.
> >
> > Yep - that was it.  Just touch the script name under /var/lock/subsys
> > and then remove it on stop. Thanks!
> >
> > Is that just a RH thing or do other distros rely on that too?  Do other
> > distros even have a /var/lock/subsys?  I want to make this script
> > functional on the more popular distros.
> >
>
> I don't know.
>
> I've done several scripts for RedHatish systems but not for others. I
> know Gentoo does not use /var/lock/subsys. I doubt that helps you :)
>
> You could read through /etc/rc.d/rc to see what it does. If that isn't
> the name of the script, check /etc/inittab to see. If the system uses
> Upstart then everything starts from /etc/event.d so look at the rc1,
> rc2, etc files in there.
>
> I also think the old SysV init scripts are probably becoming obsolete
> due to Upstart and the like.
>
> --
> Zan Lynx
> zlynx at acm.org
>
> "Knowledge is Power.  Power Corrupts.  Study Hard.  Be Evil."
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#hackingsociety
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20090929/7647dc8b/attachment.html>


More information about the LUG mailing list