Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
250654bfdb
|
|||
edbabda2df
|
|||
9d13a0576b
|
|||
27bcdec74f
|
|||
6815946574
|
|||
f4e12ec2e1
|
|||
533d0e6250
|
@@ -1,11 +1,10 @@
|
|||||||
# `rsm` - Runit Service Manager
|
# `rsm` - Runit Service Manager
|
||||||
===================================
|
|
||||||
|
|
||||||
- This is the CLI Runit Service Manager {rsm}, forked from Void Service Manager {vsv} https://github.com/bahamas10/vsv/blob/master/vsv
|
- This is the CLI Runit Service Manager {rsm}, forked from Void Service Manager {vsv} https://github.com/bahamas10/vsv/blob/master/vsv
|
||||||
|
|
||||||
- Terminal Commands are exactly the same as sv, but produces a beautified layout.
|
- Terminal Commands are exactly the same as sv, but produces a beautified layout.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Manage and view runit services.
|
## Manage and view runit services.
|
||||||
|
|
||||||
@@ -18,7 +17,7 @@ Quick Examples:
|
|||||||
- `rsm status` - same as above
|
- `rsm status` - same as above
|
||||||
- `rsm stop <svc>` - stop a service
|
- `rsm stop <svc>` - stop a service
|
||||||
- `rsm start <svc>` - start a service
|
- `rsm start <svc>` - start a service
|
||||||
- `rsm restart <svc>` - restart a service
|
- `rsm restart <svc>` - restart a service, or start service right after `rsm enable <svc>`
|
||||||
- `rsm enable <svc>` - enable a service (autostart at boot)
|
- `rsm enable <svc>` - enable a service (autostart at boot)
|
||||||
- `rsm disable <svc>` - disable a service (no autostart at boot)
|
- `rsm disable <svc>` - disable a service (no autostart at boot)
|
||||||
- `rsm hup <svc>` - refresh a service (`SIGHUP`)
|
- `rsm hup <svc>` - refresh a service (`SIGHUP`)
|
||||||
|
22
rsm
22
rsm
@@ -1,14 +1,19 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Void Linux service manager (runit)
|
# Artix Linux service manager (runit)
|
||||||
|
# Forked and further developed, by: linuxer <linuxer@artixlinux.org>
|
||||||
|
# Fork Date: August 15, 2020 as rsv
|
||||||
|
# Renamed and further developed as rsm from: January 10, 2021
|
||||||
#
|
#
|
||||||
# Author: Dave Eddy <dave@daveeddy.com>
|
# Original Author (vsv): Dave Eddy <dave@daveeddy.com>
|
||||||
# Date: August 29, 2018
|
# Date: August 29, 2018
|
||||||
# License: MIT
|
# License: MIT
|
||||||
|
|
||||||
RSM_VERSION='v1.3.7'
|
RSM_VERSION='v1.3.9'
|
||||||
|
|
||||||
export SVDIR=${SVDIR:-/run/runit/service/}
|
export SVDIR=${SVDIR:-/run/runit/service/}
|
||||||
|
export FLDIR=${FLDIR:-/etc/runit/sv/}
|
||||||
|
|
||||||
|
|
||||||
charup='✔'
|
charup='✔'
|
||||||
chardown='X'
|
chardown='X'
|
||||||
@@ -116,13 +121,14 @@ usage() {
|
|||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
$colormagenta ______ ____ __ __
|
$colormagenta ______ ____ __ __
|
||||||
$colormagenta | | \ \ / ___\ | \/ | $colorgreen Runit Service Manager ($RSM_VERSION)
|
$colormagenta | | \ \ / ___\ | \/ | $colorgreen Runit Service Manager for Artix Linux ($RSM_VERSION)
|
||||||
$colormagenta | |_/ / \____ | || | $colorgreen Source: https://gitea.artixlinux.org/linuxer/Runit-Service-Manager
|
$colormagenta | |_/ / \____ | || | $colorgreen Source: https://gitea.artixlinux.org/linuxer/Runit-Service-Manager
|
||||||
$colormagenta | | \ \ \____/ | || | $colorgreen MIT License
|
$colormagenta | | \ \ \____/ | || | $colorgreen MIT License
|
||||||
|
|
||||||
$logo $colorblue Manage and view runit services
|
$logo $colorblue Manage and view runit services
|
||||||
$logo $colorblue Made specifically for Void Linux but should work anywhere
|
$logo $colorblue Made specifically for Void Linux but should work anywhere
|
||||||
$logo $colorblue Author: Dave Eddy <dave@daveeddy.com> (bahamas10)
|
$logo $colorblue Author: Dave Eddy <dave@daveeddy.com> (bahamas10)
|
||||||
|
$logo $colorblue Forked specifically for Artix Linux and renamed to rsm, for further development
|
||||||
|
|
||||||
${coloryellow}USAGE:${colorgreen}
|
${coloryellow}USAGE:${colorgreen}
|
||||||
$progname [OPTIONS] [SUBCOMMAND] [<ARGS>]
|
$progname [OPTIONS] [SUBCOMMAND] [<ARGS>]
|
||||||
@@ -449,7 +455,7 @@ do_enable_disable() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ensure service exists
|
# ensure service exists
|
||||||
if ! [[ -d $svc ]]; then
|
if ! [[ -d ${FLDIR}${svc} ]]; then
|
||||||
rmsg -1 "service directory '$svc' does not exist" >&2
|
rmsg -1 "service directory '$svc' does not exist" >&2
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@@ -462,6 +468,8 @@ do_enable_disable() {
|
|||||||
if ! rm -f "$file"; then
|
if ! rm -f "$file"; then
|
||||||
rmsg 1 "failed to enable '$svc'"
|
rmsg 1 "failed to enable '$svc'"
|
||||||
ret=1
|
ret=1
|
||||||
|
else
|
||||||
|
ln -s ${FLDIR}${svc} ${SVDIR}
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
disable)
|
disable)
|
||||||
@@ -469,6 +477,8 @@ do_enable_disable() {
|
|||||||
if ! disable_message "$svc" > "$file"; then
|
if ! disable_message "$svc" > "$file"; then
|
||||||
rmsg 1 "failed to disable '$svc'"
|
rmsg 1 "failed to disable '$svc'"
|
||||||
ret=1
|
ret=1
|
||||||
|
else
|
||||||
|
unlink ${SVDIR}${svc}
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -500,7 +510,7 @@ colors_set=false
|
|||||||
tree=false
|
tree=false
|
||||||
log=false
|
log=false
|
||||||
do_usage=-1
|
do_usage=-1
|
||||||
verbosity=0
|
verbosity=1
|
||||||
while getopts 'c:d:hltuvV' option; do
|
while getopts 'c:d:hltuvV' option; do
|
||||||
case "$option" in
|
case "$option" in
|
||||||
c) setcolors "$OPTARG"; colors_set=true;;
|
c) setcolors "$OPTARG"; colors_set=true;;
|
||||||
|
Reference in New Issue
Block a user