From owner-freebsd-hackers Sun Jan 31 18:42:54 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA05538 for freebsd-hackers-outgoing; Sun, 31 Jan 1999 18:42:54 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from epistolic.cynic.net (epistolic.cynic.net [199.175.137.136]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA05531 for ; Sun, 31 Jan 1999 18:42:52 -0800 (PST) (envelope-from cjs@cynic.net) Received: from localhost (localhost [[UNIX: localhost]]) by epistolic.cynic.net (8.9.1a/8.9.1) with SMTP id SAA16102; Sun, 31 Jan 1999 18:41:14 -0800 (PST) Date: Sun, 31 Jan 1999 18:41:12 -0800 (PST) From: Curt Sampson To: Robert Withrow cc: Dru Nelson , freebsd-hackers@FreeBSD.ORG Subject: Re: more modular rc/init/uninit system... In-Reply-To: <199901311549.KAA06309@spooky.rwwa.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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 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