From 284b42bc4e27090926397fc0f02efc5a874b704c Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 14 Dec 2020 20:37:58 +0100 Subject: [PATCH] systemd: updated demo templates --- systemd-testing/SYSTEMD-load-occupy.sh | 50 +++++++++++++ systemd-testing/SYSTEMD-load-stop.sh | 22 ++++++ .../^{mntname}-@escvar{res}-delay.service | 34 +++++++++ systemd-testing/daemon-reload.service | 24 +++++++ .../mars-@escvar{res}-trigger.path | 17 +++++ .../mars-@escvar{res}-trigger.service | 36 ++++++++++ .../mars-emergency.path | 2 +- .../mars-emergency.service | 1 + .../mars-trigger.path | 12 +++- systemd-testing/mars-trigger.service | 26 +++++++ {systemd => systemd-testing}/mars.path | 3 + {systemd => systemd-testing}/mars.service | 13 +++- .../mnt-test-@escvar{res}-testload.script | 70 +++++++++++++++++++ .../mnt-test-@escvar{res}-testload.service | 49 +++++++++++++ systemd-testing/mnt-test-@escvar{res}.mount | 44 ++++++++++++ .../trigger-wrapper-for-testing.sh | 8 +++ systemd/MARS-load-occupy.sh | 19 ----- systemd/^{mntname}-@{res}-medium-01.service | 14 ---- systemd/^{mntname}-@{res}-medium-02.service | 14 ---- systemd/^{mntname}-@{res}-testload.service | 14 ---- systemd/^{mntname}-@{res}.mount | 18 ----- systemd/dev-mars-@{res}.path | 12 ---- systemd/mars-@{res}-trigger.path | 13 ---- systemd/mars-trigger.service | 12 ---- 24 files changed, 404 insertions(+), 123 deletions(-) create mode 100755 systemd-testing/SYSTEMD-load-occupy.sh create mode 100755 systemd-testing/SYSTEMD-load-stop.sh create mode 100644 systemd-testing/^{mntname}-@escvar{res}-delay.service create mode 100644 systemd-testing/daemon-reload.service create mode 100644 systemd-testing/mars-@escvar{res}-trigger.path create mode 100644 systemd-testing/mars-@escvar{res}-trigger.service rename {systemd => systemd-testing}/mars-emergency.path (82%) rename {systemd => systemd-testing}/mars-emergency.service (82%) rename {systemd => systemd-testing}/mars-trigger.path (51%) create mode 100644 systemd-testing/mars-trigger.service rename {systemd => systemd-testing}/mars.path (81%) rename {systemd => systemd-testing}/mars.service (65%) create mode 100644 systemd-testing/mnt-test-@escvar{res}-testload.script create mode 100644 systemd-testing/mnt-test-@escvar{res}-testload.service create mode 100644 systemd-testing/mnt-test-@escvar{res}.mount create mode 100755 systemd-testing/trigger-wrapper-for-testing.sh delete mode 100755 systemd/MARS-load-occupy.sh delete mode 100644 systemd/^{mntname}-@{res}-medium-01.service delete mode 100644 systemd/^{mntname}-@{res}-medium-02.service delete mode 100644 systemd/^{mntname}-@{res}-testload.service delete mode 100644 systemd/^{mntname}-@{res}.mount delete mode 100644 systemd/dev-mars-@{res}.path delete mode 100644 systemd/mars-@{res}-trigger.path delete mode 100644 systemd/mars-trigger.service diff --git a/systemd-testing/SYSTEMD-load-occupy.sh b/systemd-testing/SYSTEMD-load-occupy.sh new file mode 100755 index 00000000..1c39bba8 --- /dev/null +++ b/systemd-testing/SYSTEMD-load-occupy.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# This is a trivial script for testing. +# +# Beside some trivial dd write load generator, +# it may occupy the mount point for some time, +# simulating a badly terminating process so that umount +# cannot work immediately, but needs to be restarted +# somewhat later. +# +# When this script is killed from "systemctl stop", the +# "sleep" sub-process will _not_ be killed, but terminate +# a little bit later. This leads to a race condition with lsof, +# similar to some observed practical daemon behaviour. + +# Important: set pwd to occupy the mountpoint, also for sub-processes +cd "$1" || exit $? + +# End writing after a while => allow for reaching UpToDate +nr_load="${2:-5}" + +# 2-edge handshake protocol +start_flag=run-the-load.flag +running_flag=load-is-running.flag + +if [[ -e $start_flag ]]; then + exit 0 +fi + +: > $start_flag +: > $running_flag + +{ + testfile=dummy-testfile.zero + + while [[ -e $start_flag ]] && [[ -e $running_flag ]]; do + # do not write too much, for reasonable testing of KASAN kernels + if (( nr_load-- > 0 )); then + dd if=/dev/zero of=$testfile bs=1k count=1001 + else + touch $testfile + fi + sleep $(( RANDOM * 5 / 32767 )) & + wait + done + + rm -f $running_flag +} & + +exit 0 diff --git a/systemd-testing/SYSTEMD-load-stop.sh b/systemd-testing/SYSTEMD-load-stop.sh new file mode 100755 index 00000000..f062116d --- /dev/null +++ b/systemd-testing/SYSTEMD-load-stop.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# This is a trivial script for testing. + +# Important: set pwd to occupy the mountpoint. +cd "$1" || exit $? + +# 2-edge handshake protocol +start_flag=run-the-load.flag +running_flag=load-is-running.flag + +if ! [[ -e $start_flag ]]; then + exit 0 +fi + +rm -f $start_flag + +while [[ -e $running_flag ]]; do + sleep 1 +done + +exit 0 diff --git a/systemd-testing/^{mntname}-@escvar{res}-delay.service b/systemd-testing/^{mntname}-@escvar{res}-delay.service new file mode 100644 index 00000000..049e6831 --- /dev/null +++ b/systemd-testing/^{mntname}-@escvar{res}-delay.service @@ -0,0 +1,34 @@ +@eval{%let{mntpath}{%subst{%{mntname}}{-}{/}}} +[Unit] +Description=MARS TESTING (u)mount delay for /@{mntpath}/@{res} +Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf + +## No markers for the template processor are necessary here, because +## this unit is indirectly referenced from other units. +## The template engine will follow all known dependencies and instantiate +## this one when necessary. + +## HINT: in addition to the combination of BindsTo= with After= as +## documented in "man systemd.unit" to get an _ordering_ dependency for +## startup, it looks like we also need PartOf= to get _another_ ordering +## dependency for _stopping_ in the right order. +## The docs were not particularly clear about this, I found this by testing. +## +BindsTo=@{mntname}-@escvar{res}.mount +After=@{mntname}-@escvar{res}.mount +PartOf=@{mntname}-@escvar{res}.mount + +ConditionPathIsMountPoint=/@{mntpath}/@{res} + +[Service] +Type=oneshot +RemainAfterExit=yes +# Important for avoiding failures: do not send any signals +KillMode=none + +## Simulate typical runtime behaviour by random delays +ExecStart=/bin/bash -c 'sleep $(( RANDOM * 3 / 32767 ))' +ExecStop=/bin/bash -c 'sleep $(( RANDOM * 4 / 32767 ))' + +[Install] +WantedBy=mars.service diff --git a/systemd-testing/daemon-reload.service b/systemd-testing/daemon-reload.service new file mode 100644 index 00000000..d8f0da5a --- /dev/null +++ b/systemd-testing/daemon-reload.service @@ -0,0 +1,24 @@ +[Unit] +Description=MARS global single-threaded daemon-reloead +Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf + +## The trick is to "misuse" this service (which exists only once) +## for inhibiting startup of "systemctl daemon-real" in parallel to +## itself. +## In addition, Before= and After= depencencies may be used for +## runtime exclusion of parallelism from/with other services. +## This appears to necessary in some places, where races have +## between daemon-reload and startup of other service have been observed. +Before=mars-trigger.service + +[Service] +# Important for blocking parallelism with itself +Type=oneshot +RemainAfterExit=no +# Important for avoiding failures: do not send any signals +KillMode=none + +ExecStart=/usr/bin/systemctl daemon-reload + +[Install] +WantedBy=mars.service diff --git a/systemd-testing/mars-@escvar{res}-trigger.path b/systemd-testing/mars-@escvar{res}-trigger.path new file mode 100644 index 00000000..63a118d3 --- /dev/null +++ b/systemd-testing/mars-@escvar{res}-trigger.path @@ -0,0 +1,17 @@ +[Unit] +Description=MARS per-resource watcher for /mars/resource-@{res}/systemd-trigger +Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf +Requires=mars-trigger.path +After=mars-trigger.path + +## Markers for the template processor +# ALWAYS_START + +[Path] +PathExists=/mars/resource-@{res}/systemd-trigger +PathChanged=/mars/resource-@{res}/systemd-trigger +PathModified=/mars/resource-@{res}/systemd-trigger +Unit=mars-@escvar{res}-trigger.service + +[Install] +WantedBy=mars.service diff --git a/systemd-testing/mars-@escvar{res}-trigger.service b/systemd-testing/mars-@escvar{res}-trigger.service new file mode 100644 index 00000000..07c3d8bb --- /dev/null +++ b/systemd-testing/mars-@escvar{res}-trigger.service @@ -0,0 +1,36 @@ +[Unit] +Description=MARS per-resource trigger from /mars/resource-@{res}/systemd-trigger +Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf + +## Prohibit parallelism with any daemon-reload +After=daemon-reload.service + +## The per-resource trigger is the _only_ one which is allowed +## to remotely start / stop any units dealing with resources. +## Otherwise, races or conflicting start / stop operations might +## occur, leading to deadlocks / failures / etc. +## +## General rule: each *.path watcher can only start its corresponding +## *-trigger.service at most _once_ in parallel (provided that the actions +## caused by "marsadm systemd-trigger-extern" are not forking into background). +## So there is never any parallelism of _any_ unit with exactly _itself_ +## (although _different_ units are allowed to run in parallel to each other, +## of course). + +## Do not start both the global and any of the per-resource triggers +## in parallel. +## It could lead to various races between global and per-resource units. +## In contrast, different per-resource triggers are not mutually exclusive. +After=mars-trigger.service + +[Service] +# Important for blocking parallelism with itself +Type=oneshot +RemainAfterExit=no +# Important for avoiding failures: do not send any signals +KillMode=none +# Important: the resource argument will keep remote triggers disjoint +ExecStart=/usr/bin/marsadm systemd-trigger-extern @{res} + +[Install] +WantedBy=mars.service diff --git a/systemd/mars-emergency.path b/systemd-testing/mars-emergency.path similarity index 82% rename from systemd/mars-emergency.path rename to systemd-testing/mars-emergency.path index 984512d1..0e6fa9b2 100644 --- a/systemd/mars-emergency.path +++ b/systemd-testing/mars-emergency.path @@ -1,5 +1,5 @@ [Unit] -Description=MARS systemd trigger from /mars/userspace/emergency-trigger +Description=MARS trigger from /mars/userspace/emergency-trigger Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf Requires=mars.service After=mars.service diff --git a/systemd/mars-emergency.service b/systemd-testing/mars-emergency.service similarity index 82% rename from systemd/mars-emergency.service rename to systemd-testing/mars-emergency.service index 329abc7f..cc7d3008 100644 --- a/systemd/mars-emergency.service +++ b/systemd-testing/mars-emergency.service @@ -5,6 +5,7 @@ Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf [Service] Type=oneshot RemainAfterExit=no +# Important for avoiding failures: do not send any signals KillMode=none ExecStart=/usr/bin/marsadm cron diff --git a/systemd/mars-trigger.path b/systemd-testing/mars-trigger.path similarity index 51% rename from systemd/mars-trigger.path rename to systemd-testing/mars-trigger.path index 82ff6499..08808ba2 100644 --- a/systemd/mars-trigger.path +++ b/systemd-testing/mars-trigger.path @@ -1,11 +1,17 @@ [Unit] -Description=MARS systemd trigger from /mars/userspace/systemd-trigger +Description=MARS global watcher /mars/userspace/systemd-trigger Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf -Requires=mars.service + +## Global path watcher for calling mars-trigger.service + +## Markers for the template processor +# ALWAYS_START + +BindsTo=mars.service After=mars.service [Path] -#PathExists=/mars/userspace/systemd-trigger +PathExists=/mars/userspace/systemd-trigger PathChanged=/mars/userspace/systemd-trigger PathModified=/mars/userspace/systemd-trigger Unit=mars-trigger.service diff --git a/systemd-testing/mars-trigger.service b/systemd-testing/mars-trigger.service new file mode 100644 index 00000000..6d4dfb25 --- /dev/null +++ b/systemd-testing/mars-trigger.service @@ -0,0 +1,26 @@ +[Unit] +Description=MARS global trigger from /mars/userspace/systemd-trigger +Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf + +## Prohibit parallelism with any daemon-reload +After=daemon-reload.service + +## The global trigger calls "marsadm systemd-trigger-extern" _without_ +## resource argument. +## The global variant will only generate any new templates, but will not +## activate/deactivate them (except when they are new). +## This is necessary for race avoidance with per-resource triggers. +## Only the per-resource triggers (see mars-@{res}-trigger.service) +## are allowed to actually start/stop any units dealing with resources. + +[Service] +# Important for blocking parallelism with itself +Type=oneshot +RemainAfterExit=no +# Important for avoiding failures: do not send any signals +KillMode=none +# Important: no resource argument must be given here +ExecStart=/usr/bin/marsadm systemd-trigger-extern + +[Install] +WantedBy=mars.service diff --git a/systemd/mars.path b/systemd-testing/mars.path similarity index 81% rename from systemd/mars.path rename to systemd-testing/mars.path index 374fb8a7..d2e363ee 100644 --- a/systemd/mars.path +++ b/systemd-testing/mars.path @@ -2,6 +2,9 @@ Description=MARS block layer HA (activation by appearance of /mars/uuid) Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf +## Markers for the template processor +# ALWAYS_START + [Path] PathExists=/mars/uuid Unit=mars.service diff --git a/systemd/mars.service b/systemd-testing/mars.service similarity index 65% rename from systemd/mars.service rename to systemd-testing/mars.service index e7a33fcc..4a1cc794 100644 --- a/systemd/mars.service +++ b/systemd-testing/mars.service @@ -1,17 +1,24 @@ [Unit] Description=MARS block layer HA (kernel module) Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf + +## Markers for the template processor +# ALWAYS_START + +BindsTo=mars.mount +After=mars.mount RequiresMountsFor=/mars/uuid + +Wants=network-online.target + StopWhenUnneeded=false IgnoreOnIsolate=true -ConditionPathIsSymbolicLink=/mars/uuid - [Service] Type=oneshot +# Important for avoiding failures: do not send any signals KillMode=none RemainAfterExit=yes -#ExecStartPre=if ! mountpoint /mars; then mount /dev/*/mars /mars; fi ExecStart=/sbin/modprobe mars ExecStop=/sbin/rmmod mars diff --git a/systemd-testing/mnt-test-@escvar{res}-testload.script b/systemd-testing/mnt-test-@escvar{res}-testload.script new file mode 100644 index 00000000..ace2b020 --- /dev/null +++ b/systemd-testing/mnt-test-@escvar{res}-testload.script @@ -0,0 +1,70 @@ +#!/bin/bash + +# Markers for the template processor +# DEFAULT_START +# DEFAULT_STOP +# +# ALSO=mars-@escvar{res}-trigger.path +# ALSO=mars-@escvar{res}-trigger.service + +op="$1" + +# Ensure that pure trigger does not change anything. + +mars_dev=/dev/mars/@{res} +mnt=/mnt/test/@{res} + +case "$op" in +start) + # Assumption: start and vmstart seem to be idempotent already + if ! [[ -b $mars_dev ]]; then + echo "ignoring, $mars_dev is not present" + exit 0 + fi + if mountpoint $mnt; then + echo "ignoring, $mnt is already mounted" + exit 0 + fi + mkdir -p $mnt + mount $mars_dev $mnt + mountpoint $mnt + rc=$? + # cleanup any old flags + rm -f $mnt/*.flag + # start load + if (( !rc )); then + /etc/marsadm/systemd-templates/SYSTEMD-load-occupy.sh $mnt + fi + exit $rc + ;; + +stop) + if ! mountpoint $mnt; then + # Idempotence + exit 0 + fi + + /etc/marsadm/systemd-templates/SYSTEMD-load-stop.sh $mnt + + # for additional safety + sleep 1 + + # umount, idempotent for increased robustness + if mountpoint $mnt; then + umount $mnt + fi + + # status + if mountpoint $mnt; then + exit 1 + fi + exit 0 + ;; + +*) + # Ignore all other ops, like enable / disable / etc + echo "Ignore '$op'" + exit 0 +esac + +exit 0 diff --git a/systemd-testing/mnt-test-@escvar{res}-testload.service b/systemd-testing/mnt-test-@escvar{res}-testload.service new file mode 100644 index 00000000..e9e0d955 --- /dev/null +++ b/systemd-testing/mnt-test-@escvar{res}-testload.service @@ -0,0 +1,49 @@ +[Unit] +Description=MARS TESTING dummy process running on /mnt/test/@{res} +Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf + +## Markers for the template processor +# TESTING_START + +## Prohibit parallelism with any daemon-reload +After=daemon-reload.service + +## HINT: in addition to the combination of BindsTo= with After= as +## documented in "man systemd.unit" to get an _ordering_ dependency for +## startup, it looks like we also need PartOf= to get _another_ ordering +## dependency for _stopping_ in the right order. +## The docs were not particularly clear about this, I found this by testing. + +## Comment / uncomment the following, depending on test behaviour: + +## This version uses an intermediate "delay" service for testing. +## Notice: the pathname part of the delay service is generated by +## pattern matching from ^{mnt} . Look at the generated units. +## This setup also tests transitive systemd dependencies, where +## BindsTo+After+PartOf is crucial for starting and stopping any +## intermediate units in the right order. +#BindsTo=mnt-test-@escvar{res}-delay.service +#After=mnt-test-@escvar{res}-delay.service +#PartOf=mnt-test-@escvar{res}-delay.service + +## Direct version without delay. Use in place of the delay service. +BindsTo=mnt-test-@escvar{res}.mount +After=mnt-test-@escvar{res}.mount +PartOf=mnt-test-@escvar{res}.mount + +ConditionPathIsMountPoint=/mnt/test/@{res} + +[Service] +Type=simple +ExecStart=/etc/marsadm/systemd-templates/SYSTEMD-load-occupy.sh /mnt/test/@{res} +ExecStop=/etc/marsadm/systemd-templates/SYSTEMD-load-stop.sh /mnt/test/@{res} +# Important for avoiding failures: do not send any signals +KillMode=none + +## Following is an alternative which does not work due to races. +## Only enable this if you want to trigger such problems for testing. +#ExecStop=/usr/bin/killall -r MARS-load +#KillMode=mixed + +[Install] +WantedBy=mars.service diff --git a/systemd-testing/mnt-test-@escvar{res}.mount b/systemd-testing/mnt-test-@escvar{res}.mount new file mode 100644 index 00000000..2b90432f --- /dev/null +++ b/systemd-testing/mnt-test-@escvar{res}.mount @@ -0,0 +1,44 @@ +[Unit] +Description=MARS TESTING local mount on /mnt/test/@{res} +Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf + +## Markers for the template processor +## Examples: + +## marsdm set-systemd-unit all TESTIN ==> mount + may produce some data +## (depending on another unit containing marker "TESTING_START") +# TESTING_STOP + +## marsadm set-systemd-unit all MOUNTED ==> only mount, nothing else +## This may be necessary for reaching UpToDate without inherent races +## on data production. +# MOUNTED_START +# MOUNTED_STOP + +## The following could be used for transitively stopping everything +## upon "systemctl stop mars.service". +## Not recommended, since it may cause unnecessary customer downtime +## when executed "by accident". +#BindsTo=mars.service + +Requires=mars.service +After=mars.service + +## Prohibit parallelism with any daemon-reload +After=daemon-reload.service + +# Only start when marsadm is controlling the target prosumer +ConditionPathIsSymbolicLink=/mars/resource-@{res}/systemd-want + +# Try to achieve idempotence for starting +ConditionPathIsMountPoint=!/mnt/test/@{res} + +[Mount] +What=/dev/mars/@{res} +Where=/mnt/test/@{res} +Options=noauto +# Important for avoiding failures: do not send any signals +KillMode=none + +[Install] +WantedBy=mars.service diff --git a/systemd-testing/trigger-wrapper-for-testing.sh b/systemd-testing/trigger-wrapper-for-testing.sh new file mode 100755 index 00000000..7a75074a --- /dev/null +++ b/systemd-testing/trigger-wrapper-for-testing.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +pid=$BASHPID +ppid=$PPID + +echo -n L $* $(pstree $pid) > /proc/sys/mars/trigger + +exec /usr/local/bin/marsadm systemd-trigger >> /mars/trigger.log 2>&1 diff --git a/systemd/MARS-load-occupy.sh b/systemd/MARS-load-occupy.sh deleted file mode 100755 index 9982294d..00000000 --- a/systemd/MARS-load-occupy.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# This is a trivial script for testing. -# -# It just occupies the mount point for some time, -# simulating a badly terminating process so that umount -# cannot work immediately, but needs to be restarted -# somewhat later. -# -# When this script is killed from "systemctl stop", the -# "sleep" sub-process will _not_ be killed, but terminate -# a little bit later. This leads to a race condition with lsof, -# similar to some observed practical daemon behaviour. - -cd "$1" || exit $? - -while true; do - sleep 1 -done diff --git a/systemd/^{mntname}-@{res}-medium-01.service b/systemd/^{mntname}-@{res}-medium-01.service deleted file mode 100644 index 5f40da7d..00000000 --- a/systemd/^{mntname}-@{res}-medium-01.service +++ /dev/null @@ -1,14 +0,0 @@ -@eval{%let{mntpath}{%subst{%{mntname}}{-}{/}}} -[Unit] -Description=MARS dummy process running on /@{mntpath}/@{res} -Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf -BindsTo=@{mntname}-@escvar{res}.mount -After=@{mntname}-@escvar{res}.mount - -[Service] -Type=simple -ExecStart=/etc/marsadm/systemd-templates/MARS-load-occupy.sh /@{mntpath}/@{res} -KillMode=process - -[Install] -WantedBy=mars.service diff --git a/systemd/^{mntname}-@{res}-medium-02.service b/systemd/^{mntname}-@{res}-medium-02.service deleted file mode 100644 index 406fb72c..00000000 --- a/systemd/^{mntname}-@{res}-medium-02.service +++ /dev/null @@ -1,14 +0,0 @@ -@eval{%let{mntpath}{%subst{%{mntname}}{-}{/}}} -[Unit] -Description=MARS dummy process running on /@{mntpath}/@{res} -Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf -BindsTo=@{mntname}-@escvar{res}-medium-01.service -After=@{mntname}-@escvar{res}-medium-01.service - -[Service] -Type=simple -ExecStart=/etc/marsadm/systemd-templates/MARS-load-occupy.sh /@{mntpath}/@{res} -KillMode=process - -[Install] -WantedBy=mars.service diff --git a/systemd/^{mntname}-@{res}-testload.service b/systemd/^{mntname}-@{res}-testload.service deleted file mode 100644 index 6f9055f6..00000000 --- a/systemd/^{mntname}-@{res}-testload.service +++ /dev/null @@ -1,14 +0,0 @@ -@eval{%let{mntpath}{%subst{%{mntname}}{-}{/}}} -[Unit] -Description=MARS dummy process running on /@{mntpath}/@{res} -Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf -BindsTo=@{mntname}-@escvar{res}-medium-02.service -After=@{mntname}-@escvar{res}-medium-02.service - -[Service] -Type=simple -ExecStart=/etc/marsadm/systemd-templates/MARS-load-occupy.sh /@{mntpath}/@{res} -KillMode=process - -[Install] -WantedBy=mars.service diff --git a/systemd/^{mntname}-@{res}.mount b/systemd/^{mntname}-@{res}.mount deleted file mode 100644 index 8fcd46ba..00000000 --- a/systemd/^{mntname}-@{res}.mount +++ /dev/null @@ -1,18 +0,0 @@ -@eval{%let{mntpath}{%subst{%{mntname}}{-}{/}}} -[Unit] -Description=MARS local mount on /@{mntpath}/@{res} -Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf -Requires=mars.service -After=mars.service - -ConditionPathIsSymbolicLink=/mars/resource-@{res}/systemd-want -ConditionPathExists=/mars/resource-@{res}/userspace/systemd-want-@{host} -ConditionPathExists=/dev/mars/@{res} -ConditionPathIsDirectory=/@{mntpath}/@{res} - -[Mount] -What=/dev/mars/@{res} -Where=/@{mntpath}/@{res} - -[Install] -WantedBy=mars.service diff --git a/systemd/dev-mars-@{res}.path b/systemd/dev-mars-@{res}.path deleted file mode 100644 index a5b9072e..00000000 --- a/systemd/dev-mars-@{res}.path +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=MARS auto-activation of primary device /dev/mars/@{res} -Documentation=https://github.com/schoebel/mars/docu/mars-user-manual.pdf -Requires=mars.service -After=mars.service - -[Path] -PathExists=/dev/mars/@{res} -Unit=mnt-test-@escvar{res}.mount - -[Install] -WantedBy=mars.service diff --git a/systemd/mars-@{res}-trigger.path b/systemd/mars-@{res}-trigger.path deleted file mode 100644 index 572d814f..00000000 --- a/systemd/mars-@{res}-trigger.path +++ /dev/null @@ -1,13 +0,0 @@ -[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] -PathChanged=/mars/resource-@{res}/systemd-want -PathModified=/mars/resource-@{res}/systemd-want -Unit=mars-trigger.service - -[Install] -WantedBy=mars.service diff --git a/systemd/mars-trigger.service b/systemd/mars-trigger.service deleted file mode 100644 index 25ca32e3..00000000 --- a/systemd/mars-trigger.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=MARS systemd trigger service from /mars/userspace/systemd-trigger -Documentation=https://github.com/schoebel/mars/docu/mars-manual.pdf - -[Service] -Type=oneshot -RemainAfterExit=no -KillMode=none -ExecStart=/usr/local/bin/marsadm systemd-trigger - -[Install] -WantedBy=mars.service