From owner-freebsd-ports@freebsd.org Fri Sep 11 15:18:44 2015 Return-Path: Delivered-To: freebsd-ports@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 E946FA0261E for ; Fri, 11 Sep 2015 15:18:44 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (unknown [IPv6:2602:d1:b4d6:e600:4261:86ff:fef6:aa2a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C43501B9C for ; Fri, 11 Sep 2015 15:18:44 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.14.9/8.14.9) with ESMTP id t8BFIhcO068738 for ; Fri, 11 Sep 2015 08:18:49 -0700 (PDT) (envelope-from bsd-lists@bsdforge.com) To: In-Reply-To: <441028827.153.1441982537926.JavaMail.Kevin@Thoth> References: <441028827.153.1441982537926.JavaMail.Kevin@Thoth> From: "Chris H" Subject: Re: rc script problem - pidfile not being recognised Date: Fri, 11 Sep 2015 08:18:49 -0700 Content-Type: text/plain; charset=UTF-8; format=fixed MIME-Version: 1.0 Message-id: <568af0e68aef53e74bbb736e33531ee5@ultimatedns.net> Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2015 15:18:45 -0000 On Fri, 11 Sep 2015 15:42:18 +0100 (BST) Kevin Golding wrote > I've been trying to work on a new port and it's my first that uses an rc > script so I've been expecting a few bumps, but there's one thing I can't seem > to fix and it's a blocker. I can't stop the daemon! > > It dopes create a pidfile so I have the following line in my script: > > pidfile="/var/run/${name}.pid" > > Alas... > > # service fuglu stop > fuglu not running? (check /var/run/fuglu.pid). > # cat /var/run/fuglu.pid > 24013 > > I don't get it. It is the right process ID: > > # ps -waux | grep fuglu > nobody 24013 0.0 0.5 139532 37372 - I 3:57PM 0:01.03 > /usr/local/bin/python2.7 /usr/local/bin/fuglu --pidfile /var/r root 26179 > 0.0 0.0 18824 1976 0 S+ 4:30PM 0:00.00 grep fuglu > > I'm at a loss as to what to try, I feel I'm missing something blindingly > obvious but it's a mystery to me so if anyone can wave the big red arrow at > my mistake I'd be a happy chappy! > > Full fuglu.in below: > > #!/bin/sh > > # $FreeBSD$ > # > # PROVIDE: fuglu > # REQUIRE: LOGIN > # KEYWORD: shutdown > # > # Add these lines to /etc/rc.conf.local or /etc/rc.conf > # to enable this service: > # > # fuglu_enable (bool): Set to NO by default. > # Set it to YES to enable fuglu. > > . /etc/rc.subr > > name="fuglu" > rcvar=fuglu_enable > > load_rc_config $name > : ${fuglu_enable:=no} > > command=%%PREFIX%%/bin/${name} > pidfile="/var/run/${name}.pid" > > run_rc_command "$1" This question might have been better directed at freebsd-hackers@ but... See if this get's it for you: /etc/rc.subr name=fuglu rcvar=fuglu_enable load_rc_config $name : ${fuglu_enable="NO"} : ${fuglu_pidfile="/var/run/${name}.pid"} command="/usr/local/sbin/${name}" pidfile="${fuglu_pidfile}" run_rc_command $* --Chris > _______________________________________________ > freebsd-ports@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"