OpenRC: Difference between revisions
mNo edit summary |
(Added extra commands to quick-start and added detailed runlevel information) |
||
Line 6: | Line 6: | ||
* <code>rc-update add service <runlevel></code> | * <code>rc-update add service <runlevel></code> | ||
* <code>rc-update del service <runlevel></code> | * <code>rc-update del service <runlevel></code> | ||
* <code>rc-status</code> | * <code>rc-service <service> <start | stop | restart></code><br />''(Equivalent to <code>/etc/init.d/service <start | stop | restart></code>)'' | ||
* <code>rc-status</code><br />''(To check services and their set runlevels)'' | |||
* <code>rc <runlevel></code><br />''(To change to a different runlevel)'' | |||
{{Tip|Prior to Alpine Linux 2.0, you might need to use the following commands instead: ''rc_add, rc_delete,'' and ''rc_status''.}} | {{Tip|Prior to Alpine Linux 2.0, you might need to use the following commands instead: ''rc_add, rc_delete,'' and ''rc_status''.}} | ||
== Available Runlevels == | |||
The available runlevels are: | |||
* <code>'''''default'''''</code> - Used if no runlevel is specified. (This is generally the runlevel you want to add services to.) | |||
* <code>'''''hotplugged'''''</code> | |||
* <code>'''''needed'''''</code> | |||
* <code>'''''manual'''''</code> | |||
The special runlevels are: | |||
* <code>'''''sysinit'''''</code> - Brings up any system specific stuff such as <code>/dev</code>, <code>/proc</code> and optionally <code>/sys</code> for Linux based systems. It also mounts <code>/lib/rc/init.d</code> as a ramdisk using tmpfs where available unless <code>/</code> is mounted rw at boot. <code>'''rc'''</code> uses <code>/lib/rc/init.d</code> to hold state information about the services it runs. sysinit always runs when the host first starts and should not be run again. | |||
* <code>'''''boot'''''</code> - Generally the only services you should add to the boot runlevel are those which deal with the mounting of filesystems, set the initial state of attached peripherals and logging. Hotplugged services are added to the boot runlevel by the system. All services in the boot and sysinit runlevels are automatically included in all other runlevels except for those listed here. | |||
* <code>'''''single'''''</code> - Stops all services except for those in the sysinit runlevel. | |||
* <code>'''''reboot'''''</code> - Changes to the shutdown runlevel and then reboots the host. | |||
* <code>'''''shutdown'''''</code> - Changes to the shutdown runlevel and then halts the host. | |||
== rc-update usage == | == rc-update usage == |
Revision as of 17:59, 14 August 2010
Alpine Linux Init System
Alpine Linux uses OpenRC for its init system.
Quick-Start Information
Alpine Linux has the following commands for managing services:
rc-update add service <runlevel>
rc-update del service <runlevel>
rc-service <service> <start | stop | restart>
(Equivalent to/etc/init.d/service <start | stop | restart>
)rc-status
(To check services and their set runlevels)rc <runlevel>
(To change to a different runlevel)
Tip: Prior to Alpine Linux 2.0, you might need to use the following commands instead: rc_add, rc_delete, and rc_status.
Available Runlevels
The available runlevels are:
default
- Used if no runlevel is specified. (This is generally the runlevel you want to add services to.)hotplugged
needed
manual
The special runlevels are:
sysinit
- Brings up any system specific stuff such as/dev
,/proc
and optionally/sys
for Linux based systems. It also mounts/lib/rc/init.d
as a ramdisk using tmpfs where available unless/
is mounted rw at boot.rc
uses/lib/rc/init.d
to hold state information about the services it runs. sysinit always runs when the host first starts and should not be run again.boot
- Generally the only services you should add to the boot runlevel are those which deal with the mounting of filesystems, set the initial state of attached peripherals and logging. Hotplugged services are added to the boot runlevel by the system. All services in the boot and sysinit runlevels are automatically included in all other runlevels except for those listed here.single
- Stops all services except for those in the sysinit runlevel.reboot
- Changes to the shutdown runlevel and then reboots the host.shutdown
- Changes to the shutdown runlevel and then halts the host.
rc-update usage
Usage: rc-update [options] add service <runlevel> rc-update [options] del service <runlevel> rc-update [options] show Options: [suChqv] -s, --stack Stack a runlevel instead of a service -u, --update Force an update of the dependency tree -h, --help Display this help output -C, --nocolor Disable color output -v, --verbose Run verbosely -q, --quiet Run quietly
rc-status usage
Usage: rc-status [options] [runlevel1] [runlevel2] ... Options: [aclrsuChqv] -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, --verbose Run verbosely -q, --quiet Run quietly