Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jan 1999 18:41:12 -0800 (PST)
From:      Curt Sampson <cjs@cynic.net>
To:        Robert Withrow <witr@rwwa.com>
Cc:        Dru Nelson <dnelson@redwoodsoft.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: more modular rc/init/uninit system... 
Message-ID:  <Pine.NEB.4.02.9901311835420.15631-100000@epistolic.cynic.net>
In-Reply-To: <199901311549.KAA06309@spooky.rwwa.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 31 Jan 1999, Robert Withrow wrote:

> dnelson@redwoodsoft.com said:
> :- /etc/r.c/init.d/{name your service} start|stop|status|restart 
> 
> Which ignores the relationships issue.  For example, restarting X
> may cause Y and Z to croak!
> 
> What is needed is something like this:
> 
>   /etc/initsys <package> start|stop|status|restart
> 
> Where the initsys script takes into account the relationships.

I proposed a way of doing this for NetBSD recently, though I've
not gotten around to implementing anything yet. Basically what you
would have would be an rc.d directory with scripts for each
application that take the start|stop|status|restart argument above,
but they would also accept a couple of arguments that would spit
out the services it depends on and the services dependent on it.
There'd be a program that would run all of these, figure out a
dependency graph, and generate a shell script capable of starting
or stopping anything with the dependencies taken into account.  (I
felt that, in a boot or single-user environment, the shell script
would be a lot more reliable, not to mention a lot faster, than
something that tried to generate the dependencies dynamically.)

One interesting thing you can do with this is dump your own script,
`foo', into the directory which says `x, y and z are all dependent
on me.' Then you can start or stop foo, and that would take care
of starting and stopping x, y and z. This will let you emulate SysV
run levels, but also provide a lot more flexability.

cjs
--
Curt Sampson  <cjs@cynic.net>   604 801 5335   De gustibus, aut bene aut nihil.
The most widely ported operating system in the world: http://www.netbsd.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.4.02.9901311835420.15631-100000>