Skip to content

Systemctl with user flag don't work #375

@aikooo7

Description

@aikooo7

Bug description

Using any commands of systemctl with the --user flag like systemctl list-unit-files --user --state=enabled with systemd native support activate gives the error: Failed to connect to bus: No such file or directory

To Reproduce

Steps to reproduce the behavior:

  1. Activate native systemd adding wsl.nativeSystemd = true; to /etc/nixos/configuration.nix
  2. Run systemctl list-unit-files --user --state=enabled

Expected behavior

The command execute without errors.

In the example command it should display all units.

Logs

Similar to #165 doing systemctl list-unit-files --user --state=enabled with native systemd support turned off works perfectly:

UNIT FILE                STATE   PRESET
emacs.service            enabled enabled
nixos-activation.service enabled enabled
dbus.socket              enabled enabled
gpg-agent-ssh.socket     enabled enabled
gpg-agent.socket         enabled enabled

5 unit files listed.

While with native systemd support turned off errors:

Failed to connect to bus: No such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions