From 80d8bd55da531cbe882eaa53434c5ff019e6a586 Mon Sep 17 00:00:00 2001 From: Pete Date: Thu, 7 May 2026 00:12:18 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20fix=20RC=20script=20=E2=80=94=20use=20p?= =?UTF-8?q?rocname=20full=20path=20for=20correct=20status=20reporting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FREEBSD.md | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/FREEBSD.md b/FREEBSD.md index fe492ca..63b8ea6 100644 --- a/FREEBSD.md +++ b/FREEBSD.md @@ -41,6 +41,7 @@ Create `/usr/local/etc/rc.d/fingerd`: ```sh #!/bin/sh + # PROVIDE: fingerd # REQUIRE: NETWORKING # KEYWORD: shutdown @@ -49,37 +50,15 @@ Create `/usr/local/etc/rc.d/fingerd`: name="fingerd" rcvar="fingerd_enable" -command="/usr/local/bin/finger" +command="/usr/sbin/daemon" +command_args="-f -p /var/run/fingerd.pid /usr/local/bin/finger" pidfile="/var/run/fingerd.pid" -command_interpreter="" - -start_cmd="fingerd_start" -stop_cmd="fingerd_stop" -status_cmd="fingerd_status" - -fingerd_start() { - echo "Starting ${name}." - /usr/sbin/daemon -p ${pidfile} -f ${command} -} - -fingerd_stop() { - if [ -f ${pidfile} ]; then - echo "Stopping ${name}." - kill $(cat ${pidfile}) && rm -f ${pidfile} - else - echo "${name} is not running." - fi -} - -fingerd_status() { - if [ -f ${pidfile} ] && kill -0 $(cat ${pidfile}) 2>/dev/null; then - echo "${name} is running as pid $(cat ${pidfile})." - else - echo "${name} is not running." - fi -} +# procname must be the full path so rc.subr can match it against ps output +procname="/usr/local/bin/finger" load_rc_config $name +: ${fingerd_enable:=NO} + run_rc_command "$1" ```