diff --git a/systemd/dev-mars-@{res}.path b/systemd/dev-mars-@{res}.path new file mode 100644 index 00000000..59a9329a --- /dev/null +++ b/systemd/dev-mars-@{res}.path @@ -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 diff --git a/systemd/mars-emergency.path b/systemd/mars-emergency.path new file mode 100644 index 00000000..c87487ea --- /dev/null +++ b/systemd/mars-emergency.path @@ -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 diff --git a/systemd/mars-emergency.service b/systemd/mars-emergency.service new file mode 100644 index 00000000..0dfc4f13 --- /dev/null +++ b/systemd/mars-emergency.service @@ -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 diff --git a/systemd/mars-trigger.path b/systemd/mars-trigger.path new file mode 100644 index 00000000..833e309d --- /dev/null +++ b/systemd/mars-trigger.path @@ -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 diff --git a/systemd/mars.path b/systemd/mars.path new file mode 100644 index 00000000..4992f5fa --- /dev/null +++ b/systemd/mars.path @@ -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 diff --git a/systemd/mars.service b/systemd/mars.service new file mode 100644 index 00000000..60d668ab --- /dev/null +++ b/systemd/mars.service @@ -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 diff --git a/systemd/vol-@{res}.mount b/systemd/vol-@{res}.mount new file mode 100644 index 00000000..2f7b094d --- /dev/null +++ b/systemd/vol-@{res}.mount @@ -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