r/samba-dc: Auto restart samba
Although it's rare, sometimes Samba crashes or fails to start. When this happens, restarting it is almost always enough to get it working again. Since all sorts of authentication problems can occur if one of the domain controllers is down, it's probably best to just have systemd automatically restart _samba.service_ if it ever stops for any reason.
This commit is contained in:
6
roles/samba-dc/files/auto-restart.conf
Normal file
6
roles/samba-dc/files/auto-restart.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
StartLimitIntervalSec=60
|
||||
StartLimitBurst=10
|
||||
|
||||
[Service]
|
||||
RestartSec=10s
|
||||
@@ -77,6 +77,20 @@
|
||||
path=/etc/systemd/system/samba.service.d
|
||||
mode=0755
|
||||
state=directory
|
||||
tags:
|
||||
- systemd
|
||||
- name: ensure samba service auto restart is configurd
|
||||
copy:
|
||||
src: auto-restart.conf
|
||||
dest: /etc/systemd/system/samba.service.d
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rw,go=r
|
||||
notify:
|
||||
- reload systemd
|
||||
- restart samba
|
||||
tags:
|
||||
- systemd
|
||||
|
||||
- name: ensure samba starts at boot
|
||||
service:
|
||||
|
||||
Reference in New Issue
Block a user