summaryrefslogtreecommitdiff
path: root/pcr/openrc-net/vsftpd.init
diff options
context:
space:
mode:
authorfreaj <freaj@riseup.net>2015-03-30 10:36:00 +0200
committerfreaj <freaj@riseup.net>2015-03-30 10:36:00 +0200
commit7385c6143c1b587bca68deade6e5989d11879767 (patch)
tree6ccef2617293e9afd03c80d5de22fd8f9c260c70 /pcr/openrc-net/vsftpd.init
parent41c9dc8729840f45f174a14a08703e04d1f5717e (diff)
downloadabslibre-7385c6143c1b587bca68deade6e5989d11879767.tar.gz
abslibre-7385c6143c1b587bca68deade6e5989d11879767.tar.bz2
abslibre-7385c6143c1b587bca68deade6e5989d11879767.zip
openrc-net-20150330-1: updating version
Diffstat (limited to 'pcr/openrc-net/vsftpd.init')
-rw-r--r--pcr/openrc-net/vsftpd.init51
1 files changed, 51 insertions, 0 deletions
diff --git a/pcr/openrc-net/vsftpd.init b/pcr/openrc-net/vsftpd.init
new file mode 100644
index 000000000..e1c26c7d8
--- /dev/null
+++ b/pcr/openrc-net/vsftpd.init
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Header: /var/cvsroot/gentoo-x86/net-ftp/vsftpd/files/vsftpd.init,v 1.9 2015/01/31 13:07:47 hwoarang Exp $
+
+VSFTPD_NAME=${SVCNAME##*.}
+if [ -n "${VSFTPD_NAME}" -a "${SVCNAME}" != "vsftpd" ]; then
+ VSFTPD_PID="/var/run/vsftpd.${VSFTPD_NAME}.pid"
+ VSFTPD_CONF_DEFAULT="/etc/vsftpd/${VSFTPD_NAME}.conf"
+else
+ VSFTPD_PID="/var/run/vsftpd.pid"
+ VSFTPD_CONF_DEFAULT="/etc/vsftpd/vsftpd.conf"
+fi
+VSFTPD_CONF=${VSFTPD_CONF:-${VSFTPD_CONF_DEFAULT}}
+VSFTPD_EXEC=${VSFTPD_EXEC:-/usr/sbin/vsftpd}
+
+depend() {
+ need net
+ use dns logger
+}
+
+checkconfig() {
+ VSFTPD_CONF="${VSFTPD_CONF}" \
+ /usr/libexec/vsftpd-checkconfig.sh || return 1
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec ${VSFTPD_EXEC} \
+ --background --make-pidfile --pidfile "${VSFTPD_PID}" \
+ -- "${VSFTPD_CONF}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ local retval=0
+ if [ -f ${VSFTPD_PID} ]; then
+ start-stop-daemon --stop --pidfile ${VSFTPD_PID} || retval=1
+ pkill --full ${VSFTPD_CONF}
+ else
+ ewarn "Couldn't find ${VSFTPD_PID} trying to stop using the config filename ${VSFTPD_CONF}"
+ pgrep --full ${VSFTPD_CONF} > ${VSFTPD_PID}
+ start-stop-daemon --stop --pidfile ${VSFTPD_PID} || retval=1
+ pkill --full ${VSFTPD_CONF}
+ fi
+ eend ${retval}
+}
+
+# vim: ts=4