1.软文推荐

2.软文推荐

3.软文推荐

Alpine Linux使用的是Gentoo一样的OpenRCinit系统.使用”rc-update”、”rc-status”、”rc-service”、”openrc”等命令可用于管理init系统

rc-update

rc-update主要用于不同运行级增加或者删除服务。

rc-update语法格式

Usage: rc-update [options] add [...]
or: rc-update [options] del [...]
or: rc-update [options] [show [...]]

Options: [ asuChqVv ]
-a, --all Process all runlevels
-s, --stack Stack a runlevel instead of a service
-u, --update Force an update of the dependency tree
-h, --help Display this help outputrc-status

-C, --nocolor Disable color output
-V, --version Display software version
-v, --verbose Run verbosely
-q, --quiet Run quietly (repeat to suppress errors)

使用实例

$ rc-update add docker boot #增加一个服务
$ rc-update del docker boot #删除一个服务
rc-status

rc-status 主要用于运行级的状态管理。

rc-status语法格式

Usage: rc-status [options] ...
or: rc-status [options] [-a | -c | -l | -r | -s | -u]

Options: [ aclrsuChqVv ]
-a, --all Show services from all run levels
-c, --crashed Show crashed services
-l, --list Show list of run levels
-r, --runlevel Show the name of the current runlevel
-s, --servicelist Show service list
-u, --unused Show services not assigned to any runlevel
-h, --help Display this help output
-C, --nocolor Disable color output
-V, --version Display software version
-v, --verbose Run verbosely
-q, --quiet Run quietly (repeat to suppress errors)

使用实例

$ rc-status #检查默认运行级别的状态
$ rc-status -a #检查所有运行级别的状态
rc-service

rc-service主用于管理服务的状态

rc-service语法格式

Usage: rc-service [options] [-i] ...
or: rc-service [options] -e
or: rc-service [options] -l
or: rc-service [options] -r

Options: [ e:ilr:INChqVv ]
-e, --exists tests if the service exists or not
-i, --ifexists if the service exists then run the command
-I, --ifinactive if the service is inactive then run the command
-N, --ifnotstarted if the service is not started then run the command
-l, --list list all available services
-r, --resolve resolve the service name to an init script
-h, --help Display this help output
-C, --nocolor Disable color output
-V, --version Display software version
-v, --verbose Run verbosely
-q, --quiet Run quietly (repeat to suppress errors)

使用实例

$ rc-service sshd start #启动一个服务。
$ rc-service sshd stop #停止一个服务。
$ rc-service sshd restart #重启一个服务。
openrc

openrc主要用于管理不同的运行级。

openrc语法格式

Usage: openrc [options] []

Options: [ a:no:s:SChqVv ]
-n, --no-stop do not stop any services
-o, --override override the next runlevel to change into
when leaving single user or boot runlevels
-s, --service runs the service specified with the rest
of the arguments
-S, --sys output the RC system typeif any
-h, --help Display this help output
-C, --nocolor Disable color output
-V, --version Display software version
-v, --verbose Run verbosely
-q, --quiet Run quietly (repeat to suppress errors)
Alpine Linux可用的运行级
default
sysinit
boot
single
reboot
shutdown

使用实例

$ openrc single #更改为single运行级
其它指令
$ reboot #重启系统,类似于shutdown -r now。
$ halt #关机,类似于shutdown -h now。
$ poweroff #关机

本文来源:www.lxlinux.net/7652.html,若引用不当,请联系修改。

相关文章 8

1

详解Linux分区方案 3分钟前

设备管理在 Linux 中,每一个硬件设备都映射到一个系统的文件,对于硬盘、光驱等,IDE 或 SCSI 设备也不例外,本篇文章重点为大家分享一下...

2

digital-vm:日本、新加坡、美国等8机房vps,10G带宽,不限流量,低至$4/月,独立服务器低至$8 3分钟前

digital-vm怎么样? digital-vm,这家注册在罗马尼亚的公司在国内应该有不少人比较熟悉了,主要提供VPS业务,最高10Gbps带宽,还不限制流量,...

3

docker镜像容器仓库得关系(docker镜像容器仓库关系) 5分钟前

docker镜像容器仓库得关系是什么?docker提供的是一种容器化搬运软件或程序等的过程。在docker的核心概念中,包含容器、镜像和仓库,下面...

4

你知道.gov域名表示的是什么?(gov域名的网站有哪些) 6分钟前

gov域名表示的是什么?据查询了解,gov是英文government政府、内阁;、政体、 国家体制的缩写,因此gov域名代表的一般就是政府机构域名。“...

5

Mac OS中使用Homebrew安装 Docker 8分钟前

macOS 如何安装 Docker?本篇文章将使用Homebrew为大家讲解一下macOS安装 Docker具体方法,Homebrew 是最简单和灵活的方式,常用来在 Mac OS X 安装...

6

千牛挂在服务器上会封店吗?看我淘宝店铺被封7天如何起死回生(千牛挂服务器怎么打单 11分钟前

千牛挂在服务器上会封店吗? 一般挂千牛不会被封的,违反淘宝规则才会被封。这个您不需要担心,用服务器是节省了很多成本。但是要在...

7

CenterHop:新加坡vps,$1/月/768MB内存/15GB空间/1TB流量/100Mbps端口/KVM(新加坡central) 12分钟前

centerhop,正规注册公司(Reg No. 201626159R),主要提供VPS,有新加坡数据中心等。现在VPS价格进行了调整,性价比高了不少,从路由看,电信绕香...

8

新余云服务器_新余云主机/易探云免备案vps主机租用 15分钟前

新余云服务器( 新余云主机 )真正的云计算架构云服务器,配备纯SSD架构打造的高性能存储,旨在为新余企业和个人用户提供优质、高效、弹...