mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
samba4: update to 4.11.4 (python3 version), add rpcsvc-proto, add libasn1 host build
* update to 4.11.4 (python3 version) * re-enable AD-DC option * add 'samba_nice' UCI option via "config procd 'extra'" * restructure buildsteps (don't rely on waf --targets logic) * move quota option into VFS * move ACL option into AC-DC * add more admin-tools * use rpath_install for libs * fix rpath + rstrip extra: * add rpcsvc-proto package _(don't rely on nfs-utils/host for headers, rpcgen anymore)_ * add libasn1 host build _(samba4 is looking for the bins)_ Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
This commit is contained in:
+26
-17
@@ -3,8 +3,10 @@
|
||||
START=98
|
||||
USE_PROCD=1
|
||||
|
||||
SAMBA_IFACE=""
|
||||
|
||||
smb_header() {
|
||||
config_get samba_iface $1 interface "loopback lan"
|
||||
config_get SAMBA_IFACE $1 interface "lan"
|
||||
|
||||
# resolve interfaces
|
||||
local interfaces
|
||||
@@ -12,7 +14,7 @@ smb_header() {
|
||||
. /lib/functions/network.sh
|
||||
|
||||
local net
|
||||
for net in $samba_iface; do
|
||||
for net in $SAMBA_IFACE; do
|
||||
local device
|
||||
network_is_up $net || continue
|
||||
network_get_device device "$net"
|
||||
@@ -59,8 +61,8 @@ smb_header() {
|
||||
|
||||
[ -e /etc/samba/smb.conf ] || ln -nsf /var/etc/smb.conf /etc/samba/smb.conf
|
||||
|
||||
if ! [ -L /etc/samba/smb.conf ]; then
|
||||
logger -t 'samba4-server' "Local custom /etc/samba/smb.conf file detected, all luci/config settings are ignored!"
|
||||
if [ ! -L /etc/samba/smb.conf ]; then
|
||||
logger -p daemon.warn -t 'samba4-server' "Local custom /etc/samba/smb.conf file detected, all luci/config settings are ignored!"
|
||||
fi
|
||||
|
||||
}
|
||||
@@ -158,56 +160,63 @@ init_config() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
PROCD_RELOAD_DELAY=2000
|
||||
# PROCD_RELOAD_DELAY=1000
|
||||
|
||||
procd_add_reload_trigger "dhcp" "system" "samba4"
|
||||
|
||||
local i
|
||||
for i in $samba_iface; do
|
||||
for i in $SAMBA_IFACE; do
|
||||
procd_add_reload_interface_trigger $i
|
||||
done
|
||||
}
|
||||
|
||||
start_service() {
|
||||
init_config
|
||||
|
||||
if [ ! -e /etc/samba/smb.conf ]; then
|
||||
logger -p daemon.error -t 'samba4-server' "missing config /etc/samba/smb.conf!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local nice_value
|
||||
config_get nice_value extra samba_nice 0
|
||||
|
||||
# start main AD-DC daemon, will spawn (smbd,nmbd,winbindd) as needed/configured.
|
||||
if [ "$DISABLE_AD_DC" -ne 1 ] && [ -x /usr/sbin/samba ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/samba -F
|
||||
procd_set_param nice $nice_value
|
||||
procd_set_param respawn
|
||||
procd_set_param file /var/etc/smb.conf
|
||||
procd_set_param file /etc/samba/smb.conf
|
||||
procd_set_param limits nofile=16384
|
||||
procd_close_instance
|
||||
else
|
||||
# start fileserver daemon
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/smbd -F
|
||||
procd_set_param nice $nice_value
|
||||
procd_set_param respawn
|
||||
procd_set_param file /var/etc/smb.conf
|
||||
procd_set_param file /etc/samba/smb.conf
|
||||
procd_set_param limits nofile=16384
|
||||
procd_close_instance
|
||||
|
||||
# start netbios daemon
|
||||
if [ "$DISABLE_NETBIOS" -ne 1 ] && [ -x /usr/sbin/nmbd ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/nmbd -F
|
||||
procd_set_param nice $nice_value
|
||||
procd_set_param respawn
|
||||
procd_set_param file /var/etc/smb.conf
|
||||
procd_set_param file /etc/samba/smb.conf
|
||||
procd_close_instance
|
||||
fi
|
||||
# start winbind daemon
|
||||
if [ "$DISABLE_WINBIND" -ne 1 ] && [ -x /usr/sbin/winbindd ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/winbindd -F
|
||||
procd_set_param nice $nice_value
|
||||
procd_set_param respawn
|
||||
procd_set_param file /var/etc/smb.conf
|
||||
procd_set_param file /etc/samba/smb.conf
|
||||
procd_close_instance
|
||||
fi
|
||||
fi
|
||||
# lower priority using renice (if found)
|
||||
if [ -x /usr/bin/renice ]; then
|
||||
[ -x /usr/sbin/samba ] && renice -n 2 $(pidof samba)
|
||||
[ -x /usr/sbin/smbd ] && renice -n 2 $(pidof smbd)
|
||||
[ -x /usr/sbin/nmbd ] && renice -n 2 $(pidof nmbd)
|
||||
[ -x /usr/sbin/winbindd ] && renice -n 2 $(pidof winbindd)
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user