From owner-freebsd-hackers Fri Nov 20 05:03:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA29039 for freebsd-hackers-outgoing; Fri, 20 Nov 1998 05:03:07 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from post.mail.nl.demon.net (post-10.mail.nl.demon.net [194.159.73.20]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA29031 for ; Fri, 20 Nov 1998 05:03:03 -0800 (PST) (envelope-from rene@canyon.demon.nl) Received: from [212.238.15.212] (helo=canyon.demon.nl) by post.mail.nl.demon.net with esmtp (Exim 2.02 #1) id 0zgqCm-00071X-00; Fri, 20 Nov 1998 13:02:32 +0000 Received: (from rene@localhost) by canyon.demon.nl (8.8.8/8.8.8) id NAA00990; Fri, 20 Nov 1998 13:16:29 +0100 (CET) (envelope-from rene) From: Rene de Vries Message-Id: <199811201216.NAA00990@canyon.demon.nl> Subject: Re: /etc/rc.d, and changes to /etc/rc? In-Reply-To: <19981119235019.54220@follo.net> from Eivind Eklund at "Nov 19, 98 11:50:19 pm" To: freebsd-hackers@FreeBSD.ORG (freebsd-hackers) Date: Fri, 20 Nov 1998 13:16:28 +0100 (CET) Cc: eivind@yes.no (Eivind Eklund) X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi All, I like this thread! Packaging software would be a lot easier if this was implemented in FreeBSD. Wouldn't it be neat to have a command like: "service start apache" which starts apache (and all other services needed to run apache). I think that this could be done along the same lines as Eivind suggested, but without the "RC:BEFORE" option. Services should know on which other services they depend on and therefor you don't need a before option. /etc/rc could then use something like ". /sbin/service start all" to start all services. The nice thing is that if you know a dependency graph of all services you could also use it to stop services, stopping also all services depending on the stopped service. This would easy starting and stopping of services that provide a service for other services (like databases). Suggested user-interface: /sbin/service list List all running services, this can be done as Eivind states, using /var/run/services. /sbin/service start Start all services (including ) to be able to use the service . /sbin/service stop Stop all services that depend on and stop the service . Maybe we should move the stuff that is currently started from rc* to be seen as a service. This has the *big* disadvantage of removing rc.conf (or sourcing that file in a lot of services). I don't know if the actual implementation would be easy (or at least feasible), but the ui would certainly help a lot of sysadmins with their daily work. I can't see all the (dis)advantages of this idea, so please don't flame me. Rene > On Wed, Nov 18, 1998 at 09:19:19PM +0000, Nik Clayton wrote: > > On Tue, Nov 17, 1998 at 09:01:38PM +0000, Nik Clayton wrote: > > > If there are no more comments by Thursday I'll take it as tacit agreement, > > > and go ahead. I'll do sendmail first. > > > > Well, that's certainly one way to kick off a discussion. > > > > Attached is a quick implementation of what I've been talking about. All > > it does is provide startup scripts for inetd and an NFS server. This is > > a minimal implementation, provided for people to kick around. > > If you're going to do this, please do it properly - splitting /etc/rc, > allowing service overrides, and tracking dependencies between > different services fully (topological sort). > > A re-write of /etc/rc (along with rc.network, rc.serial, and > rc.pccard) to do this is at > http://www.freebsd.org/~eivind/newrc.tar.gz > > As I did it here, it will require grep, sed and tsort to move to the > root partition - this could be replaced by just sed and tsort by > abusing sed, or a single program written to do the function > sed, grep and tsort fills in my code. > > The syntax for dependencies in the stuff I wrote is adding extra lines > for the dependencies to the individual config files; the format of > these are > > #RC:RUNINRC > - Run this service by sourcing into rc (. ) > #RC:AFTER > - Start the service this script represent after the other service > #RC:BEFORE > - Start the service this script represent before the other service > > It is possible to introduce 'virtual services' that are just used as > split-nodes - I'm not sure if this is good or bad. > > The syntax for selecting scripts is that they have to be named after > the regexp [0-9]*[A-Za-z]+[0-9]* > > We should probably also record which services are started somewhere - > touching a file in /var/run/services/ is one way of doing this. > > > The code is mostly 'proof of concept' - I've not even tested the last > changes. I have tested that the scripts are run in correct order etc > from the basic concept. > > Eivind. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > -- Rene de Vries http://www.tcja.nl/~rene; mailto:rene@tcja.nl To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message