Skip to content

wantedBy not working when used from upstream systemd units #81138

@worldofpeace

Description

@worldofpeace

Describe the bug
I've noticed on several occasions, and again with a PR #81087 which has a unit

# tlp - systemd startup/shutdown service
#
# Copyright (c) 2020 Thomas Koch <linrunner at gmx.net> and others.
# This software is licensed under the GPL v2 or later.

[Unit]
Description=TLP system startup/shutdown
After=multi-user.target NetworkManager.service
Before=shutdown.target
Documentation=https://linrunner.de/tlp

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/nix/store/42m41jbsvbc7qh25k42cdc5jf2yjsf87-tlp-1.3.1/sbin/tlp init start
ExecStop=/nix/store/42m41jbsvbc7qh25k42cdc5jf2yjsf87-tlp-1.3.1/sbin/tlp init stop

[Install]
WantedBy=multi-user.target

The wantedBy didn't do anything when it was included with systemd.packages.

We had to add it manually like:

systemd.services.tlp.wantedBy =  [ "multi-user.target" ];

Looking at nixpkgs, it seems like others have noticed this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: systemdSoftware suite that provides an array of system components for Linux operating systems.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions