Date: Wed, 18 Nov 1998 14:35:03 +0300 (MSK) From: Grigoriy Strokin <grg@philol.msu.ru> To: Nik Clayton <nik@nothing-going-on.demon.co.uk> Cc: current@FreeBSD.ORG Subject: Re: /etc/rc.d, and changes to /etc/rc? Message-ID: <Pine.BSF.4.05.9811181432200.508-100000@isabase.philol.msu.ru> In-Reply-To: <19981117235709.20735@nothing-going-on.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I know that Solaris /etc/inittab provides a very
robust mechanism for rerunning a process with a given
pid if it dies. The analogue in FreeBSD is /etc/ttys:
if mgetty/xdm exits/dies another instance is started.
inittab is more flexible, because the processes
have not to be connected to terminals... For example,
I'd like to restart inetd in my FreeBSD current
every time it dies 1-4 times per week :)
Grigoriy.
On Tue, 17 Nov 1998, Nik Clayton wrote:
> Folks,
>
> [ Originally posted to -hackers. Forwarded to -current at Robert Nordier's
> request, apparently fewer developers than I thought read -hackers.
>
> Reply-to *not* set, I can read replies in either -hackers or -current,
> and this is probably -current material as much as it is -hackers ]
>
> During the day job, I use Solaris. This is not, in and of itself, a bad
> thing.
>
> Solaris uses run levels. I don't particularly like them, but I tolerate
> them. I *don't* want to bring run levels (or even, if Terry's reading,
> run states) to FreeBSD.
>
> The one useful feature I've found with run [levels|states] as implemented
> on Solaris is the /etc/init.d directory. For those that don't know, this
> contains 'n' scripts, one per 'service', that take 'start' and 'stop'
> parameters. If you want to stop Sendmail, it's
>
> sh /etc/init.d/sendmail stop
>
> No need to poke around with ps, grep, and friends to determine the PID to
> kill, no wondering about whether or not there's a lock file you might
> need to clean up afterwards, and so on. It helps save a little time, and
> is probably easier for newcomers to understand as well.
>
> We already have the beginning of a system like this for ported software,
> with the ${PREFIX}/etc/rc.d directory.
>
> What are people's thoughts on doing the same thing to the base system?
>
> In essence, this would involve (on a case by case basis) going through
> the daemons started in /etc/rc*, building a script to start/stop the
> daemon, and changing the code in /etc/rc* to call these scripts instead.
>
> NOTE: The order in which scripts would be called by /etc/rc* would not
> be determined by the script name, there would be none of this silliness
> with S20foo and K50bar, ordering is still determined by /etc/rc*
>
> All I want to do is abstract out the daemon start/stop process a little
> more.
>
> Down the road, this could bring other benefits as well;
>
> - For those that like run levels/states, it becomes easier for them to
> create a port with a new version of init that implemented them.
> People that want run levels install the port, people that don't, don't.
>
> - It makes it easier to install replacements for programs that are in
> the base system. If sendmail was started from /etc/rc.d/smtp.sh,
> the first thing smtp.sh could check for is the existence of
> /usr/local/etc/rc.d/smtp.sh, and call that instead if it existed.
> Replacing sendmail with qmail or vmailer then becomes a little easier.
>
> - Simplifies documentation. When explaining how to stop a system process,
> you don't need to explain ps, grep, kill, awk/cut, backticks, and
> pipelines. You just say "Do it like this", and explain the magic
> behind it at a later point.
>
> I realise this is a religious issue, and one of those things people like
> to get all excited about. However, I've just seen a message from Jordan
> suggesting the ordering be changed in host.conf, and *no one* objected.
> I figured I'd jump in quickly, before they stop putting Prozac in the
> water.
>
> N
> --
> C.R.F. Consulting -- we're run to make me richer. . .
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-current" in the body of the message
>
=== Grigoriy Strokin, Lomonosov University (MGU), Moscow ===
=== contact info: http://isabase.philol.msu.ru/~grg/ ===
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9811181432200.508-100000>
