From owner-freebsd-questions@freebsd.org Tue Mar 22 14:07:47 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F479AD97B7 for ; Tue, 22 Mar 2016 14:07:47 +0000 (UTC) (envelope-from ml@netfence.it) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id F3E51B69 for ; Tue, 22 Mar 2016 14:07:46 +0000 (UTC) (envelope-from ml@netfence.it) Received: by mailman.ysv.freebsd.org (Postfix) id F347AAD97B6; Tue, 22 Mar 2016 14:07:46 +0000 (UTC) Delivered-To: questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2EE8AD97B5 for ; Tue, 22 Mar 2016 14:07:46 +0000 (UTC) (envelope-from ml@netfence.it) Received: from smtp205.alice.it (smtp205.alice.it [82.57.200.101]) by mx1.freebsd.org (Postfix) with ESMTP id 92750B68 for ; Tue, 22 Mar 2016 14:07:46 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.ventu (82.58.25.117) by smtp205.alice.it (8.6.060.28) (authenticated as acanedi@alice.it) id 56332F71247D88CD for questions@freebsd.org; Tue, 22 Mar 2016 15:07:42 +0100 Received: from alamar.ventu (alamar.ventu [10.1.2.18]) by soth.ventu (8.15.2/8.14.9) with ESMTP id u2ME7fVU022909 for ; Tue, 22 Mar 2016 15:07:41 +0100 (CET) (envelope-from ml@netfence.it) From: Andrea Venturoli Subject: RC script not working To: questions@freebsd.org Message-ID: <56F151AD.7090009@netfence.it> Date: Tue, 22 Mar 2016 15:07:41 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2016 14:07:47 -0000 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.