Need help with rc.d script
Ernie Luzar
luzar722 at gmail.com
Tue Nov 7 18:11:37 UTC 2017
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"
More information about the freebsd-questions
mailing list