Pidfile ends up in /tmp instead of /var/run

Morgan Wesström freebsd-questions at pp.dyndns.biz
Sat Aug 21 22:58:19 UTC 2010


I'm trying to create an rc script for the first time following the guide
in the handbook. The script works as expected except for the pidfile
which is created in /tmp for some reason I can't figure out. The daemon
I try to run is a Linux program if that matters. Any help to solve this
would be appreciated. Here's the rc script:


#!/bin/sh

# PROVIDE: linuxdaemon
# REQUIRE: NETWORKING DAEMON
# BEFORE:  LOGIN
# KEYWORD: shutdown

linuxdaemon_enable="${linuxdaemon_enable-NO}"

. /etc/rc.subr

name="linuxdaemon"
rcvar=`set_rcvar`
command="/usr/local/bin/linuxdaemon"
command_args="-c /usr/local/etc/linuxdaemon.conf > /dev/null 2>&1"

load_rc_config $name

pidfile="/var/run/linuxdaemon.pid"
required_files="/usr/local/etc/linuxdaemon.conf"

run_rc_command "$1"


Regards
Morgan


More information about the freebsd-questions mailing list