Skip to content

Commit 3c487eb

Browse files
committed
docs: Add basic user-services documentation.
1 parent 57c65d3 commit 3c487eb

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

service-script-guide.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,9 @@ This is a sensible default for daemons that are happy with `0.0.0.0`,
509509
but lets the user specify something else, like `rc_need="net.wan"` if
510510
he needs it. The burden is on the user to determine the appropriate
511511
service whenever he changes the daemon's configuration file.
512+
513+
# User services
514+
515+
User services are ran as the user that starts them. A few things to note
516+
then, are that command_user shouldn't be set, runtime data (such as pidfiles
517+
and sockets) should be placed in XDG_RUNTIME_DIR.

user-guide.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,21 @@ OpenRC has wrappers for many common output tasks in libeinfo.
176176
This allows to print colour-coded status notices and other things.
177177
To make the output consistent the bundled service scripts all use ebegin/eend to
178178
print nice messages.
179+
180+
# User services
181+
182+
OpenRC supports managing services for users.
183+
184+
The init scripts are loaded from /etc/user/init.d, and
185+
${XDG_CONFIG_HOME}/rc/init.d with ~/.config should XDG_CONFIG_HOME be unset.
186+
187+
Configurations in ~/.config/rc/conf.d should overwrite /etc/user/conf.d,
188+
and similarly options set in ~/.config/rc/rc.conf overrides /etc/rc.conf.
189+
190+
Runlevels are kept in ~/.config/rc/runlevels.
191+
192+
`openrc` and all `rc-*` tools provie a --user/-U flag to operate with user-mode
193+
services and runlevels.
194+
195+
The XDG_RUNTIME_DIR variable must be set before calling openrc --user, as it's
196+
used to store state for openrc itself and the services it runs.

0 commit comments

Comments
 (0)