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
c77dec4f
Commit
c77dec4f
authored
8 years ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
anyservice support fixes
parent
5c4ea95c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
+19
-5
serv
bin/serv
+1
-1
serv-disable
bin/serv-disable
+2
-0
serv-enable
bin/serv-enable
+10
-2
serv-status
bin/serv-status
+6
-2
No files found.
bin/serv
View file @
c77dec4f
...
...
@@ -98,7 +98,7 @@ is_active_systemd && CMD="systemd"
SERVICETYPE
=
$CMD
ANYSERVICE
=
$(
which anyservice 2>/dev/null
>
/dev/null
)
ANYSERVICE
=
$(
which anyservice 2>/dev/null
)
ANYSERVDIR
=
"/etc/systemd-lite"
ANYSYSDDIR
=
"/lib/systemd/system"
...
...
This diff is collapsed.
Click to expand it.
bin/serv-disable
View file @
c77dec4f
...
...
@@ -23,6 +23,8 @@ load_helper serv-status
# Enable service by default
serv_disable
()
{
local
SERVICE
=
"
$1
"
is_service_running
$1
&&
{
serv_stop
$1
||
return
;
}
is_service_autostart
$1
||
{
echo
"Service
$1
already disabled for startup"
&&
return
;
}
...
...
This diff is collapsed.
Click to expand it.
bin/serv-enable
View file @
c77dec4f
...
...
@@ -21,9 +21,10 @@ load_helper serv-start
load_helper serv-status
# Enable service by default
serv_enable
()
__
serv_enable
()
{
is_service_running
$1
||
serv_start
$1
||
return
local
SERVICE
=
"
$1
"
is_service_autostart
$1
&&
echo
"Service
$1
already enabled for startup"
&&
return
case
$SERVICETYPE
in
...
...
@@ -52,3 +53,10 @@ serv_enable()
esac
}
serv_enable
()
{
__serv_enable
"
$1
"
||
return
# start if need
is_service_running
$1
||
serv_start
$1
||
return
}
This diff is collapsed.
Click to expand it.
bin/serv-status
View file @
c77dec4f
...
...
@@ -20,9 +20,11 @@
# FIXME: sudo ask password, but we do not print command before
is_service_running
()
{
local
SERVICE
=
"
$1
"
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
if
is_anyservice
$
SERVICE
;
then
if
is_anyservice
$
1
;
then
$SUDO
anyservice
$1
status
>
/dev/null
return
fi
...
...
@@ -43,9 +45,11 @@ is_service_running()
# FIXME: sudo ask password, but we do not print command before
is_service_autostart
()
{
local
SERVICE
=
"
$1
"
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
if
is_anyservice
$
SERVICE
;
then
if
is_anyservice
$
1
;
then
# if is registered, assume it is autostarted
return
0
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