#服务 #sv #runit #重写 #命令 #systemd #sudo

app rsv

使用Rust重写的runit sv命令,增加了新功能

5个稳定版本

1.3.3 2020年12月5日
1.3.2 2020年12月1日
1.3.1 2020年10月19日
1.1.0 2020年10月19日

#643Unix API

GPL-3.0 许可证

34KB
893

rsv

使用Rust重写的runit sv命令,具有一些新的好功能。

附加功能

  • 启用/禁用服务(自动创建符号链接)
  • Bash自动完成
  • 列出服务
  • 自定义超时
  • 比原始sv命令更简洁的代码
  • 以用户身份运行时自动使用sudo(功能:auto_sudo。默认使用)

安装

从我 pacman仓库

(添加仓库的方式如描述所示)
pacman -S rsv

AUR

yay -S rsv(其他AUR辅助工具也可以)

crates.io

cargoinstall rsv

从git

git clone https://github.com/JojiiOfficial/rsv
cd rsv
cargo build --release

用法

rsv 1.1.0
Jojii S
A tool to maintain runit services like systemd services

USAGE:
    rsv [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -v, --verbose    
    -V, --version    Prints version information

OPTIONS:
    -t, --timeout <timeout>    

SUBCOMMANDS:
    list         List services
    enable       Enable a service
    disable      Disable a service
    start        Start a service
    stop         Stop a service
    restart      Restart a service
    kill         Send SIGKILL if the service is running
    pause        Send SIGSTOP if the service is running
    continue     Send SIGCONT if the service is running
    alarm        Send SIGALARM if the service is running
    help         Prints this message or the help of the given subcommand(s)
    hup          Send SIGHUP if the service is running
    interrupt    Send SIGINT if the service is running
    once         Start if service is not running. Do not restart if it stops
    status       Get the status of a service
    term         Send SIGTERM if the service is running

示例

sudo rsv list --disabled/--enabled # list all disabled/enabled services 
sudo rsv list --enabled --down # list all enabled services which aren't running
sudo rsv enable cupsd # enabled cupsd
sudo rsv start cupsd # start cupsd service (enable if service is disabled)

待办事项

  • 列出服务
  • Shell自动完成
  • 自动sudo

依赖

~3–4.5MB
~90K SLoC