Skip to content

rc-status --user fails to display Emacs user service added to default runlevel, when executed in Emacs shell #808

@linsein

Description

@linsein

I've configured an Emacs daemon to start as an OpenRC user service and added it to the default runlevel.
However, when I open a shell within an Emacs client and execute rc-status --user, the Emacs service is not listed in the output.
This behavior is observed exclusively when the service is included in the default runlevel.

Initial discussion: https://snac.lin.moe/lindsay/p/1740969003.750311

Related files

$XDG_CONFIG_HOME/zsh/.zprofile:

# load only user interactive login
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]] && [[ -x "$(command -v sway)" ]]; then
  if [ -d "$XDG_CONFIG_HOME/rc" ]; then
    openrc --user default
  fi

  if [[ -S $XDG_RUNTIME_DIR/bus ]]; then
    export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
    exec sway
  else
    exec dbus-run-session -- sway
  fi
fi

$XDG_CONFIG_HOME/rc/init.d/emacs:

#!/sbin/openrc-run

name="Emacs daemon"
command="/usr/bin/emacs"
command_args="--fg-daemon"

command_background="yes"

pidfile="$XDG_RUNTIME_DIR/${SVCNAME}.pid"

$XDG_RUNTIME_DIR/openrc/deptree

depinfo_0_service='emacs'
depinfo_1_service='dbus'

How to reproduct

  1. Start the emacs user service
  2. Start an emacs client: emacsclient -c -a ""
  3. Open eshell: M-x eshell <Enter> (or Alt+x eshell <Enter>)
  4. Run:rc-status --user
    Expected: Emacs service listed in the manual runlevel.
  5. Run command rc-update --user add emacs default && rc-status --user
    Expected: Emacs service disappears from the output.

Metadata

Metadata

Assignees

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