Skip to content

Commit

Permalink
docs: Add basic user-services documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
navi-desu committed Nov 2, 2024
1 parent aa90ecd commit 3bc175b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions service-script-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
18 changes: 18 additions & 0 deletions user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.d/init.d, and
${XDG_CONFIG_HOME}/openrc/init.d with ~/.config should XDG_CONFIG_HOME be unset.

Configurations in ~/.config/openrc/conf.d should overwrite /etc/user.d/conf.d,
and similarly options set in ~/.config/openrc/rc.conf overrides /etc/rc.conf.

Runlevels are kept in ~/.config/openrc/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.

0 comments on commit 3bc175b

Please sign in to comment.