From f0d9f58b7f1825fb95236f427a6400ad54ad4b5e Mon Sep 17 00:00:00 2001 From: dougb Date: Sun, 5 Aug 2012 23:19:36 +0000 Subject: 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 --- net-p2p/amule-devel/Makefile | 2 +- net-p2p/amule-devel/files/amuled.in | 69 ++++++++++++++++++++++++++++++++++ net-p2p/amule-devel/files/amuled.sh.in | 69 ---------------------------------- 3 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 net-p2p/amule-devel/files/amuled.in delete mode 100644 net-p2p/amule-devel/files/amuled.sh.in (limited to 'net-p2p/amule-devel') diff --git a/net-p2p/amule-devel/Makefile b/net-p2p/amule-devel/Makefile index 41624c732b6e..e22dd47df2f7 100644 --- a/net-p2p/amule-devel/Makefile +++ b/net-p2p/amule-devel/Makefile @@ -112,7 +112,7 @@ PLIST_SUB+= AMULECMD="@comment " .if ${PORT_OPTIONS:MAMULEDAEMON} CONFIGURE_ARGS+= --enable-amule-daemon PLIST_SUB+= AMULEDAEMON="" -USE_RC_SUBR= amuled.sh +USE_RC_SUBR= amuled .else CONFIGURE_ARGS+= --disable-amule-daemon PLIST_SUB+= AMULEDAEMON="@comment " diff --git a/net-p2p/amule-devel/files/amuled.in b/net-p2p/amule-devel/files/amuled.in new file mode 100644 index 000000000000..2d6af76340f7 --- /dev/null +++ b/net-p2p/amule-devel/files/amuled.in @@ -0,0 +1,69 @@ +#!/bin/sh + +# $FreeBSD$ +# +# aMule RCng startup script +# Ogirinal work from Gabriele Cecchetti (amule.org forum) +# +# PROVIDE: amuled +# REQUIRE: NETWORKING SERVERS +# BEFORE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable amuled at startup +# amuled (bool): Set to "NO" by default. +# Set it to "YES" to enable amuled +# amuled_user (str): Set to user running amuled +# (default 'aMule') +# amuled_home (str): Set to home directory of user running amuled +# (default /home/${amuled_user}) + +. /etc/rc.subr + +name="amuled" +rcvar=amuled_enable + +load_rc_config $name + +[ -z "$amuled_enable" ] && amuled_enable="NO" +[ -z "$amuled_user" ] && amuled_user="aMule" +[ -z "$amuled_home" ] && amuled_home="/home/${amuled_user}" + +required_dirs=${amuled_home} +required_files="${amuled_home}/.aMule/amule.conf" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" + +amuled_start() +{ + if [ ! -f /var/run/${name}.run ] + then + su -l ${amuled_user} -c "amuled &" 2>>/var/log/${name}.log >>/var/log/${name}.log && touch /var/run/${name}.run + echo "Started ${name}." + echo `date` : "Started ${name}." >> /var/log/${name}.log + else + echo "${name} seems to be already running -- remove /var/run/${name}.run manually if needed." + fi +} + +amuled_stop() +{ + if [ -f /var/run/${name}.run ] + then + # The following line is much better, but doesn't stop totally amuled + # su -l ${amuled_user} -c "amulecmd -c Shutdown" 2>>/var/log/${name}.log >>/var/log/${name}.log + # Since amuled catches SIGTERM, this way is preferred for now + killall -TERM amuled 2>>/var/log/${name}.log >>/var/log/${name}.log ; sleep 3 + killall -KILL amuled 2>>/var/log/${name}.log >>/var/log/${name}.log + # Also kill amuleweb if needed + killall -KILL amuleweb 2>/dev/null >/dev/null + rm -f /var/run/${name}.run + echo "Stopped ${name}." + echo `date` : "Stopped ${name}." >> /var/log/${name}.log + else + echo "${name} doesn't seem to be running -- create /var/run/${name}.run if needed." + fi +} + +run_rc_command "$1" diff --git a/net-p2p/amule-devel/files/amuled.sh.in b/net-p2p/amule-devel/files/amuled.sh.in deleted file mode 100644 index 2ed3fa8d8548..000000000000 --- a/net-p2p/amule-devel/files/amuled.sh.in +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh -# -# aMule RCng startup script -# Ogirinal work from Gabriele Cecchetti (amule.org forum) -# - -# PROVIDE: amuled -# REQUIRE: NETWORKING SERVERS -# BEFORE: DAEMON -# KEYWORD: shutdown - -# -# Add the following lines to /etc/rc.conf to enable amuled at startup -# amuled (bool): Set to "NO" by default. -# Set it to "YES" to enable amuled -# amuled_user (str): Set to user running amuled -# (default 'aMule') -# amuled_home (str): Set to home directory of user running amuled -# (default /home/${amuled_user}) -# -. /etc/rc.subr - -name="amuled" -rcvar=amuled_enable - -load_rc_config $name - -[ -z "$amuled_enable" ] && amuled_enable="NO" -[ -z "$amuled_user" ] && amuled_user="aMule" -[ -z "$amuled_home" ] && amuled_home="/home/${amuled_user}" - -required_dirs=${amuled_home} -required_files="${amuled_home}/.aMule/amule.conf" - -start_cmd="${name}_start" -stop_cmd="${name}_stop" - -amuled_start() -{ - if [ ! -f /var/run/${name}.run ] - then - su -l ${amuled_user} -c "amuled &" 2>>/var/log/${name}.log >>/var/log/${name}.log && touch /var/run/${name}.run - echo "Started ${name}." - echo `date` : "Started ${name}." >> /var/log/${name}.log - else - echo "${name} seems to be already running -- remove /var/run/${name}.run manually if needed." - fi -} - -amuled_stop() -{ - if [ -f /var/run/${name}.run ] - then - # The following line is much better, but doesn't stop totally amuled - # su -l ${amuled_user} -c "amulecmd -c Shutdown" 2>>/var/log/${name}.log >>/var/log/${name}.log - # Since amuled catches SIGTERM, this way is preferred for now - killall -TERM amuled 2>>/var/log/${name}.log >>/var/log/${name}.log ; sleep 3 - killall -KILL amuled 2>>/var/log/${name}.log >>/var/log/${name}.log - # Also kill amuleweb if needed - killall -KILL amuleweb 2>/dev/null >/dev/null - rm -f /var/run/${name}.run - echo "Stopped ${name}." - echo `date` : "Stopped ${name}." >> /var/log/${name}.log - else - echo "${name} doesn't seem to be running -- create /var/run/${name}.run if needed." - fi -} - -run_rc_command "$1" -- cgit