openRC user services

Mark Hindley mark at hindley.org.uk
Tue Apr 1 09:12:13 BST 2025


Matthias

On Mon, Mar 31, 2025 at 10:56:22PM +0200, Matthias Geiger wrote:
> as you might know, openRC 0.68 gained support for user services.

Just for correctness, it was 0.60; 0.61 is packaged in experimental.

> This is a huge improvement IMO, and I would like to get wider adoption of
> openRC. Because this is fairly new, not much services have been written. An
> example can be seen here: [0]
> I'd plan to collect of list of user services and then test them under Debian
> with openRC. I'm unsure where to get them included. Most upstreams likely
> won't accept MRs for this :( .

I agree this would be an uphill struggle.  My personal opinion is that
maintaining scripts in a separate package would also be a complete PITA.

The solution I envisage is to generate openrc scripts from the unit files with
src:utrans. I added initial user script support to my local git yesterday!

The generated scripts are not always identical or quite as clean as a
handcrafted one[1], but in general they are functional. The only one I know
doesn't work is /usr/lib/systemd/user/dbus.service as it uses a systemd-specific
address.

But smcv is always very reasonable and I think it strengthens the argument to
ship an openrc user file in src:bus if the generated one is broken (just as
src:dbus still includes an LSB initscript).

Mark

> Links:
> 
> [0]: https://git.alpinelinux.org/aports/tree/community/pipewire/pipewire.initd

[1]  See the attached generated pipewire script for comparison

-------------- next part --------------
#!/sbin/openrc-run
# Generated by src/debian/unit-translator/utrans from:
#  f98e117d23c79c180da20d8faec304479a2921861ea1f1469e56b09987f890d0  /usr/lib/systemd/user/pipewire.socket
#  e312515933755466d46f47211ab9888cb76dd1af346c8e02a5be66c39dd5f3cf  /usr/lib/systemd/user/pipewire.service

description="PipeWire Multimedia Service."

supervisor="supervise-daemon"
command="/usr/bin/socket-activate"
command_args="--unix::${XDG_RUNTIME_DIR:-/run}/pipewire-0 -- /usr/bin/pipewire"
start_stop_daemon_args="--no-new-privs"
start_pre() {
  : # WARNING: skipped unsupported ConditionUser !root
}


More information about the Debian-init-diversity mailing list