From owner-freebsd-questions Thu Jul 8 15:13: 3 1999 Delivered-To: freebsd-questions@freebsd.org Received: from java.dpcsys.com (java.dpcsys.com [206.16.184.7]) by hub.freebsd.org (Postfix) with ESMTP id 033CC14F7E for ; Thu, 8 Jul 1999 15:12:59 -0700 (PDT) (envelope-from dan@dpcsys.com) Received: from localhost (dan@localhost) by java.dpcsys.com (8.9.1a/8.9.1) with SMTP id PAA24878; Thu, 8 Jul 1999 15:12:25 -0700 (PDT) Date: Thu, 8 Jul 1999 15:12:25 -0700 (PDT) From: Dan Busarow To: Chris Zwilling Cc: freebsd-questions@FreeBSD.ORG Subject: Re: System V style init files. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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