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
3e86f9dd
Commit
3e86f9dd
authored
Aug 16, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv: check anyservice support against anyservice version 0.3
parent
93839cdd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
16 deletions
+6
-16
serv
bin/serv
+3
-12
serv-list
bin/serv-list
+1
-1
serv-status
bin/serv-status
+2
-3
No files found.
bin/serv
View file @
3e86f9dd
...
...
@@ -99,24 +99,15 @@ is_active_systemd && CMD="systemd"
SERVICETYPE
=
$CMD
ANYSERVICE
=
$(
which anyservice 2>/dev/null
)
ANYSERVDIR
=
"/etc/systemd-lite"
ANYSYSDDIR
=
"/lib/systemd/system"
}
# TODO: done it on anyservice part
is_anyservice
()
{
local
SERVICE
=
"
$1
"
# not, if we have no anyservice at all
[
-n
"
$ANYSERVICE
"
]
||
return
1
# not, if there is regular service with the name
[
-d
"
$INITDIR
/
$SERVICE
"
]
&&
return
1
# yes, the service is anyservice driven
[
-r
"
$ANYSERVDIR
/
$SERVICE
.service"
]
&&
return
0
# yes, the service can be anyservice driven
[
-r
"
$ANYSYSDDIR
/
$SERVICE
.service"
]
&&
return
0
return
1
[
-n
"
$ANYSERVICE
"
]
||
return
# check if anyservice is exists and checkd returns true
$ANYSERVICE
"
$1
"
checkd 2>/dev/null
}
...
...
bin/serv-list
View file @
3e86f9dd
...
...
@@ -40,7 +40,7 @@ serv_list()
done
# TODO: только запущенные
if
[
-n
"
$ANYSERVICE
"
]
;
then
sudocmd
anyservice
list
sudocmd
$ANYSERVICE
list
return
fi
;;
...
...
bin/serv-status
View file @
3e86f9dd
...
...
@@ -49,9 +49,8 @@ is_service_autostart()
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
if
is_anyservice
$1
;
then
# HACK: if is registered, assume it is autostarted
[
-r
"
$ANYSERVDIR
/
$SERVICE
.service"
]
if
is_anyservice
$SERVICE
;
then
$ANYSERVICE
$SERVICE
isautostarted
return
fi
...
...
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