packages: systemd/pld-rc-inetd-generator.sh - added support for pre_start/p...
baggins
baggins at pld-linux.org
Sun Jun 10 13:07:31 CEST 2012
Author: baggins Date: Sun Jun 10 11:07:31 2012 GMT
Module: packages Tag: HEAD
---- Log message:
- added support for pre_start/post_stop scripts
---- Files affected:
packages/systemd:
pld-rc-inetd-generator.sh (1.2 -> 1.3)
---- Diffs:
================================================================
Index: packages/systemd/pld-rc-inetd-generator.sh
diff -u packages/systemd/pld-rc-inetd-generator.sh:1.2 packages/systemd/pld-rc-inetd-generator.sh:1.3
--- packages/systemd/pld-rc-inetd-generator.sh:1.2 Fri May 4 03:40:43 2012
+++ packages/systemd/pld-rc-inetd-generator.sh Sun Jun 10 13:07:25 2012
@@ -1,8 +1,5 @@
#!/bin/sh
-#
-# TODO:
-# pre_start_service() and pre_stop_service()
-#
+
parse_one_service() {
SOCKET_FILE="${CURRENT_SERVICE}.socket"
SERVICE_FILE="${CURRENT_SERVICE}.service"
@@ -76,6 +73,22 @@
echo >>$SERVICE_FILE
else
echo "$DAEMONARGS" >>$SERVICE_FILE
+ fi
+
+ if typeset -f pre_start_service 2>&1 >/dev/null ; then
+ echo "#!/bin/sh" >${CURRENT_SERVICE}_pre_start.sh
+ typeset -f pre_start_service >>${CURRENT_SERVICE}_pre_start.sh
+ echo "pre_start_service" >>${CURRENT_SERVICE}_pre_start.sh
+ chmod u+x ${CURRENT_SERVICE}_pre_start.sh
+ echo "ExecStartPre=${CURRENT_SERVICE}_pre_start.sh" >>$SERVICE_FILE
+ fi
+
+ if typeset -f pre_stop_service 2>&1 >/dev/null ; then
+ echo "#!/bin/sh" >${CURRENT_SERVICE}_post_stop.sh
+ typeset -f pre_stop_service >>${CURRENT_SERVICE}_post_stop.sh
+ echo "pre_stop_service" >>${CURRENT_SERVICE}_post_stop.sh
+ chmod u+x ${CURRENT_SERVICE}_post_stop.sh
+ echo "ExecStopPost=${CURRENT_SERVICE}_post_stop.sh" >>$SERVICE_FILE
fi
echo >>$SERVICE_FILE
================================================================
---- CVS-web:
http://cvs.pld-linux.org/packages/systemd/pld-rc-inetd-generator.sh?r1=1.2&r2=1.3
More information about the pld-cvs-commit
mailing list