Changeset 58216 in vbox
- Timestamp:
- Oct 13, 2015 2:47:03 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Installer/linux/routines.sh (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/routines.sh
r58186 r58216 166 166 test -L "/sbin/rc${name}" && rm "/sbin/rc${name}" 167 167 ln -s "${script}" "/sbin/rc${name}" 168 test -x "`which systemctl 2>/dev/null`" && 169 { systemd_wrap_init_script "$script" "$name"; return; } 168 if test -x "`which systemctl 2>/dev/null`"; then 169 if ! test -L /sbin/init || ls -l /sbin/init | grep -q systemd; then 170 { systemd_wrap_init_script "$script" "$name"; return; } 171 fi 172 fi 170 173 if test -d /etc/rc.d/init.d; then 171 174 cp "${script}" "/etc/rc.d/init.d/${name}" && … … 194 197 } 195 198 199 ## Did we install a systemd service? 200 systemd_service_installed() 201 { 202 ## Name of service to test. 203 name="${1}" 204 205 test -f /lib/systemd/system/"${name}".service || 206 test -f /usr/lib/systemd/system/"${name}".service 207 } 208 196 209 ## Perform an action on a service 197 210 do_sysvinit_action() … … 205 218 test ! -z "${name}" && test ! -z "${action}" || 206 219 { echo "${self}: missing argument" >&2; return 1; } 207 if test -x "`which systemctl 2>/dev/null`"; then220 if systemd_service_installed "${name}"; then 208 221 systemctl -q ${action} "${name}" 209 222 elif test -x "`which service 2>/dev/null`"; then … … 266 279 test -n "${name}" || \ 267 280 { echo "${self}: missing argument" >&2; return 1; } 268 test -x "`which systemctl 2>/dev/null`" && \281 systemd_service_installed "${name}" && \ 269 282 { systemctl -q enable "${name}"; return; } 270 283 if test -x "/etc/rc.d/init.d/${name}"; then
Note:
See TracChangeset
for help on using the changeset viewer.

