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
08dfd7d2
Commit
08dfd7d2
authored
Apr 04, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce INITDIR and use it
parent
0e97eccf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
10 deletions
+11
-10
serv
bin/serv
+2
-0
serv-common
bin/serv-common
+3
-4
serv-list_all
bin/serv-list_all
+1
-1
serv-start
bin/serv-start
+1
-1
serv-status
bin/serv-status
+2
-2
serv-stop
bin/serv-stop
+1
-1
serv-try_restart
bin/serv-try_restart
+1
-1
No files found.
bin/serv
View file @
08dfd7d2
...
@@ -32,6 +32,8 @@ load_helper()
...
@@ -32,6 +32,8 @@ load_helper()
load_helper epm-sh-functions
load_helper epm-sh-functions
INITDIR
=
/etc/init.d
PATH
=
$PATH
:/sbin:/usr/sbin
PATH
=
$PATH
:/sbin:/usr/sbin
set_sudo
set_sudo
...
...
bin/serv-common
View file @
08dfd7d2
...
@@ -27,12 +27,12 @@ serv_common()
...
@@ -27,12 +27,12 @@ serv_common()
sudocmd service
$SERVICE
"
$@
"
sudocmd service
$SERVICE
"
$@
"
;;
;;
service-initd|service-update
)
service-initd|service-update
)
sudocmd
/etc/init.d
/
$SERVICE
"
$@
"
sudocmd
$INITDIR
/
$SERVICE
"
$@
"
;;
;;
systemd
)
systemd
)
# run init script directly (for nonstandart commands)
# run init script directly (for nonstandart commands)
if
[
-x
/etc/init.d
/
$SERVICE
]
;
then
if
[
-x
$INITDIR
/
$SERVICE
]
;
then
sudocmd
/etc/init.d
/
$SERVICE
"
$@
"
sudocmd
$INITDIR
/
$SERVICE
"
$@
"
else
else
sudocmd systemctl
"
$@
"
$SERVICE
sudocmd systemctl
"
$@
"
$SERVICE
fi
fi
...
@@ -41,5 +41,4 @@ serv_common()
...
@@ -41,5 +41,4 @@ serv_common()
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
esac
esac
}
}
bin/serv-list_all
View file @
08dfd7d2
...
@@ -26,7 +26,7 @@ serv_list_all()
...
@@ -26,7 +26,7 @@ serv_list_all()
sudocmd chkconfig
--list
|
cut
-f1
sudocmd chkconfig
--list
|
cut
-f1
;;
;;
service-initd|service-update
)
service-initd|service-update
)
sudocmd
ls
-1
/etc/init.d/
*
|
sed
-e
"s|/etc/init.d/||g"
|
grep
-v
README
sudocmd
ls
$INITDIR
/
|
grep
-v
README
;;
;;
systemd
)
systemd
)
sudocmd systemctl list-unit-files
$@
sudocmd systemctl list-unit-files
$@
...
...
bin/serv-start
View file @
08dfd7d2
...
@@ -28,7 +28,7 @@ serv_start()
...
@@ -28,7 +28,7 @@ serv_start()
sudocmd service
$SERVICE
start
"
$@
"
sudocmd service
$SERVICE
start
"
$@
"
;;
;;
service-initd|service-update
)
service-initd|service-update
)
sudocmd
/etc/init.d
/
$SERVICE
start
"
$@
"
sudocmd
$INITDIR
/
$SERVICE
start
"
$@
"
;;
;;
systemd
)
systemd
)
sudocmd systemctl start
"
$SERVICE
"
"
$@
"
sudocmd systemctl start
"
$SERVICE
"
"
$@
"
...
...
bin/serv-status
View file @
08dfd7d2
...
@@ -25,7 +25,7 @@ is_service_running()
...
@@ -25,7 +25,7 @@ is_service_running()
$SUDO
service
$1
status
>
/dev/null
$SUDO
service
$1
status
>
/dev/null
;;
;;
service-initd|service-update
)
service-initd|service-update
)
$SUDO
/etc/init.d
/
$1
status
>
/dev/null
$SUDO
$INITDIR
/
$1
status
>
/dev/null
;;
;;
systemd
)
systemd
)
$SUDO
systemctl status
$1
>
/dev/null
$SUDO
systemctl status
$1
>
/dev/null
...
@@ -67,7 +67,7 @@ serv_status()
...
@@ -67,7 +67,7 @@ serv_status()
sudocmd service
$SERVICE
status
"
$@
"
sudocmd service
$SERVICE
status
"
$@
"
;;
;;
service-update
)
service-update
)
sudocmd
/etc/init.d
/
$SERVICE
status
"
$@
"
sudocmd
$INITDIR
/
$SERVICE
status
"
$@
"
;;
;;
systemd
)
systemd
)
sudocmd systemctl status
$SERVICE
"
$@
"
sudocmd systemctl status
$SERVICE
"
$@
"
...
...
bin/serv-stop
View file @
08dfd7d2
...
@@ -28,7 +28,7 @@ serv_stop()
...
@@ -28,7 +28,7 @@ serv_stop()
sudocmd service
$SERVICE
stop
"
$@
"
sudocmd service
$SERVICE
stop
"
$@
"
;;
;;
service-initd|service-update
)
service-initd|service-update
)
sudocmd
/etc/init.d
/
$SERVICE
stop
"
$@
"
sudocmd
$INITDIR
/
$SERVICE
stop
"
$@
"
;;
;;
systemd
)
systemd
)
sudocmd systemctl stop
$SERVICE
"
$@
"
sudocmd systemctl stop
$SERVICE
"
$@
"
...
...
bin/serv-try_restart
View file @
08dfd7d2
...
@@ -32,7 +32,7 @@ serv_try_restart()
...
@@ -32,7 +32,7 @@ serv_try_restart()
;;
;;
service-initd|service-update
)
service-initd|service-update
)
is_service_running
$SERVICE
||
return
0
is_service_running
$SERVICE
||
return
0
sudocmd
/etc/init.d
/
$SERVICE
restart
"
$@
"
sudocmd
$INITDIR
/
$SERVICE
restart
"
$@
"
;;
;;
systemd
)
systemd
)
sudocmd systemctl try-restart
$SERVICE
"
$@
"
sudocmd systemctl try-restart
$SERVICE
"
$@
"
...
...
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