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
dc7cf184
Commit
dc7cf184
authored
Dec 13, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv: allow additional params for start, stop and try_restart
parent
d4061a1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
11 deletions
+20
-11
serv-start
bin/serv-start
+6
-3
serv-stop
bin/serv-stop
+6
-3
serv-try_restart
bin/serv-try_restart
+8
-5
No files found.
bin/serv-start
View file @
dc7cf184
...
...
@@ -20,15 +20,18 @@
# Start service
serv_start
()
{
local
SERVICE
=
"
$1
"
shift
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
sudocmd service
$
1
start
sudocmd service
$
SERVICE
start
"
$@
"
;;
service-initd|service-update
)
sudocmd /etc/init.d/
$
1
start
sudocmd /etc/init.d/
$
SERVICE
start
"
$@
"
;;
systemd
)
sudocmd systemctl start
$1
sudocmd systemctl start
"
$SERVICE
"
"
$@
"
;;
*
)
fatal
"Do not known command for
$SERVICETYPE
"
...
...
bin/serv-stop
View file @
dc7cf184
...
...
@@ -20,15 +20,18 @@
# Stop service
serv_stop
()
{
local
SERVICE
=
"
$1
"
shift
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
sudocmd service
$
1
stop
sudocmd service
$
SERVICE
stop
"
$@
"
;;
service-initd|service-update
)
sudocmd /etc/init.d/
$
1
stop
sudocmd /etc/init.d/
$
SERVICE
stop
"
$@
"
;;
systemd
)
sudocmd systemctl stop
$
1
sudocmd systemctl stop
$
SERVICE
"
$@
"
;;
*
)
fatal
"Do not known command for
$SERVICETYPE
"
...
...
bin/serv-try_restart
View file @
dc7cf184
...
...
@@ -22,17 +22,20 @@ load_helper serv-status
# Try restart service (if it is running)
serv_try_restart
()
{
local
SERVICE
=
"
$1
"
shift
case
$SERVICETYPE
in
service-chkconfig|service-upstart
)
is_service_running
$
1
||
return
0
sudocmd service
$
1
restart
is_service_running
$
SERVICE
||
return
0
sudocmd service
$
SERVICE
restart
"
$@
"
;;
service-initd|service-update
)
is_service_running
$
1
||
return
0
sudocmd /etc/init.d/
$
1
restart
is_service_running
$
SERVICE
||
return
0
sudocmd /etc/init.d/
$
SERVICE
restart
"
$@
"
;;
systemd
)
sudocmd systemctl try-restart
$
1
sudocmd systemctl try-restart
$
SERVICE
"
$@
"
;;
*
)
fatal
"Do not known 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