# common part
service_body() {
cat <<-EOF
- if [ -f /var/lock/subsys/$service ]; then
+ if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
+ if [ -f /var/lock/subsys/$service ]; then
EOF
if [ "$noop" = 1 ]; then
echo :
if [ "$quiet" != 1 ]; then
cat <<-EOF
- else
- echo 'Run "/sbin/service $service start" to start $desc.'
+ else
+ echo 'Run "/sbin/service $service start" to start $desc.'
EOF
fi
cat <<-EOF
+ fi
fi
EOF
}
skip_auto_restart_body
echo 'if [ $(skip_auto_restart) = no ]; then'
service_body
+ echo 'else'
+ # service restart was disabled, tell them to restart it
+ cat <<-EOF
+ if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
+ if [ -f /var/lock/subsys/$service ]; then
+ echo 'Run "/sbin/service $service restart" to restart $desc.'
+ fi
+ fi
+ EOF
echo 'fi'
else
service_body