systemd: add basic systemd templates

This commit is contained in:
Thomas Schoebel-Theuer 2018-05-06 20:01:08 +02:00 committed by Thomas Schoebel-Theuer
parent 27b48876a6
commit 345af0b401
7 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1,9 @@
[Unit]
Description=MARS auto-activation of primary device /dev/mars/@{res}
#Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf
Requires=mars.service
After=mars.service
[Path]
PathExists=/dev/mars/@{res}
Unit=vol-@escvar{res}.mount

View File

@ -0,0 +1,14 @@
[Unit]
Description=MARS systemd trigger from /mars/userspace/emergency-trigger
Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf
Requires=mars.service
After=mars.service
[Path]
#PathExists=/mars/userspace/emergency-trigger
PathChanged=/mars/userspace/emergency-trigger
PathModified=/mars/userspace/emergency-trigger
Unit=mars-emergency.service
[Install]
WantedBy=mars.service

View File

@ -0,0 +1,11 @@
[Unit]
Description=MARS emergency trigger service from /mars/userspace/emergency-trigger
Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf
[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/marsadm cron
[Install]
WantedBy=mars.service

14
systemd/mars-trigger.path Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=MARS systemd trigger from /mars/userspace/systemd-trigger
Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf
Requires=mars.service
After=mars.service
[Path]
#PathExists=/mars/userspace/systemd-trigger
PathChanged=/mars/userspace/systemd-trigger
PathModified=/mars/userspace/systemd-trigger
Unit=mars-trigger.service
[Install]
WantedBy=mars.service

7
systemd/mars.path Normal file
View File

@ -0,0 +1,7 @@
[Unit]
Description=MARS block layer HA (activation by appearance of /mars/uuid)
Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf
[Path]
PathExists=/mars/uuid
Unit=mars.service

16
systemd/mars.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=MARS block layer HA (kernel module)
Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf
RequiresMountsFor=/mars/uuid
StopWhenUnneeded=false
IgnoreOnIsolate=true
[Service]
Type=oneshot
RemainAfterExit=yes
#ExecStartPre=if ! mountpoint /mars; then mount /dev/*/mars /mars; fi
ExecStart=/sbin/modprobe mars
ExecStop=/sbin/rmmod mars
[Install]
WantedBy=mars.mount

16
systemd/vol-@{res}.mount Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=MARS local mount on /vol/@{res}
#Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf
Requires=mars.service
After=mars.service
ConditionPathIsSymbolicLink=/mars/resource-@{res}/systemd-want
ConditionPathExists=/dev/mars/@{res}
ConditionPathIsDirectory=/vol/@{res}
[Mount]
What=/dev/mars/@{res}
Where=/vol/@{res}
[Install]
WantedBy=mars.service