Date: Mon, 22 Apr 2002 18:24:30 -0700 From: Ryan Hill <rhill@xypoint.com> To: 'Giorgos Keramidas' <keramida@ceid.upatras.gr> Cc: "'freebsd-questions@freebsd.org'" <freebsd-questions@freebsd.org> Subject: RE: preferred method to start daemons Message-ID: <38985D9205A0D411A10500508B10DE66029974E9@ebert.xypoint.com>
next in thread | raw e-mail | index | archive | help
Giorgos, Thanks for your help - your startup script template worked like a charm. I forgot about chmod'ing the script to be executable, so with a little editing and a chmod, I'm in business. FYI - The handbook reference I used was: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-start ing-services.html which made no mention of the requirement for execute permissions (should be obvious, but hey, I forgot!) and also no mention of changing the extension to .sh to autoboot. Thanks, Ryan > -----Original Message----- > From: Giorgos Keramidas [mailto:keramida@ceid.upatras.gr] > Sent: Monday, April 22, 2002 5:42 PM > To: Ryan Hill > Cc: 'freebsd-questions@freebsd.org' > Subject: Re: preferred method to start daemons > > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38985D9205A0D411A10500508B10DE66029974E9>