Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jul 1999 15:12:25 -0700 (PDT)
From:      Dan Busarow <dan@dpcsys.com>
To:        Chris Zwilling <chris@cloudnet.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: System V style init files.
Message-ID:  <Pine.BSF.3.96.990708145458.6086M-100000@java.dpcsys.com>
In-Reply-To: <Pine.LNX.4.10.9907081642560.23233-100000@arus.cloudnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 8 Jul 1999, Chris Zwilling wrote:
> I am coming from a RedHat world where all services (inetd, sendmail,
> httpd, etc etc etc) are started and stopped with individual init scripts.
> Yesterday I was doing some sendmail hacking and I found it quite tedious
> to killall sendmail and then sendmail -bp....  Is there anything like the
> System V init file structure that RedHat has or should I write my own.
> The five second version of the question is:  Is there any easy way to
> restart individual services?

Well this always starts a flame war :)

For the base system /etc/rc runs the show with help from /etc/rc.*
After the more or less monolithic main startup sequence it also
runs scripts in /usr/local/etc/rc.d and any other directory you
specify.  The /usr/local/etc/rc.d stuff is kinda sysv like.

All the ports for the daemons I've used are now adding their startup
scripts to /usr/local/etc/rc.d.  You can even name/number the scripts
in SYSV fashion to control startup order. (unlike sysv the script name
*has* to end in .sh and it also has to have the execute bit set and
the first letter has no meaning)

For restarting sendmail you can use this little script

#!/bin/sh
PID=`head -1 /var/run/sendmail.pid`
kill -1 $PID

I call it smc to go along with ndc.  You could even throw a
test in to see if it was called with reload, restart, stop ...
and change the signal you send.

Dan
-- 
 Dan Busarow                                                  949 443 4172
 Dana Point Communications, Inc.                            dan@dpcsys.com
 Dana Point, California  83 09 EF 59 E0 11 89 B4   8D 09 DB FD E1 DD 0C 82



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" 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.3.96.990708145458.6086M-100000>