mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +00:00
Merge pull request #2653 from MilhouseVH/le90_samba_race_fix
samba: fix interleaved config generation/modification
This commit is contained in:
commit
5700bf9a4a
@ -142,6 +142,8 @@ post_makeinstall_target() {
|
|||||||
|
|
||||||
mkdir -p $INSTALL/usr/lib/samba
|
mkdir -p $INSTALL/usr/lib/samba
|
||||||
cp $PKG_DIR/scripts/samba-config $INSTALL/usr/lib/samba
|
cp $PKG_DIR/scripts/samba-config $INSTALL/usr/lib/samba
|
||||||
|
cp $PKG_DIR/scripts/smbd-config $INSTALL/usr/lib/samba
|
||||||
|
cp $PKG_DIR/scripts/samba-autoshare $INSTALL/usr/lib/samba
|
||||||
|
|
||||||
if find_file_path config/smb.conf; then
|
if find_file_path config/smb.conf; then
|
||||||
mkdir -p $INSTALL/etc/samba
|
mkdir -p $INSTALL/etc/samba
|
||||||
@ -166,10 +168,6 @@ post_makeinstall_target() {
|
|||||||
|
|
||||||
mkdir -p $INSTALL/usr/share/services
|
mkdir -p $INSTALL/usr/share/services
|
||||||
cp -P $PKG_DIR/default.d/*.conf $INSTALL/usr/share/services
|
cp -P $PKG_DIR/default.d/*.conf $INSTALL/usr/share/services
|
||||||
|
|
||||||
mkdir -p $INSTALL/usr/lib/samba
|
|
||||||
cp $PKG_DIR/scripts/samba-autoshare $INSTALL/usr/lib/samba
|
|
||||||
cp $PKG_DIR/scripts/smbd-config $INSTALL/usr/lib/samba
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ if [ -f /storage/.cache/services/samba.conf ]; then
|
|||||||
|
|
||||||
if [ "$SAMBA_AUTOSHARE" == "true" ] ; then
|
if [ "$SAMBA_AUTOSHARE" == "true" ] ; then
|
||||||
/usr/lib/samba/samba-config
|
/usr/lib/samba/samba-config
|
||||||
/usr/lib/samba/smbd-config
|
|
||||||
[ -f /run/samba/smbd.pid ] && pkill -HUP smbd
|
[ -f /run/samba/smbd.pid ] && pkill -HUP smbd
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -46,3 +46,10 @@ mkdir -p $(dirname $SMB_CONF)
|
|||||||
else
|
else
|
||||||
cp $SMB_DEFCONF $SMB_CONF
|
cp $SMB_DEFCONF $SMB_CONF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Generate smb.conf, unless disabled
|
||||||
|
if [ ! -f /storage/.cache/services/samba.disabled ]; then
|
||||||
|
/usr/lib/samba/smbd-config
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
@ -3,7 +3,7 @@ Description=Samba NMB Daemon
|
|||||||
After=network.target samba-config.service
|
After=network.target samba-config.service
|
||||||
ConditionPathExists=!/storage/.cache/services/samba.disabled
|
ConditionPathExists=!/storage/.cache/services/samba.disabled
|
||||||
ConditionPathExists=/run/samba/smb.conf
|
ConditionPathExists=/run/samba/smb.conf
|
||||||
Requires=samba-config.service
|
Wants=samba-config.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
|
@ -3,13 +3,12 @@ Description=Samba SMB Daemon
|
|||||||
After=network.target samba-config.service
|
After=network.target samba-config.service
|
||||||
ConditionPathExists=!/storage/.cache/services/samba.disabled
|
ConditionPathExists=!/storage/.cache/services/samba.disabled
|
||||||
ConditionPathExists=/run/samba/smb.conf
|
ConditionPathExists=/run/samba/smb.conf
|
||||||
Requires=samba-config.service
|
Wants=samba-config.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/run/samba/smbd.pid
|
PIDFile=/run/samba/smbd.pid
|
||||||
LimitNOFILE=16384
|
LimitNOFILE=16384
|
||||||
ExecStartPre=/usr/lib/samba/smbd-config
|
|
||||||
ExecStart=/usr/sbin/smbd
|
ExecStart=/usr/sbin/smbd
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
TimeoutStopSec=1s
|
TimeoutStopSec=1s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user