]> TLD Linux GIT Repositories - rc-scripts.git/commitdiff
- drop systemd stuff, TLD will not be adopting this bloatware
authorMarcin Krol <hawk@tld-linux.org>
Tue, 14 Jul 2015 15:21:22 +0000 (15:21 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Tue, 14 Jul 2015 15:21:22 +0000 (15:21 +0000)
lib/functions
service
sysconfig/i18n

index 69041da25b6dac6cb40f697b10dd28484052ae18..41871391e435759b513ffd5e96343c4a0d7bc018 100644 (file)
@@ -166,21 +166,7 @@ strstr() {
 
 # Apply sysctl settings, including files in /etc/sysctl.d
 apply_sysctl() {
-       if [ -x /lib/systemd/systemd-sysctl ]; then
-               /lib/systemd/systemd-sysctl
-               return
-       fi
-
        local file
-       for file in /usr/lib/sysctl.d/*.conf; do
-               [ -f /run/sysctl.d/${file##*/} ] && continue
-               [ -f /etc/sysctl.d/${file##*/} ] && continue
-               test -f "$file" && sysctl -q -e -p "$file"
-       done
-       for file in /run/sysctl.d/*.conf; do
-               [ -f /etc/sysctl.d/${file##*/} ] && continue
-               test -f "$file" && sysctl -q -e -p "$file"
-       done
        for file in /etc/sysctl.d/*.conf; do
                test -f "$file" && sysctl -q -e -p "$file"
        done
diff --git a/service b/service
index 9184a4f35d046f7d86e20b27e4d107126654a58a..1e699318f77564fa0edf29dbcf686918d1fc50f5 100755 (executable)
--- a/service
+++ b/service
@@ -16,70 +16,8 @@ is_ignored_file() {
        return 1
 }
 
-# check if SERVICE is present in systemd and ACTION is valid systemctl command
-# returns false if systemd is disabled or not active
-is_systemd_service() {
-       local SERVICE=$1 ACTION=$2
-
-       [ "$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 | \
-       stop | \
-       reload | \
-       restart | \
-       try-restart | \
-       reload-or-restart | \
-       reload-or-try-restart | \
-       isolate | \
-       kill | \
-       is-active | \
-       status | \
-       show | \
-       reset-failed | \
-       enable | \
-       disable | \
-       is-enabled | \
-       reenable | \
-       preset | \
-       mask | \
-       unmask | \
-       link | \
-       load | \
-       snapshot | \
-       delete | \
-       set-environment | \
-       unset-environment )
-               ;;
-       *)
-               #echo "Not valid systemd command"
-               return 1
-       esac
-
-       [ -x /bin/systemd_booted ] || return 1
-       /bin/systemd_booted || return 1
-
-       /bin/systemctl show "$SERVICE".service | grep -q LoadError= && return 1 || return 0
-}
-
 status_all() {
-       local SERVICE TYPE has_systemd
-
-       if [ "$USE_SYSTEMD" != "no" ] && [ -x /bin/systemd_booted ] && /bin/systemd_booted; then
-               has_systemd=1
-       else
-               unset has_systemd
-       fi
-
+       local SERVICE TYPE
        cd ${SERVICEDIR}
        for SERVICE in *; do
                case "${SERVICE}" in
@@ -88,13 +26,8 @@ status_all() {
                *)
                if ! is_ignored_file "${SERVICE}" \
                                && [ -x "${SERVICEDIR}/${SERVICE}" ]; then
-                       if [ "$has_systemd" ] && [ -f /lib/systemd/system/${SERVICE}.service ]; then
-                               # D for SystemD
-                               TYPE='D'
-                       else
-                               # S for SysVinit
-                               TYPE='S'
-                       fi
+                       # S for SysVinit
+                       TYPE='S'
                        if ! grep -qs "\Wstatus)" "$SERVICE"; then
                                printf " %s %-60s %s\n" "$TYPE:[?]" "$SERVICE:" "unknown"
                                continue
@@ -119,7 +52,6 @@ USAGE="Usage: $(basename $0) < option > | --status-all | \
 [ service_name [ command | --full-restart ] ]"
 
 SERVICE=
-USE_SYSTEMD=
 
 if [ -d /etc/rc.d/init.d ]; then
        SERVICEDIR="/etc/rc.d/init.d"
@@ -151,10 +83,6 @@ while [ $# -gt 0 ]; do
                export SYSTEMCTL_SKIP_REDIRECT=1
                shift
                ;;
-       --no-systemd)
-               USE_SYSTEMD=no
-               shift
-               ;;
          *)
                if [ -z "${SERVICE}" -a $# -eq 1 -a "${1}" = "--status-all" ]; then
                        status_all
@@ -178,10 +106,7 @@ while [ $# -gt 0 ]; do
        esac
 done
 
-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
+if [ -x "${SERVICEDIR}/${SERVICE}" ]; then
        exec env -i LANG=$LANG PATH=$PATH TERM=$TERM "${SERVICEDIR}/${SERVICE}" ${ACTION} ${OPTIONS}
 else
        echo "${SERVICE}: unrecognized service" >&2
index 83e4e19e5e1655838f85fa98e9bb6340d46f914b..dd326d45701ed9b734ca91123f5937a496df835d 100644 (file)
@@ -1,7 +1,3 @@
-
-# NOTE: Do not use expressions here, systemd does not expand them:
-# LANG="${LANG:-en_US.UTF-8}"
-#
 #LANG=en_US.UTF-8
 #LANG=pl_PL.UTF-8