[Unit]
Description=Samba SMB Daemon
After=network.target
ConditionPathExists=/storage/.cache/services/samba.conf

[Service]
Type=forking
PIDFile=/var/run/smbd-smb.conf.pid
LimitNOFILE=16384
ExecStart=/usr/bin/smbd --configfile=/run/samba/smb.conf
ExecStartPre=/usr/lib/samba/samba-config
ExecReload=/bin/kill -HUP $MAINPID
TimeoutStopSec=1s
Restart=always
RestartSec=2
StartLimitInterval=0

[Install]
WantedBy=multi-user.target
