starting daemons at server start

Marty Landman MLandman at face2interface.com
Sun Jan 4 11:31:48 PST 2004


At 02:21 PM 1/4/2004, Micke P wrote:

>I'm thinking primarily of starting apache and a dynamic ip updater 
>automatically at startup.

Micke, here's a sample from my machine that may help:

# ls -alh /usr/local/etc/rc.d
total 20
drwxr-xr-x  2 root  wheel  512B Dec 30 16:58 .
drwxr-xr-x  9 root  wheel  512B Dec  7 16:13 ..
-rwxr-x---  1 root  wheel  181B Dec 30 16:55 000.mysql-client.sh
-rwxr-xr--  1 root  wheel  144B Nov 12 16:18 001.landns.root.sh
-r-xr-xr--  1 root  pgsql  875B Nov 11 17:24 010.pgsql.sh
-rwxr-x--x  1 root  wheel  407B Nov 12 19:33 apache2.sh
-rwxr-xr-x  1 root  wheel    3K Nov 14 21:12 cups.sh.sample
-rwxr-x---  1 root  wheel  549B Dec 30 16:58 mysql-server.sh
-r-xr-xr-x  1 root  wheel  602B Nov 14 21:47 samba.sh.sample
# cat /usr/local/etc/rc.d/apache2.sh
#!/bin/sh
PREFIX=/usr/local

case "$1" in
start)
         [ "ssl" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt" ] 
&& SSL=ssl
         [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl 
start${SSL} > /dev/null && echo -n ' apache2'
         ;;
stop)
         [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > 
/dev/null && echo -n ' apache2'
         ;;
*)
         echo "Usage: `basename $0` {start|stop}" >&2
         ;;
esac

exit 0
Swami:



Marty Landman   Face 2 Interface Inc 845-679-9387
Sign On Required: Web membership software for your site
Make a Website: http://face2interface.com/Home/Demo.shtml



More information about the freebsd-questions mailing list