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
etersoft
eepm
Commits
658c5f05
Commit
658c5f05
authored
Jun 19, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv: fixes for systemd after real use
parent
4d507e35
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
11 deletions
+15
-11
serv-list
bin/serv-list
+2
-2
serv-list_all
bin/serv-list_all
+1
-1
serv-list_startup
bin/serv-list_startup
+6
-1
serv-status
bin/serv-status
+6
-7
No files found.
bin/serv-list
View file @
658c5f05
...
...
@@ -30,13 +30,13 @@ serv_list()
sudocmd service
--status-all
;;
systemd
)
sudocmd systemctl list-units
sudocmd systemctl list-units
$@
;;
*
)
load_helper serv-list_all
load_helper serv-status
for
i
in
$(
serv_list_all
)
;
do
is_service_running
$i
&&
echo
$i
is_service_running
$i
>
/dev/null
&&
echo
$i
done
;;
esac
...
...
bin/serv-list_all
View file @
658c5f05
...
...
@@ -29,7 +29,7 @@ serv_list_all()
sudocmd
ls
-1
/etc/init.d/
*
|
sed
-e
"s|/etc/init.d/||g"
|
grep
-v
README
;;
systemd
)
sudocmd systemctl list-unit-files
sudocmd systemctl list-unit-files
$@
;;
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
...
...
bin/serv-list_startup
View file @
658c5f05
...
...
@@ -31,7 +31,12 @@ serv_list_startup()
# sudocmd systemctl list-unit-files
# ;;
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
load_helper serv-list_all
load_helper serv-status
for
i
in
$(
serv_list_all |
cut
-f
1
-d
" "
|
grep
"
\.
service$"
)
;
do
is_service_autostart
>
/dev/null
$i
&&
echo
$i
done
;;
esac
}
bin/serv-status
View file @
658c5f05
#!/bin/sh
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 2013
Etersoft
# Copyright (C) 2012
, 2013
Vitaly Lipatov <lav@etersoft.ru>
#
# 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
...
...
@@ -28,8 +28,7 @@ is_service_running()
$SUDO
/etc/init.d/
$1
status
>
/dev/null
;;
systemd
)
#sudocmd systemctl is-enabled $1
fatal
"FIXME: don't know how detect current startup state"
$SUDO
systemctl status
$1
>
/dev/null
;;
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
...
...
@@ -48,7 +47,7 @@ is_service_autostart()
fatal
"FIXME: don't know how detect current startup state"
;;
systemd
)
sudocmd systemctl is-enabled
$1
.service
$SUDO
systemctl is-enabled
$1
;;
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
...
...
@@ -58,7 +57,7 @@ is_service_autostart()
serv_status
()
{
is_service_autostart
$1
&&
echo
"Service
$1
is sheduled to run on startup"
||
echo
"Service
$1
will NOT run on startup"
is_service_autostart
$1
&&
echo
"Service
$1
is s
c
heduled to run on startup"
||
echo
"Service
$1
will NOT run on startup"
local
SERVICE
=
"
$1
"
shift
...
...
@@ -71,7 +70,7 @@ serv_status()
sudocmd /etc/init.d/
$SERVICE
status
"
$@
"
;;
systemd
)
sudocmd systemctl status
$SERVICE
.service
"
$@
"
sudocmd systemctl status
$SERVICE
"
$@
"
;;
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
...
...
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