mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 05:06:43 +00:00
samba: move samba-defaults into the samba-config script to avoid getting failed systemd service on the console
This commit is contained in:
parent
cb73e74693
commit
fe5781bb33
@ -189,7 +189,6 @@ makeinstall_target() {
|
|||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
if [ "$SAMBA_SERVER" = "yes" ]; then
|
if [ "$SAMBA_SERVER" = "yes" ]; then
|
||||||
enable_service samba-defaults.service
|
|
||||||
enable_service nmbd.service
|
enable_service nmbd.service
|
||||||
enable_service smbd.service
|
enable_service smbd.service
|
||||||
fi
|
fi
|
||||||
|
@ -21,7 +21,10 @@ SMB_USERCONF="/storage/.config/samba.conf"
|
|||||||
SMB_DEFCONF="/etc/samba/smb.conf"
|
SMB_DEFCONF="/etc/samba/smb.conf"
|
||||||
SMB_CONF="/run/samba/smb.conf"
|
SMB_CONF="/run/samba/smb.conf"
|
||||||
|
|
||||||
if [ -f /storage/.cache/services/samba.conf ]; then
|
if [ ! -f /storage/.cache/services/samba.conf ]; then
|
||||||
|
/bin/cp /usr/share/services/samba.conf /storage/.cache/services
|
||||||
|
fi
|
||||||
|
|
||||||
. /storage/.cache/services/samba.conf
|
. /storage/.cache/services/samba.conf
|
||||||
|
|
||||||
mkdir -p /run/samba
|
mkdir -p /run/samba
|
||||||
@ -61,4 +64,3 @@ if [ -f /storage/.cache/services/samba.conf ]; then
|
|||||||
sed -e 's|^.[ \t]*.username map.=.*||' -i $SMB_CONF
|
sed -e 's|^.[ \t]*.username map.=.*||' -i $SMB_CONF
|
||||||
sed -e 's|^.[ \t]*.security.=.*| security = share|' -i $SMB_CONF
|
sed -e 's|^.[ \t]*.security.=.*| security = share|' -i $SMB_CONF
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Samba NMB Daemon
|
Description=Samba NMB Daemon
|
||||||
After=network.target samba-config.service
|
After=network.target smbd.service
|
||||||
Requires=samba-config.service
|
|
||||||
|
|
||||||
ConditionPathExists=/storage/.cache/services/samba.conf
|
|
||||||
ConditionPathExists=/run/samba/smb.conf
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Samba configfile writer
|
|
||||||
After=samba-defaults.service
|
|
||||||
Requires=samba-defaults.service
|
|
||||||
|
|
||||||
ConditionPathExists=/storage/.cache/services/samba.conf
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/lib/samba/samba-config
|
|
||||||
StartLimitInterval=0
|
|
@ -1,10 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Samba defaults
|
|
||||||
|
|
||||||
ConditionPathExists=!/storage/.cache/services/samba.conf
|
|
||||||
ConditionPathExists=!/storage/.cache/services/samba.disabled
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/bin/cp /usr/share/services/samba.conf /storage/.cache/services/
|
|
||||||
RemainAfterExit=yes
|
|
@ -1,16 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Samba SMB Daemon
|
Description=Samba SMB Daemon
|
||||||
After=network.target samba-config.service nmbd.service
|
After=network.target
|
||||||
Requires=samba-config.service
|
|
||||||
|
|
||||||
ConditionPathExists=/storage/.cache/services/samba.conf
|
|
||||||
ConditionPathExists=/run/samba/smb.conf
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/var/run/smbd-smb.conf.pid
|
PIDFile=/var/run/smbd-smb.conf.pid
|
||||||
LimitNOFILE=16384
|
LimitNOFILE=16384
|
||||||
ExecStart=/usr/bin/smbd --configfile=/run/samba/smb.conf
|
ExecStart=/usr/bin/smbd --configfile=/run/samba/smb.conf
|
||||||
|
ExecStartPre=/usr/lib/samba/samba-config
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
TimeoutStopSec=1s
|
TimeoutStopSec=1s
|
||||||
Restart=always
|
Restart=always
|
||||||
|
Loading…
x
Reference in New Issue
Block a user