Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Services 2.0 #723

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

User Services 2.0 #723

wants to merge 8 commits into from

Commits on Oct 26, 2024

  1. librc: Add support for user paths.

    Adds two functions to librc, rc_set_user() and rc_is_user(). The latter
    just queries if the former was called. The former instantiates paths for
    locations that make sense for user services:
    
    Script dirs get set to $XDG_CONFIG_HOME/openrc/{init.d,conf.d}, and
    variations of the system sysconf dirs with "user.d/" as a suffix.
    
    Runlevel dir is set to $XDG_CONFIG_HOME/openrc/runlevels, and the svcdir
    is set to $XDG_RUNTIME_DIR/openrc.
    
    XDG_CONFIG_HOME falls back to $HOME/.config should it be unset.
    XDG_RUNTIME_DIR has no fallback, and thus required for user services.
    navi-desu committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    2f74fe9 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2024

  1. librc: Overlay user configs.

    Add a new function to librc, `rc_usrconfdir()`, whick returns the
    location where user-made rc.conf exists.
    
    The user-made configuration is loaded first over the global config, so
    it takes priority when resolving variables, thus "overriding" global
    configs.
    navi-desu committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    db32766 View commit details
    Browse the repository at this point in the history
  2. openrc: Allow user-specific env vars.

    Those variables are required for user scripts to work properly.
    navi-desu committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    5a9ef6c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    74e9f17 View commit details
    Browse the repository at this point in the history
  4. openrc-run: Chdir into HOME for user services.

    Some services might expect to be in home, and may behave unexpectedly
    for the user, e.g. any program started via dbus, and this matches
    systemd-user behaviour.
    navi-desu committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    6d32d9d View commit details
    Browse the repository at this point in the history
  5. misc: Add --user/-U flag to common flags.

    Some binaries required to have their `atexit(cleanup)` calls moved to
    after argument parsing, since setting user mode also adds an atexit
    call, and cleaning up user paths should only happen after the cleanup of
    the application is done, thus needs to be set first.
    navi-desu committed Oct 28, 2024
    Configuration menu
    Copy the full SHA
    a896659 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2024

  1. openrc-run: Move argument parsing before env setup

    We need to handle --user before calling any functions that interact with
    librc.
    navi-desu committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    aa90ecd View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. Configuration menu
    Copy the full SHA
    3bc175b View commit details
    Browse the repository at this point in the history