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
Vladislav
eepm
Commits
3e86f9dd
Commit
3e86f9dd
authored
8 years ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv: check anyservice support against anyservice version 0.3
parent
93839cdd
No related merge requests found
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"
...
@@ -99,24 +99,15 @@ is_active_systemd && CMD="systemd"
SERVICETYPE
=
$CMD
SERVICETYPE
=
$CMD
ANYSERVICE
=
$(
which anyservice 2>/dev/null
)
ANYSERVICE
=
$(
which anyservice 2>/dev/null
)
ANYSERVDIR
=
"/etc/systemd-lite"
ANYSYSDDIR
=
"/lib/systemd/system"
}
}
# TODO: done it on anyservice part
# TODO: done it on anyservice part
is_anyservice
()
is_anyservice
()
{
{
local
SERVICE
=
"
$1
"
[
-n
"
$ANYSERVICE
"
]
||
return
# not, if we have no anyservice at all
# check if anyservice is exists and checkd returns true
[
-n
"
$ANYSERVICE
"
]
||
return
1
$ANYSERVICE
"
$1
"
checkd 2>/dev/null
# 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
}
}
...
...
This diff is collapsed.
Click to expand it.
bin/serv-list
View file @
3e86f9dd
...
@@ -40,7 +40,7 @@ serv_list()
...
@@ -40,7 +40,7 @@ serv_list()
done
done
# TODO: только запущенные
# TODO: только запущенные
if
[
-n
"
$ANYSERVICE
"
]
;
then
if
[
-n
"
$ANYSERVICE
"
]
;
then
sudocmd
anyservice
list
sudocmd
$ANYSERVICE
list
return
return
fi
fi
;;
;;
...
...
This diff is collapsed.
Click to expand it.
bin/serv-status
View file @
3e86f9dd
...
@@ -49,9 +49,8 @@ is_service_autostart()
...
@@ -49,9 +49,8 @@ is_service_autostart()
case
$SERVICETYPE
in
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
service-chkconfig|service-upstart
)
if
is_anyservice
$1
;
then
if
is_anyservice
$SERVICE
;
then
# HACK: if is registered, assume it is autostarted
$ANYSERVICE
$SERVICE
isautostarted
[
-r
"
$ANYSERVDIR
/
$SERVICE
.service"
]
return
return
fi
fi
...
...
This diff is collapsed.
Click to expand it.
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