diff options
author | Doug Barton <dougb@FreeBSD.org> | 2012-08-05 23:19:36 +0000 |
---|---|---|
committer | Doug Barton <dougb@FreeBSD.org> | 2012-08-05 23:19:36 +0000 |
commit | 9aac569eaa031e27191a3f4165b389a17f467ad2 (patch) | |
tree | 1ed78841e1757014ccc09581c61c3683992d3f77 /net-p2p/uhub/files/uhub.in | |
parent | When installing in the base, USE_RCORDER does the right thing without (diff) |
Move the rc.d scripts of the form *.sh.in to *.in
Where necessary add $FreeBSD$ to the file
No PORTREVISION bump necessary because this is a no-op
Notes
Notes:
svn path=/head/; revision=302141
Diffstat (limited to 'net-p2p/uhub/files/uhub.in')
-rw-r--r-- | net-p2p/uhub/files/uhub.in | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/net-p2p/uhub/files/uhub.in b/net-p2p/uhub/files/uhub.in new file mode 100644 index 000000000000..7a06bcfefaf2 --- /dev/null +++ b/net-p2p/uhub/files/uhub.in @@ -0,0 +1,52 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: uhub +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable uhub: +# +# uhub_enable (bool): Set it to "YES" to enable uhub +# Default is "NO". +# uhub_pidfile (path): Set full path to pid file. +# Default is "/var/run/uhub.pid". +# + +. /etc/rc.subr + +name="uhub" +rcvar=uhub_enable + +load_rc_config $name + +: ${uhub_enable:="NO"} +: ${uhub_flags:="-L -u uhub -g uhub"} +: ${uhub_pidfile:="/var/run/${name}.pid"} + +command=%%PREFIX%%/bin/uhub +command_args="-f -p ${uhub_pidfile}" +pidfile=${uhub_pidfile} +required_files=${uhub_conf} +stop_postcmd=stop_postcmd +reload_precmd=reload_precmd +reload_postcmd=reload_postcmd +extra_commands="reload" + +stop_postcmd() +{ + rm -f ${pidfile} +} + +reload_precmd() +{ + echo "Reload ${name} configuration." +} + +reload_postcmd() +{ + kill -HUP `cat ${pidfile}` +} + +run_rc_command "$1" |