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 #573

Closed
wants to merge 37 commits into from
Closed

User Services #573

wants to merge 37 commits into from

Commits on Jul 19, 2024

  1. openrc: dynamic paths for user services

    add two api functions, `rc_service_dir` and `rc_sysconf_dir`, both are
    generate paths (and sub-paths) for resources, and meant to replace the
    hardcoded variables like `RC_SVCDIR`.
    
    those functions differ by dynamically switching between the system path,
    or the user path, set in their home folder or runtime directory.
    
    this lays out the intial support for user services.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    c34fcd6 View commit details
    Browse the repository at this point in the history
  2. openrc-user: init script for users

    adds a new multiplexed script for starting user sessions. it also sets
    up XDG_RUNTIME_DIR.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    fd961d2 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2024

  1. openrc-pam: auto-launch user services via pam

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    ad169aa View commit details
    Browse the repository at this point in the history
  2. openrc-run: allow multiplexed symlinks to live outside init.d

    use the realpath of the target to locate which sysconf dir it's in,
    using it as a base to load the config file. the service path is then
    normalized from the symlink without dereferencing it.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    f03a640 View commit details
    Browse the repository at this point in the history
  3. librc/librc-depend.c: small refactor

    some changes for code redability, and fixing leaking the whole internals
    of the deptree at the end of rc_deptree_update.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    18be0d7 View commit details
    Browse the repository at this point in the history
  4. librc, openrc-pam: instantiate user.<username> service automatically

    it's created in /run/openrc/dynamic and linked to the service in /etc at
    login.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    c3ccaee View commit details
    Browse the repository at this point in the history
  5. librc-misc.c, rc.c, rc-status.c: fix memory leaks

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    f4d7946 View commit details
    Browse the repository at this point in the history
  6. libeinfo.c: add foot

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    a8dd10c View commit details
    Browse the repository at this point in the history
  7. openrc/rc-logger.c: set log path for user dynamically

    since it's not possible to differentiate the option set from an user
    configuration file versus the system wide, for user-mode openrc, use
    XDG_STATE_DIR (~/.local/state) unconditionally for now.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    5caae0d View commit details
    Browse the repository at this point in the history
  8. openrc-pam: use 'shared_module' for pam_openrc

    fixes the undefined reference build failure on freebsd, allowing the
    module to build while referencing 'environ' in misc.c.
    
    it also is the more correct meson function for pam modules.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    a9a26fe View commit details
    Browse the repository at this point in the history
  9. openrc-shutdown: simplify broadcast function

    Get rid of the alarm/setjmp/longjmp.
    Trust that the kernel will not block with O_NDELAY.
    Use write() instead of stdio.
    
    Bug: https://bugs.gentoo.org/923326
    Signed-off-by: Mike Gilbert <[email protected]>
    floppym authored and navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    3586a89 View commit details
    Browse the repository at this point in the history
  10. Generate pkg-config files directly

    - Remove 'pkgconfig' subdir
    - use meson 'pkgconfig' module to generate and install appropriate
      .pc files when required.
    - add `rc_path` variable to installed pkgconfig files
    
    Signed-off-by: Matt Jolly <[email protected]>
    Kangie authored and navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    1485cfb View commit details
    Browse the repository at this point in the history
  11. shared/plugin.c: fix incompatible function warning.

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    15de84d View commit details
    Browse the repository at this point in the history
  12. start-stop-daemon: open syslog

    The stop schedule code calls syslog, so we need to open a syslog
    connection so the process name will get properly logged on musl, and we
    can ensure the pid gets logged and the right facility is used.
    dwfreed authored and navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    e46a163 View commit details
    Browse the repository at this point in the history
  13. openrc-run.c: allow --user on shebangs

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    26314e9 View commit details
    Browse the repository at this point in the history
  14. support: add user.d examples

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    9432319 View commit details
    Browse the repository at this point in the history
  15. user-guide.md add user-services documentation

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    df50d89 View commit details
    Browse the repository at this point in the history
  16. librc.c: use rc_runlevel_dir for rc_service_add

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    e849ef3 View commit details
    Browse the repository at this point in the history
  17. openrc-pam: fix session count logic

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    9cde77f View commit details
    Browse the repository at this point in the history
  18. openrc-pam: do not start a login shell

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    d5ebe7c View commit details
    Browse the repository at this point in the history
  19. openrc-pam: add logging

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    e29e284 View commit details
    Browse the repository at this point in the history
  20. openrc-pam: use full path to mark the service

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    0fb6b73 View commit details
    Browse the repository at this point in the history
  21. librc.c: return "none" from rc_runlevel_get when in user mode.

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    6b0d03e View commit details
    Browse the repository at this point in the history
  22. version 0.60-beta

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 20, 2024
    Configuration menu
    Copy the full SHA
    7de84f2 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2024

  1. meson.build: restore pkg-config filename to openrc.pc

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    99a5507 View commit details
    Browse the repository at this point in the history
  2. openrc-run: fix check for argument count

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    980bfe6 View commit details
    Browse the repository at this point in the history
  3. version 0.60-beta2

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    255138d View commit details
    Browse the repository at this point in the history
  4. user_init.c: use a single argument for -c

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    0dcc569 View commit details
    Browse the repository at this point in the history
  5. user_init.c: set HOME

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    12b194b View commit details
    Browse the repository at this point in the history
  6. user_init.c: set SHELL

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    8e25129 View commit details
    Browse the repository at this point in the history
  7. user-init.sh: print message on error

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    dce704d View commit details
    Browse the repository at this point in the history
  8. rc.c: remove superuser error message

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    232c398 View commit details
    Browse the repository at this point in the history
  9. version 0.60-beta3

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    fdb1d0d View commit details
    Browse the repository at this point in the history
  10. 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.
    
    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    53de57e View commit details
    Browse the repository at this point in the history
  11. rc-logger.c: fix log path for user-mode

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    6221248 View commit details
    Browse the repository at this point in the history
  12. update readme

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 21, 2024
    Configuration menu
    Copy the full SHA
    056f6df View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. user-init.c: redirect stdin to /dev/null and start a login shell

    Signed-off-by: Anna (navi) Figueiredo Gomes <[email protected]>
    navi-desu committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    114bf66 View commit details
    Browse the repository at this point in the history