diff --git a/service-script-guide.md b/service-script-guide.md index 68ee7a684..22fb561e7 100644 --- a/service-script-guide.md +++ b/service-script-guide.md @@ -509,3 +509,9 @@ This is a sensible default for daemons that are happy with `0.0.0.0`, but lets the user specify something else, like `rc_need="net.wan"` if he needs it. The burden is on the user to determine the appropriate service whenever he changes the daemon's configuration file. + +# User services + +User services are ran as the user that starts them. A few things to note +then, are that command_user shouldn't be set, runtime data (such as pidfiles +and sockets) should be placed in XDG_RUNTIME_DIR. diff --git a/user-guide.md b/user-guide.md index 8547b893b..8b182e210 100644 --- a/user-guide.md +++ b/user-guide.md @@ -176,3 +176,21 @@ OpenRC has wrappers for many common output tasks in libeinfo. This allows to print colour-coded status notices and other things. To make the output consistent the bundled service scripts all use ebegin/eend to print nice messages. + +# User services + +OpenRC supports managing services for users. + +The init scripts are loaded from /etc/user/init.d, and +${XDG_CONFIG_HOME}/rc/init.d with ~/.config should XDG_CONFIG_HOME be unset. + +Configurations in ~/.config/rc/conf.d should overwrite /etc/user/conf.d, +and similarly options set in ~/.config/rc/rc.conf overrides /etc/rc.conf. + +Runlevels are kept in ~/.config/rc/runlevels. + +`openrc` and all `rc-*` tools provie a --user/-U flag to operate with user-mode +services and runlevels. + +The XDG_RUNTIME_DIR variable must be set before calling openrc --user, as it's +used to store state for openrc itself and the services it runs.