diff options
author | Doug Barton <dougb@FreeBSD.org> | 2011-04-23 04:26:31 +0000 |
---|---|---|
committer | Doug Barton <dougb@FreeBSD.org> | 2011-04-23 04:26:31 +0000 |
commit | 8028832653dc02dbb77af7068dcdd065b99d4ba6 (patch) | |
tree | 19cd95ff052dd0f9ab092912f12efc9fa1559f6b /etc/rc.d/devd | |
parent | 0d07bcba27cee67bf55c505662a6de8723f01b4c (diff) | |
download | src-8028832653dc02dbb77af7068dcdd065b99d4ba6.tar.gz src-8028832653dc02dbb77af7068dcdd065b99d4ba6.zip |
Introduce to rc.subr get_pidfile_from_conf(). It does just what it sounds
like, determines the path to a pid file as it is specified in a conf file.
Use the new feature for rc.d/named and rc.d/devd, the 2 services in the
base that list their pid files in their conf files.
Remove the now-obsolete named_pidfile, and warn users if they have it set.
Notes
Notes:
svn path=/head/; revision=220962
Diffstat (limited to 'etc/rc.d/devd')
-rwxr-xr-x | etc/rc.d/devd | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/etc/rc.d/devd b/etc/rc.d/devd index a12664507ca4..e257da6aca86 100755 --- a/etc/rc.d/devd +++ b/etc/rc.d/devd @@ -13,12 +13,23 @@ name="devd" rcvar=`set_rcvar` command="/sbin/${name}" -pidfile=/var/run/${name}.pid start_precmd=${name}_prestart +stop_precmd=find_pidfile + +find_pidfile() +{ + if get_pidfile_from_conf pid-file /etc/devd.conf; then + pidfile="$_pidfile_from_conf" + else + pidfile="/var/run/${name}.pid" + fi +} devd_prestart () { + find_pidfile + # If devd is disabled, turn it off in the kernel to avoid memory leaks. if ! checkyesno ${rcvar}; then $SYSCTL hw.bus.devctl_disable=1 |