Skip to content

Starting User Services #901

@inferenceus

Description

@inferenceus

I have recently had a need for the approach of system services to replace what I have been using automatically-running scripts for while logged into an unprivileged user and have decided that OpenRC user services are ideal for my use case due to ease of starting, stopping, and restarting them, and having their statuses shown to me. Upon starting a user service, it fails to start and presents an error which states start-stop-daemon: initgroups (user, 1500), followed by start-stop-daemon: failed to start '/usr/bin/<program>'.

One of the programs I need to run as a service is Firefox, and it has to run in the foreground as a GUI application. The following is my user init script for Firefox, which is located within $XDG_CONFIG_HOME/rc/init.d/:

#!/sbin/openrc-run


SERVICE_USER="user"
SERVICE_GROUP="user"
SERVICE_HOME="/home/user"


command_user="${SERVICE_USER}:${SERVICE_GROUP}"
command="/usr/bin/firefox"
command_args="-P 'profile'"
command_background="no"
pidfile="${SERVICE_HOME}/.run/${RC_SVCNAME}.pid

The directories called in the init script have been verified to exist and have the correct permissions. My user's graphical environment is X11 and I have ensured that the $DISPLAY enviroment variable has been set.

Is there something I have failed to set in/add to the init script, or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions