Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Nov 2017 13:11:36 -0500
From:      Ernie Luzar <luzar722@gmail.com>
To:        Ian Smith <smithi@nimnet.asn.au>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Need help with rc.d script
Message-ID:  <5A01F758.1050706@gmail.com>
In-Reply-To: <20171108043726.N72828@sola.nimnet.asn.au>
References:  <mailman.444.1510052978.1530.freebsd-questions@freebsd.org> <20171108021900.W9710@sola.nimnet.asn.au> <20171108043726.N72828@sola.nimnet.asn.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks Ian,
Ending the while loop with "done &" worked.
When I issue dynip from the command line it runs as a daemon but I have 
to use the kill command to stop it.

This is my rc.d script for dynip script. issuing "service dynip start" 
works but "service dynip stop" gives message saying
dynip not running? (Check /var/run/dynip.pid). Well ps ax shows it is 
running and I have to use the kill command to stop it.

Here is my rc.d script. What am I missing to populate the dynip.pid file 
so "service dynip stop" command will work?

#!/bin/sh
#
#
# PROVIDE: dynip
# REQUIRE: LOGIN
# KEYWORD: nojail shutdown
#
# Add the following line to /etc/rc.conf to enable dynip:
#
# dynip_enable="YES"
#

. /etc/rc.subr
name="dynip"
rcvar=dynip_enable
command="/usr/local/sbin/${name}"
pidfile="/var/run/${name}.pid"
load_rc_config ${name}
run_rc_command "$1"






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5A01F758.1050706>