RC script not working
Andrea Venturoli
ml at netfence.it
Tue Mar 22 14:07:47 UTC 2016
Hello.
I've installed WeeWX in a jail and found the following startup script
somewhere:
> #!/bin/sh
> # Start script for FreeBSD, contributed by user Fabian Abplanalp
> # Adjust app and cfg locations as appropriate, then put this script
> # in /usr/local/etc/rc.d
> #
> WEEWX_BIN="/home/weewx/bin/weewxd"
> WEEWX_CFG="/home/weewx/weewx.conf"
> PIDFILE="/var/run/weewx.pid"
>
> case "$1" in
> "start")
> echo "Starting weewx..."
> /usr/local/bin/python ${WEEWX_BIN} ${WEEWX_CFG} --daemon &
> echo $! > ${PIDFILE}
> echo "done"
> ;;
>
> "stop")
> echo "Stopping weewx..."
> if [ -f ${PIDFILE} ] ; then
> kill `cat ${PIDFILE}`
> rm ${PIDFILE}
> echo "done"
> else
> echo "not running?"
> fi
> ;;
>
> "restart")
> echo "Restarting weewx..."
> $0 stop
> sleep 2
> $0 start
> ;;
>
> *)
> echo "$0 [start|stop|restart]"
> ;;
>
> esac
It works if I issue "service weewx [start|stop|restart]", but it won't
start the program on boot (or on jail restart).
Why?
Any sample of a rc.d script to start a Python deamon?
bye & Thanks
av.
More information about the freebsd-questions
mailing list