Hi,
I have a problem with a rc script, when I try to check or stop the service.
It is very similar to the spamd rc script (with no rc_pre() and rc_start()):
$ grep -C2 pexp /etc/rc.d/{spamd,tarpitd}
/etc/rc.d/spamd-. /etc/rc.d/rc.subr
/etc/rc.d/spamd-
/etc/rc.d/spamd:pexp="spamd: \[priv\]"
/etc/rc.d/spamd-rc_reload=NO
/etc/rc.d/spamd-
--
/etc/rc.d/tarpitd-. /etc/rc.d/rc.subr
/etc/rc.d/tarpitd-
/etc/rc.d/tarpitd:pexp="tarpitd: \[priv\]"
/etc/rc.d/tarpitd-
/etc/rc.d/tarpitd-rc_reload=NO
The start parameter works correctly:
$ sudo /etc/rc.d/tarpitd -d start
doing rc_read_runfile
doing rc_check
tarpitd
doing rc_start
doing rc_write_runfile
(ok)
$ ps aux | grep "tarpitd:"
_tarpitd 22014 0.0 0.1 7176 3964 ?? Ss 10:18AM 0:00.46 tarpitd:
[priv] (tarpitd)
root 775 0.0 0.0 472 660 p1 I 10:18AM 0:00.00 tarpitd:
(blocker) (tarpitd)
seblec 6474 0.0 0.0 448 268 p1 R+/1 11:01AM 0:00.00 grep tarpitd:
If I try a manual pgrep, with the same syntax as in rc.subr, it works as
expected:
$ pgrep -f "^tarpitd: \[priv\]"
22014
But a check or stop doesn't:
$ sudo /etc/rc.d/tarpitd -d check ; echo $?
doing rc_read_runfile
doing rc_check
1
$ sudo /etc/rc.d/tarpitd -d stop
doing rc_read_runfile
doing rc_check
I'm using 5.5-release
What am I doing wrong?
Thank you!
Sebastien Leclerc