summaryrefslogtreecommitdiffstats
path: root/packaging/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/systemd')
-rw-r--r--packaging/systemd/README14
-rw-r--r--packaging/systemd/ctdb.service.in19
-rw-r--r--packaging/systemd/nmb.service.in17
-rw-r--r--packaging/systemd/samba.conf.tmp1
-rw-r--r--packaging/systemd/samba.service.in17
-rw-r--r--packaging/systemd/samba.sysconfig18
-rw-r--r--packaging/systemd/smb.service.in18
-rw-r--r--packaging/systemd/winbind.service.in16
8 files changed, 120 insertions, 0 deletions
diff --git a/packaging/systemd/README b/packaging/systemd/README
new file mode 100644
index 0000000..5d1d746
--- /dev/null
+++ b/packaging/systemd/README
@@ -0,0 +1,14 @@
+With systemd the /run or /var/run are tmpfs filesystems. This means
+the directories required by samba need to be created during startup.
+This can be done with a config file for tmpfiles, see samba.conf.tmp.
+You need to copy this file to the directory systemd-tmpfiles is looking
+for its config files e.g.:
+
+install -d -m 0755 /etc/tmpfiles.d/
+install -m644 samba.conf.tmp /etc/tmpfiles.d/samba.conf
+
+If you're a packager don't forget to run the systemd-tmpfiles binary
+in the script after samba has been installed. This makes sure the
+directory exists and you can start samba directly after the installation.
+
+/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/samba.conf
diff --git a/packaging/systemd/ctdb.service.in b/packaging/systemd/ctdb.service.in
new file mode 100644
index 0000000..7905a93
--- /dev/null
+++ b/packaging/systemd/ctdb.service.in
@@ -0,0 +1,19 @@
+[Unit]
+Description=CTDB
+Documentation=man:ctdbd(1) man:ctdb(7)
+After=network-online.target time-sync.target
+ConditionFileNotEmpty=@CTDB_ETCDIR@/nodes
+
+[Service]
+Type=forking
+LimitCORE=infinity
+LimitNOFILE=1048576
+TasksMax=4096
+PIDFile=@CTDB_RUNDIR@/ctdbd.pid
+ExecStart=@SBINDIR@/ctdbd
+ExecStop=@BINDIR@/ctdb shutdown
+KillMode=control-group
+Restart=no
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/nmb.service.in b/packaging/systemd/nmb.service.in
new file mode 100644
index 0000000..ceeeea4
--- /dev/null
+++ b/packaging/systemd/nmb.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=Samba NMB Daemon
+Documentation=man:nmbd(8) man:samba(7) man:smb.conf(5)
+Wants=network-online.target
+After=network.target network-online.target
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/nmbd.pid
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/nmbd --foreground --no-process-group $NMBDOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+LimitCORE=infinity
+@systemd_nmb_extra@
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/samba.conf.tmp b/packaging/systemd/samba.conf.tmp
new file mode 100644
index 0000000..8a29577
--- /dev/null
+++ b/packaging/systemd/samba.conf.tmp
@@ -0,0 +1 @@
+d /var/run/samba 755 root root
diff --git a/packaging/systemd/samba.service.in b/packaging/systemd/samba.service.in
new file mode 100644
index 0000000..e4baee1
--- /dev/null
+++ b/packaging/systemd/samba.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=Samba AD Daemon
+Documentation=man:samba(8) man:samba(7) man:smb.conf(5)
+Wants=network-online.target
+After=network.target network-online.target
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/samba.pid
+LimitNOFILE=16384
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/samba --foreground --no-process-group $SAMBAOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+@systemd_samba_extra@
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/samba.sysconfig b/packaging/systemd/samba.sysconfig
new file mode 100644
index 0000000..7607426
--- /dev/null
+++ b/packaging/systemd/samba.sysconfig
@@ -0,0 +1,18 @@
+## Path: Network/Samba
+## Description: Samba process options
+## Type: string
+## Default: ""
+## ServiceRestart: samba
+SAMBAOPTIONS=""
+## Type: string
+## Default: ""
+## ServiceRestart: smb
+SMBDOPTIONS=""
+## Type: string
+## Default: ""
+## ServiceRestart: nmb
+NMBDOPTIONS=""
+## Type: string
+## Default: ""
+## ServiceRestart: winbind
+WINBINDOPTIONS=""
diff --git a/packaging/systemd/smb.service.in b/packaging/systemd/smb.service.in
new file mode 100644
index 0000000..64c77c0
--- /dev/null
+++ b/packaging/systemd/smb.service.in
@@ -0,0 +1,18 @@
+[Unit]
+Description=Samba SMB Daemon
+Documentation=man:smbd(8) man:samba(7) man:smb.conf(5)
+Wants=network-online.target
+After=network.target network-online.target nmb.service winbind.service
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/smbd.pid
+LimitNOFILE=16384
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/smbd --foreground --no-process-group $SMBDOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+LimitCORE=infinity
+@systemd_smb_extra@
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/systemd/winbind.service.in b/packaging/systemd/winbind.service.in
new file mode 100644
index 0000000..d28a0e9
--- /dev/null
+++ b/packaging/systemd/winbind.service.in
@@ -0,0 +1,16 @@
+[Unit]
+Description=Samba Winbind Daemon
+Documentation=man:winbindd(8) man:samba(7) man:smb.conf(5)
+After=network.target nmb.service
+
+[Service]
+Type=notify
+PIDFile=@PIDDIR@/winbindd.pid
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/samba
+ExecStart=@SBINDIR@/winbindd --foreground --no-process-group $WINBINDOPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+LimitCORE=infinity
+@systemd_winbind_extra@
+
+[Install]
+WantedBy=multi-user.target