summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'functions.sh')
-rw-r--r--functions.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh
index 605aa48..7d146c8 100644
--- a/functions.sh
+++ b/functions.sh
@@ -325,6 +325,15 @@ from_runscript()
}
#
+# Determines whether the current shell is a subprocess of a systemd unit that
+# handles a service, socket, mount point or swap device, per systemd.exec(5).
+#
+from_unit()
+{
+ has_systemd && test "${SYSTEMD_EXEC_PID}" && test "${INVOCATION_ID}"
+}
+
+#
# Determines whether the kernel cmdline contains the specified parameter as a
# component of a comma-separated list specified in the format of gentoo=<list>.
#