mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-19 21:13:19 -07:00
services supports systemd
Adds support for systemd services to the services script. Tested on Debian 10.
This commit is contained in:
parent
bfb7a763d0
commit
164ce485eb
1 changed files with 11 additions and 1 deletions
|
@ -24,7 +24,17 @@ __services_detail() {
|
||||||
}
|
}
|
||||||
|
|
||||||
service_running() {
|
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
|
# Use upstart
|
||||||
case "$(status $1 2>/dev/null)" in
|
case "$(status $1 2>/dev/null)" in
|
||||||
*running*)
|
*running*)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue