]> git.pld-linux.org Git - projects/rc-scripts.git/blobdiff - service
killproc: retry when --waitfortime was specified
[projects/rc-scripts.git] / service
diff --git a/service b/service
index 2d5a3e555e42674e6bb9401eb39f0ffbdb2365d0..f882bdb2888fd1d2535ce383b87c03716f4c6ec6 100755 (executable)
--- a/service
+++ b/service
@@ -72,7 +72,7 @@ is_systemd_service() {
 }
 
 status_all() {
-       local SERVICE TYPE has_systemd has_upstart
+       local SERVICE TYPE has_systemd
 
        if [ "$USE_SYSTEMD" != "no" ] && [ -x /bin/systemd_booted ] && /bin/systemd_booted; then
                has_systemd=1
@@ -80,12 +80,6 @@ status_all() {
                unset has_systemd
        fi
 
-       if [ "$USE_UPSTART" != "no" ] && [ -x /sbin/initctl ]; then
-               has_upstart=1
-       else
-               unset has_upstart
-       fi
-
        cd ${SERVICEDIR}
        for SERVICE in *; do
                case "${SERVICE}" in
@@ -97,9 +91,6 @@ status_all() {
                        if [ "$has_systemd" ] && [ -f /lib/systemd/system/${SERVICE}.service ]; then
                                # D for SystemD
                                TYPE='D'
-                       elif [ "$has_upstart" ] && [ -f /etc/init/${SERVICE}.conf ]; then
-                               # U for upstart
-                               TYPE='U'
                        else
                                # S for SysVinit
                                TYPE='S'
@@ -108,7 +99,7 @@ status_all() {
                                printf " %s %-60s %s\n" "$TYPE:[?]" "$SERVICE:" "unknown"
                                continue
                        else
-                               out=$(env -i USE_UPSTART=$USE_UPSTART LANG="$LANG" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" status 2>&1)
+                               out=$(env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "$SERVICEDIR/$SERVICE" status 2>&1)
                                if [ "$?" = "0" -a -n "$out" ]; then
                                        printf " %s %-60s %s\n" "$TYPE:[+]" "$SERVICE:" "running"
                                        continue
@@ -128,7 +119,6 @@ USAGE="Usage: $(basename $0) < option > | --status-all | \
 [ service_name [ command | --full-restart ] ]"
 
 SERVICE=
-USE_UPSTART=
 USE_SYSTEMD=
 
 if [ -d /etc/rc.d/init.d ]; then
@@ -161,14 +151,6 @@ while [ $# -gt 0 ]; do
                export SYSTEMCTL_SKIP_REDIRECT=1
                shift
                ;;
-       --upstart)
-               USE_UPSTART=yes
-               shift
-               ;;
-       --no-upstart)
-               USE_UPSTART=no
-               shift
-               ;;
        --no-systemd)
                USE_SYSTEMD=no
                shift
@@ -180,8 +162,8 @@ while [ $# -gt 0 ]; do
                elif [ $# -eq 2 -a "${2}" = "--full-restart" ]; then
                        SERVICE="${1}"
                        if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
-                               env -i USE_UPSTART=$USE_UPSTART LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" stop
-                               env -i USE_UPSTART=$USE_UPSTART LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" start
+                               env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" stop
+                               env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" start
                                exit $?
                        fi
                elif [ -z "${SERVICE}" ]; then
@@ -200,7 +182,7 @@ if is_systemd_service "${SERVICE}" "${ACTION}"; then
        echo >&2 "Redirecting to /bin/systemctl --output=cat ${ACTION} ${SERVICE}.service ${OPTIONS}"
        exec /bin/systemctl --output=cat ${ACTION} ${SERVICE}.service ${OPTIONS}
 elif [ -x "${SERVICEDIR}/${SERVICE}" ]; then
-       exec env -i USE_UPSTART=$USE_UPSTART LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS}
+       exec env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS}
 else
        echo "${SERVICE}: unrecognized service" >&2
        exit 1
This page took 0.035713 seconds and 4 git commands to generate.