Commit ce0bc20c authored by Vitaly Lipatov's avatar Vitaly Lipatov

serv: don't use sudo for systemd if it is not needed

parent 5d473d09
...@@ -24,7 +24,7 @@ serv_cat() ...@@ -24,7 +24,7 @@ serv_cat()
case $SERVICETYPE in case $SERVICETYPE in
systemd) systemd)
sudocmd systemctl cat "$SERVICE" "$@" docmd systemctl cat "$SERVICE" "$@"
;; ;;
*) *)
case $DISTRNAME in case $DISTRNAME in
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2013, 2016, 2017 Etersoft # Copyright (C) 2012, 2013, 2016, 2017, 2021 Etersoft
# Copyright (C) 2012, 2013, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2013, 2016, 2017, 2021 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -38,7 +38,7 @@ is_service_running() ...@@ -38,7 +38,7 @@ is_service_running()
sudorun $INITDIR/$1 status >/dev/null 2>/dev/null sudorun $INITDIR/$1 status >/dev/null 2>/dev/null
;; ;;
systemd) systemd)
sudorun systemctl status $1 >/dev/null 2>/dev/null a='' systemctl status $1 >/dev/null 2>/dev/null
;; ;;
runit) runit)
sudorun sv status "$SERVICE" >/dev/null 2>/dev/null sudorun sv status "$SERVICE" >/dev/null 2>/dev/null
...@@ -68,7 +68,7 @@ is_service_autostart() ...@@ -68,7 +68,7 @@ is_service_autostart()
test -L "$(echo /etc/rc5.d/S??$1)" test -L "$(echo /etc/rc5.d/S??$1)"
;; ;;
systemd) systemd)
sudorun systemctl is-enabled $1 a='' systemctl is-enabled $1
;; ;;
runit) runit)
test -L "/var/service/$SERVICE" test -L "/var/service/$SERVICE"
...@@ -98,7 +98,7 @@ serv_status() ...@@ -98,7 +98,7 @@ serv_status()
sudocmd $INITDIR/$SERVICE status "$@" sudocmd $INITDIR/$SERVICE status "$@"
;; ;;
systemd) systemd)
sudocmd systemctl -l status $SERVICE "$@" docmd systemctl -l status $SERVICE "$@"
;; ;;
runit) runit)
sudocmd sv status "$SERVICE" sudocmd sv status "$SERVICE"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment