mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-01-31 14:45:44 +00:00
Update common-service-script.sh
This commit is contained in:
parent
987f5da3b9
commit
dc61abd3bb
|
@ -23,6 +23,9 @@ startService() {
|
||||||
rc-service)
|
rc-service)
|
||||||
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start
|
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" start
|
||||||
;;
|
;;
|
||||||
|
runit)
|
||||||
|
"$ESCALATION_TOOL" sv start "$1"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +37,9 @@ stopService() {
|
||||||
rc-service)
|
rc-service)
|
||||||
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop
|
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" stop
|
||||||
;;
|
;;
|
||||||
|
runit)
|
||||||
|
"$ESCALATION_TOOL" sv stop "$1"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +51,11 @@ enableService() {
|
||||||
rc-service)
|
rc-service)
|
||||||
"$ESCALATION_TOOL" rc-update add "$1"
|
"$ESCALATION_TOOL" rc-update add "$1"
|
||||||
;;
|
;;
|
||||||
|
runit)
|
||||||
|
"$ESCALATION_TOOL" mkdir -p "/run/runit/supervise.$1"
|
||||||
|
"$ESCALATION_TOOL" ln -sf "/etc/sv/$1" "/var/service/"
|
||||||
|
sleep 2
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +67,9 @@ disableService() {
|
||||||
rc-service)
|
rc-service)
|
||||||
"$ESCALATION_TOOL" rc-update del "$1"
|
"$ESCALATION_TOOL" rc-update del "$1"
|
||||||
;;
|
;;
|
||||||
|
runit)
|
||||||
|
"$ESCALATION_TOOL" rm -f "/var/service/$1"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +82,10 @@ startAndEnableService() {
|
||||||
enableService "$1"
|
enableService "$1"
|
||||||
startService "$1"
|
startService "$1"
|
||||||
;;
|
;;
|
||||||
|
runit)
|
||||||
|
enableService "$1"
|
||||||
|
startService "$1"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +97,10 @@ isServiceActive() {
|
||||||
rc-service)
|
rc-service)
|
||||||
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet
|
"$ESCALATION_TOOL" "$INIT_MANAGER" "$1" status --quiet
|
||||||
;;
|
;;
|
||||||
|
runit)
|
||||||
|
"$ESCALATION_TOOL" sv status "$1" >/dev/null 2>&1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
checkInitManager 'systemctl rc-service'
|
checkInitManager 'systemctl rc-service runit'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user