net-fs/samba: Init script improvements.
authorLars Wendler <polynomial-c@gentoo.org>
Mon, 11 Jun 2018 10:21:39 +0000 (12:21 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Mon, 11 Jun 2018 10:22:00 +0000 (12:22 +0200)
Bug: https://bugs.gentoo.org/652896
Package-Manager: Portage-2.3.40, Repoman-2.3.9

net-fs/samba/files/4.4/samba4.confd
net-fs/samba/files/4.4/samba4.initd-r1

index 58b2c7827bdf4b650dda6adcd0707db441fb2192..2604981f21414446453a0c3c91781a6c084f6666 100644 (file)
@@ -6,6 +6,8 @@
 # accordingly.
 daemon_list="smbd nmbd"
 
+piddir="/run/samba"
+
 #----------------------------------------------------------------------------
 # Daemons calls: <daemon_name>_<command_option>
 #----------------------------------------------------------------------------
@@ -17,22 +19,27 @@ my_service_POST=""
 # Daemons calls: <daemon_name>_<command_option>
 #----------------------------------------------------------------------------
 smbd_start_options="-D"
-smbd_start="start-stop-daemon --start --exec /usr/sbin/smbd -- ${smbd_start_options}"
-smbd_stop="start-stop-daemon --stop --exec /usr/sbin/smbd"
+smbd_command="/usr/sbin/smbd"
+smbd_start="start-stop-daemon --start --exec ${smbd_command} -- ${smbd_start_options}"
+smbd_stop="start-stop-daemon --stop --exec ${smbd_command}"
 smbd_reload="killall -HUP smbd"
 
 nmbd_start_options="-D"
-nmbd_start="start-stop-daemon --start --exec /usr/sbin/nmbd -- ${nmbd_start_options}"
-nmbd_stop="start-stop-daemon --stop --exec /usr/sbin/nmbd"
+nmbd_command="/usr/sbin/nmbd"
+nmbd_start="start-stop-daemon --start --exec ${nmbd_command} -- ${nmbd_start_options}"
+nmbd_stop="start-stop-daemon --stop --exec ${nmbd_command}"
 nmbd_reload="killall -HUP nmbd"
 
 samba4_start_options=""
-samba4_start="start-stop-daemon --start --exec /usr/sbin/samba -- ${samba4_start_options}"
-samba4_stop="start-stop-daemon --stop --exec /usr/sbin/samba"
+samba4_command="/usr/sbin/samba"
+samba4_pidfile="${piddir}/samba4.pid"
+samba4_start="start-stop-daemon --start --exec ${samba4_command} --pidfile ${samba4_pidfile} -- ${samba4_start_options}"
+samba4_stop="start-stop-daemon --stop --exec ${samba4_command} --pidfile ${samba4_pidfile}"
 samba4_reload="killall -HUP samba"
 
 winbind_start_options=""
-winbind_start="start-stop-daemon --start --exec /usr/sbin/winbindd -- ${winbind_start_options}"
-winbind_stop="start-stop-daemon --stop --exec /usr/sbin/winbindd"
+winbind_command="/usr/sbin/winbindd"
+winbind_start="start-stop-daemon --start --exec ${winbind_command} -- ${winbind_start_options}"
+winbind_stop="start-stop-daemon --stop --exec ${winbind_command}"
 winbind_reload="killall -HUP winbindd"
 
index 52a9b68bba80d17e7ecb332ebeef6f6d13f3f5d9..05bd1fcfd695c061691d4f3eedd183a789926403 100644 (file)
@@ -1,9 +1,9 @@
 #!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License, v2 or later
 
 extra_started_commands="reload"
-piddir="/run/samba"
+[ -z "${piddir}" ] && piddir="/run/samba"
 
 depend() {
        after slapd