File tree Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Expand file tree Collapse file tree 1 file changed +22
-8
lines changed Original file line number Diff line number Diff line change 2121#
2222RCDIR=" /etc/init.d"
2323
24+ # legacy actions
25+ actiondir=" /usr/lib/initscripts/legacy-actions"
26+
2427#
2528# Clean environment
2629#
@@ -53,11 +56,19 @@ is_target()
5356 test " $state " = " LoadState=loaded"
5457}
5558
59+
60+ is_systemd_action ()
61+ {
62+ case " $1 " in
63+ start|stop|reload|restart|try-restart|force-reload|status) return 0 ;;
64+ esac
65+ return 1
66+ }
5667exec_rc ()
5768{
69+ local rc=' '
5870 if sd_booted && test -z " $SYSTEMD_NO_WRAP " ; then
59- case " $2 " in
60- start|stop|reload|restart|try-restart|force-reload|status)
71+ if is_systemd_action " $2 " ; then
6172 if is_service " $1 " ; then
6273 daemon_reload " $1 .service"
6374 systemctl " $2 " " $1 .service"
@@ -78,15 +89,18 @@ exec_rc ()
7889 fi
7990 echo " $1 is neither service nor target!?" >&2
8091 return " 1"
81- ;;
82- * )
92+ elif [ -x " $actiondir /$1 /$2 " ]; then
93+ rc=" $actiondir /$1 /$2 "
94+ shift 2
95+ else
8396 echo " Usage: $0 " $1 " {start|stop|reload|restart|try-restart|force-reload|status}"
8497 return 1
85- ;;
86- esac
98+ fi
99+ fi
100+ if [ -z " $rc " ]; then
101+ rc=" ${RCDIR} /$1 "
102+ shift
87103 fi
88- local rc=" ${RCDIR} /$1 "
89- shift
90104 env -i LANG=$LANG PATH=$PATH TERM=$TERM SYSTEMD_NO_WRAP=$SYSTEMD_NO_WRAP " $rc " ${1+" $@ " }
91105}
92106
You can’t perform that action at this time.
0 commit comments