User:Librecat/OpenRC User Services(from alpine linux)

From Gentoo Wiki
Jump to:navigation Jump to:search

User services

From https://wiki.alpinelinux.org/wiki/OpenRC#User_services:

OpenRC supports managing services for users. The XDG_RUNTIME_DIR variable must be set before calling Template:Codeline, as it's used to store state for openrc itself and the services it runs.

For many wayland user services, a custom GUI runlevel needs to be created. The below example shows how this is done for Template:Pkg package. wlsunset provides an OpenRC user services. In order to use this service, the following steps need to be performed:

In order to create this runlevel,run the following commands:

user $$ mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/rc/runlevels/gui $ rc-update --user --stack add default gui

Enable the wlsunset service by adding it to this runlevel:

user $$ rc-update add -U wlsunset gui

Next, allow propagation of the WAYLAND_DISPLAY environment variable by adding the following lines to file ${XDG_CONFIG_HOME:-$HOME/.config}/rc/rc.conf as follows:Template:Cat

Finally, make sure to start services from the GUI runlevel from your Wayland compositor in its configuration file (i.e. after WAYLAND_DISPLAY is set) by adding the following lines to the startup file of your compositor. openrc --user gui