summaryrefslogtreecommitdiff
path: root/test/testsuite-63.units/test63-glob.service
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2022-08-02 20:07:35 +0100
committerLuca Boccassi <bluca@debian.org>2022-08-23 20:38:08 +0100
commit4c420328549ed98c6ca170d8ccc89cbee2f38ccc (patch)
tree2fffd3d5c7e3c6e99b24cc55f031c69eab24ac76 /test/testsuite-63.units/test63-glob.service
parent48b92b37acbd2bf9c36ac5e67961b15723243cda (diff)
downloadsystemd-4c420328549ed98c6ca170d8ccc89cbee2f38ccc.tar.gz
service: set TRIGGER_UNIT= and TRIGGER_PATH= on activation by path unit
When a service is triggered by a path unit, pass the path unit name and the path that triggered it via env vars to the spawned processes. Note that this is best-effort, as there might be many triggers at the same time, but we only get woken up by one.
Diffstat (limited to 'test/testsuite-63.units/test63-glob.service')
-rw-r--r--test/testsuite-63.units/test63-glob.service7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/testsuite-63.units/test63-glob.service b/test/testsuite-63.units/test63-glob.service
new file mode 100644
index 0000000000..3f49dd4620
--- /dev/null
+++ b/test/testsuite-63.units/test63-glob.service
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Service]
+ExecStartPre=sh -c 'test "$TRIGGER_PATH" = /tmp/test63-glob-foo'
+ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = test63-glob.path'
+ExecStart=systemd-notify --ready
+RemainAfterExit=yes
+Type=notify