diff options
Diffstat (limited to 'net-p2p/uhub/files/uhub.initd')
-rw-r--r-- | net-p2p/uhub/files/uhub.initd | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/net-p2p/uhub/files/uhub.initd b/net-p2p/uhub/files/uhub.initd new file mode 100644 index 0000000..38ee6d5 --- /dev/null +++ b/net-p2p/uhub/files/uhub.initd @@ -0,0 +1,33 @@ +#!/sbin/runscript +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx.initd,v 1.1 2012/02/11 10:17:30 hollow Exp $ + +extra_started_commands="reload" + +description="High performance peer-to-peer hub for the ADC network" +description_reload="Reload uHub configuration and re-read log file" + +command="/usr/bin/uhub" +command_args="-p ${pidfile} ${UHUBOPTIONS}" +pidfile="/var/run/uhub.pid" + +depend() { + use dns logger netmount +} + +start_pre() { + touch "${UHUB_LOG}" + chown "${UHUB_USER}:${UHUB_GROUP}" "${UHUB_LOG}" +} + + +stop_post() { + rm -f ${pidfile} +} + +reload() { + ebegin "Reloading uHub configuration" + kill -HUP `cat ${pidfile}` &>/dev/null + eend $? "Failed to reload uHub" +} |