This commit is contained in:
Mark King 2025-04-05 05:24:34 +00:00 committed by GitHub
commit be0b44c69c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,7 +24,17 @@ __services_detail() {
}
service_running() {
if [ -f "/etc/init/$1.conf" ]; then
if [ -f "/sbin/service" ]; then
# Use systemd
case "$(/sbin/service $1 status 2>/dev/null)" in
*running*)
true
;;
*)
false
;;
esac
elif [ -f "/etc/init/$1.conf" ]; then
# Use upstart
case "$(status $1 2>/dev/null)" in
*running*)