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
cae4f10b
Commit
cae4f10b
authored
Aug 23, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
serv: add runit support (Void Linux)
parent
9691f56e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
2 deletions
+34
-2
serv
bin/serv
+3
-0
serv-common
bin/serv-common
+5
-2
serv-disable
bin/serv-disable
+3
-0
serv-enable
bin/serv-enable
+5
-0
serv-restart
bin/serv-restart
+3
-0
serv-start
bin/serv-start
+3
-0
serv-status
bin/serv-status
+9
-0
serv-stop
bin/serv-stop
+3
-0
No files found.
bin/serv
View file @
cae4f10b
...
@@ -76,6 +76,9 @@ case $DISTRNAME in
...
@@ -76,6 +76,9 @@ case $DISTRNAME in
Fedora|LinuxXP|ASPLinux|CentOS|RHEL|Scientific
)
Fedora|LinuxXP|ASPLinux|CentOS|RHEL|Scientific
)
CMD
=
"service-chkconfig"
CMD
=
"service-chkconfig"
;;
;;
VoidLinux
)
CMD
=
"runit"
;;
Slackware
)
Slackware
)
CMD
=
"service-initd"
CMD
=
"service-initd"
;;
;;
...
...
bin/serv-common
View file @
cae4f10b
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012
, 2016
Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012
, 2016
Vitaly Lipatov <lav@etersoft.ru>
#
#
# This program is free software: you can redistribute it and/or modify
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# it under the terms of the GNU Affero General Public License as published by
...
@@ -40,6 +40,9 @@ serv_common()
...
@@ -40,6 +40,9 @@ serv_common()
sudocmd systemctl
"
$@
"
$SERVICE
sudocmd systemctl
"
$@
"
$SERVICE
fi
fi
;;
;;
runit
)
sudocmd sv
$SERVICE
"
$@
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-disable
View file @
cae4f10b
...
@@ -42,6 +42,9 @@ serv_disable()
...
@@ -42,6 +42,9 @@ serv_disable()
systemd
)
systemd
)
sudocmd systemctl disable
$1
sudocmd systemctl disable
$1
;;
;;
runit
)
sudocmd
rm
-fv
/var/service/
$SERVICE
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-enable
View file @
cae4f10b
...
@@ -46,6 +46,11 @@ __serv_enable()
...
@@ -46,6 +46,11 @@ __serv_enable()
systemd
)
systemd
)
sudocmd systemctl
enable
$1
sudocmd systemctl
enable
$1
;;
;;
runit
)
assure_exists
$SERVICE
[
-r
"/etc/sv/
$SERVICE
"
]
||
fatal
"Can't find /etc/sv/
$SERVICE
"
sudocmd
ln
-s
/etc/sv/
$SERVICE
/var/service/
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-restart
View file @
cae4f10b
...
@@ -39,6 +39,9 @@ serv_restart()
...
@@ -39,6 +39,9 @@ serv_restart()
systemd
)
systemd
)
sudocmd systemctl restart
$SERVICE
"
$@
"
sudocmd systemctl restart
$SERVICE
"
$@
"
;;
;;
runit
)
sudocmd sv restart
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-start
View file @
cae4f10b
...
@@ -37,6 +37,9 @@ serv_start()
...
@@ -37,6 +37,9 @@ serv_start()
systemd
)
systemd
)
sudocmd systemctl start
"
$SERVICE
"
"
$@
"
sudocmd systemctl start
"
$SERVICE
"
"
$@
"
;;
;;
runit
)
sudocmd sv up
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-status
View file @
cae4f10b
...
@@ -36,6 +36,9 @@ is_service_running()
...
@@ -36,6 +36,9 @@ is_service_running()
systemd
)
systemd
)
$SUDO
systemctl status
$1
>
/dev/null
$SUDO
systemctl status
$1
>
/dev/null
;;
;;
runit
)
$SUDO
sv status
"
$SERVICE
"
>
/dev/null
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
@@ -63,6 +66,9 @@ is_service_autostart()
...
@@ -63,6 +66,9 @@ is_service_autostart()
systemd
)
systemd
)
$SUDO
systemctl is-enabled
$1
$SUDO
systemctl is-enabled
$1
;;
;;
runit
)
test
-L
/var/service/
$SERVICE
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
@@ -90,6 +96,9 @@ serv_status()
...
@@ -90,6 +96,9 @@ serv_status()
systemd
)
systemd
)
sudocmd systemctl status
$SERVICE
"
$@
"
sudocmd systemctl status
$SERVICE
"
$@
"
;;
;;
runit
)
sudocmd sv status
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable command for
$SERVICETYPE
"
;;
;;
...
...
bin/serv-stop
View file @
cae4f10b
...
@@ -37,6 +37,9 @@ serv_stop()
...
@@ -37,6 +37,9 @@ serv_stop()
systemd
)
systemd
)
sudocmd systemctl stop
$SERVICE
"
$@
"
sudocmd systemctl stop
$SERVICE
"
$@
"
;;
;;
runit
)
sudocmd sv down
"
$SERVICE
"
;;
*
)
*
)
fatal
"Have no suitable command for
$SERVICETYPE
"
fatal
"Have no suitable 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