SVN: rc-scripts/trunk/service
glen
glen at pld-linux.org
Sat Mar 17 10:32:55 CET 2012
Author: glen
Date: Sat Mar 17 10:32:55 2012
New Revision: 12496
Modified:
rc-scripts/trunk/service
Log:
as we are redirecting to systemd, detect when systemd redirects back due /sbinservice in .service file
Modified: rc-scripts/trunk/service
==============================================================================
--- rc-scripts/trunk/service (original)
+++ rc-scripts/trunk/service Sat Mar 17 10:32:55 2012
@@ -23,6 +23,14 @@
[ "$USE_SYSTEMD" = "no" ] && return 1
+ # if we are called from systemd itself, because some .service specified
+ # invocation via /sbin/service. this avoids loops
+ # detect this via CMDLINE var, which has leaked from geninitrd
+ if [ -n "$CMDLINE" ]; then
+ echo >&2 "Warning: CMDLINE env set, likely you are defining .service to use /sbin/service, please use /etc/rc.d/init.d/<SERVICE> instead"
+ return 1
+ fi
+
case "$ACTION" in
# list obtained as: man systemctl | grep N.*A.*M.*E
start | \
More information about the pld-cvs-commit
mailing list