From 164ce485eb237bf022a5e88cffece2876abe5f18 Mon Sep 17 00:00:00 2001 From: Mark King Date: Sun, 12 Apr 2020 20:23:22 +0100 Subject: [PATCH] services supports systemd Adds support for systemd services to the services script. Tested on Debian 10. --- usr/lib/byobu/services | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/usr/lib/byobu/services b/usr/lib/byobu/services index b52e95c2..6531013d 100755 --- a/usr/lib/byobu/services +++ b/usr/lib/byobu/services @@ -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*)