diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-11-18 12:38:40 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-11-18 12:38:40 +0000 |
commit | ec85e3b4784633ae641d8c095e6419bbca46bc15 (patch) | |
tree | 9c7eb77b6c520616509f0ac015df093b9a913ce2 | |
parent | 499c7d0b600ad7402235fe8587d584a1ebab9d34 (diff) | |
download | upstream-ec85e3b4784633ae641d8c095e6419bbca46bc15.tar.gz upstream-ec85e3b4784633ae641d8c095e6419bbca46bc15.tar.bz2 upstream-ec85e3b4784633ae641d8c095e6419bbca46bc15.zip |
samba: convert init script to procd, add reload support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Backport of r47292
git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@47495 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-x | package/network/services/samba36/files/samba.init | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init index 3146dd9f9b..376ae89988 100755 --- a/package/network/services/samba36/files/samba.init +++ b/package/network/services/samba36/files/samba.init @@ -2,6 +2,7 @@ # Copyright (C) 2008-2012 OpenWrt.org START=60 +USE_PROCD=1 smb_header() { local interface @@ -86,15 +87,32 @@ smb_add_share() { [ -n "$browseable" ] && echo -e "\tbrowseable = $browseable" >> /var/etc/smb.conf } -start() { +init_config() { config_load samba config_foreach smb_header samba config_foreach smb_add_share sambashare - service_start /usr/sbin/smbd -D - service_start /usr/sbin/nmbd -D } -stop() { - service_stop /usr/sbin/smbd - service_stop /usr/sbin/nmbd +reload_service() { + init_config + + killall -HUP smbd +} + +service_triggers() { + procd_add_reload_trigger samba +} + +start_service() { + init_config + + procd_open_instance + procd_set_param command /usr/sbin/smbd -F + procd_set_param respawn + procd_close_instance + + procd_open_instance + procd_set_param command /usr/sbin/nmbd -F + procd_set_param respawn + procd_close_instance } |