Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 1998 13:16:28 +0100 (CET)
From:      Rene de Vries <rene@canyon.demon.nl>
To:        freebsd-hackers@FreeBSD.ORG (freebsd-hackers)
Cc:        eivind@yes.no (Eivind Eklund)
Subject:   Re: /etc/rc.d, and changes to /etc/rc?
Message-ID:  <199811201216.NAA00990@canyon.demon.nl>
In-Reply-To: <19981119235019.54220@follo.net> from Eivind Eklund at "Nov 19, 98 11:50:19 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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 <name>
		Start all services (including <name>) to be able
		to use the service <name>.

	/sbin/service stop <name>
		Stop all services that depend on <name> and stop 
		the service <name>.

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 (. <filename>)
> #RC:AFTER <servicename>
> 	- Start the service this script represent after the other service
> #RC:BEFORE <servicename>
> 	- 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811201216.NAA00990>