diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-01-08 09:41:05 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-01-08 09:41:05 +0000 |
commit | 1599a8ccc4a1b872f919371403ec0434b033207b (patch) | |
tree | 3a121cb9898ddd74a02a64af00c072adc19b124b /net-fs/samba/files/4.4/samba4.initd-r1 | |
parent | a46ffc94b0acbcdfae7228e10d46197fe54d27c8 (diff) |
net-fs/samba : import from portage tree, preconfigure
Diffstat (limited to 'net-fs/samba/files/4.4/samba4.initd-r1')
-rw-r--r-- | net-fs/samba/files/4.4/samba4.initd-r1 | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/net-fs/samba/files/4.4/samba4.initd-r1 b/net-fs/samba/files/4.4/samba4.initd-r1 new file mode 100644 index 00000000..52a9b68b --- /dev/null +++ b/net-fs/samba/files/4.4/samba4.initd-r1 @@ -0,0 +1,55 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later + +extra_started_commands="reload" +piddir="/run/samba" + +depend() { + after slapd + need net + use cupsd +} + +DAEMONNAME="${SVCNAME##samba.}" +[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME} + +signal_do() { + local signal="$1" + [ -z "${signal}" ] && return 0 + + local result=0 last_result=0 daemon= cmd_exec= + for daemon in ${daemon_list} ; do + eval cmd_exec=\$${daemon}_${signal} + if [ -n "${cmd_exec}" ]; then + ebegin "${my_service_name} -> ${signal}: ${daemon}" + #echo ${cmd} '->' ${!cmd} + ${cmd_exec} > /dev/null + last_result=$? + eend ${last_result} + fi + result=$(( ${result} + ${last_result} )) + done + return ${result} +} + +start() { + ${my_service_PRE} + [ -d "${piddir}" ] || mkdir -p "${piddir}" + signal_do start && return 0 + + eerror "Error: starting services (see system logs)" + signal_do stop + return 1 +} +stop() { + ${my_service_PRE} + if signal_do stop ; then + ${my_service_POST} + return 0 + fi +} +reload() { + ${my_service_PRE} + signal_do reload +} |