From owner-freebsd-questions Mon Apr 22 17:43:52 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 3542F37B417 for ; Mon, 22 Apr 2002 17:43:12 -0700 (PDT) Received: from hades.hell.gr (patr530-a184.otenet.gr [212.205.215.184]) by mailsrv.otenet.gr (8.12.2/8.12.2) with ESMTP id g3N0g2lv025482; Tue, 23 Apr 2002 03:42:02 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.2/8.12.2) with ESMTP id g3N0g18i003557; Tue, 23 Apr 2002 03:42:01 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from charon@localhost) by hades.hell.gr (8.12.2/8.12.2/Submit) id g3N0g1Cb003556; Tue, 23 Apr 2002 03:42:01 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Tue, 23 Apr 2002 03:42:01 +0300 From: Giorgos Keramidas To: Ryan Hill Cc: "'freebsd-questions@freebsd.org'" Subject: Re: preferred method to start daemons Message-ID: <20020423004201.GC3341@hades.hell.gr> References: <38985D9205A0D411A10500508B10DE66029974E6@ebert.xypoint.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <38985D9205A0D411A10500508B10DE66029974E6@ebert.xypoint.com> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-04-22 17:06, Ryan Hill wrote: > Soooo, I've got a bit of chicken vs. the egg problem here. I have a > mysql.server script placed in rc.d, but I'm unsure where to call it in the > startup process to actually start the server. I've also tried hacking > together a startup script for apache, but it bombs horribly when I try to > execute it manually for testing. Both methods (/etc/rc.local vs. /usr/local/etc/rc.d/PROGRAM.sh) work equally well. Here's what I put in a file called apache.sh in my /usr/local/etc/rc.d/ directory a few days back when I installed apache at home: % ls -l /usr/local/etc/rc.d/apache.sh -rwxr-xr-x 1 root wheel - 263 Apr 20 19:15 /usr/local/etc/rc.d/apache.sh % cat /usr/local/etc/rc.d/apache.sh #!/bin/sh case $1 in start) echo -n ' apache' /home/httpd/bin/apachectl start 2>&1 >/dev/null ||\ echo -n ':FAILED' ;; stop) echo -n ' apache' /home/httpd/bin/apachectl stop 2>&1 >/dev/null ||\ echo -n ':FAILED' ;; *) echo "usage: $0 {start|stop}" ;; esac Your script has to be executable by root and have an extension of .sh for the boot scripts to pick it up and run it automatically at boot and shutdown time. I think this is written in the Handbook. If it isn't, then it's a bug and please let me know what part you were reading so it can be fixed :-) Giorgos Keramidas FreeBSD Documentation Project keramida@{freebsd.org,ceid.upatras.gr} http://www.FreeBSD.org/docproj/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message