Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nurlan
eepm
Commits
ce0bc20c
Commit
ce0bc20c
authored
Sep 01, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv: don't use sudo for systemd if it is not needed
parent
5d473d09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
serv-cat
bin/serv-cat
+1
-1
serv-status
bin/serv-status
+5
-5
No files found.
bin/serv-cat
View file @
ce0bc20c
...
@@ -24,7 +24,7 @@ serv_cat()
...
@@ -24,7 +24,7 @@ serv_cat()
case
$SERVICETYPE
in
case
$SERVICETYPE
in
systemd
)
systemd
)
su
docmd systemctl
cat
"
$SERVICE
"
"
$@
"
docmd systemctl
cat
"
$SERVICE
"
"
$@
"
;;
;;
*
)
*
)
case
$DISTRNAME
in
case
$DISTRNAME
in
...
...
bin/serv-status
View file @
ce0bc20c
#!/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
)
su
docmd systemctl
-l
status
$SERVICE
"
$@
"
docmd systemctl
-l
status
$SERVICE
"
$@
"
;;
;;
runit
)
runit
)
sudocmd sv status
"
$SERVICE
"
sudocmd sv status
"
$SERVICE
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment