summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-p2p/fms/files/fms')
-rw-r--r--net-p2p/fms/files/fms38
1 files changed, 38 insertions, 0 deletions
diff --git a/net-p2p/fms/files/fms b/net-p2p/fms/files/fms
new file mode 100644
index 00000000000..8def4b0eba6
--- /dev/null
+++ b/net-p2p/fms/files/fms
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Check for OpenRC/Baselayout 2 - see bug #270646
+is_openrc() {
+ [ -f /lib/librc.so -o -f /etc/init.d/sysfs -o -f /lib/rc/version ]
+}
+
+start() {
+ ebegin "Starting FMS"
+ if is_openrc; then
+ start-stop-daemon -S -u freenet:freenet -d /var/freenet/fms -b -x /usr/bin/fms
+ eend $?
+ else
+ cd /var/freenet/fms
+ su -s /bin/sh -c "fms --daemon" freenet
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping FMS"
+ if is_openrc; then
+ start-stop-daemon -K -u freenet:freenet -d /var/freenet/fms /usr/bin/fms
+ eend $?
+ else
+ pkill -u freenet -f "fms --daemon"
+ eend 0
+ fi
+ if [[ $RC_CMD == "restart" ]]; then
+ ebegin "Waiting a few seconds to be sure FMS is ready for restart"
+ sleep 10
+ #give fms time to stop and release the nntp port
+ fi
+}
+