{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51375","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51375/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51375/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51375/events","html_url":"https://github.com/NixOS/nixpkgs/issues/51375","id":386539683,"node_id":"MDU6SXNzdWUzODY1Mzk2ODM=","number":51375,"title":"NetworkManager.service not found","user":{"login":"M-Gregoire","id":9469313,"node_id":"MDQ6VXNlcjk0NjkzMTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9469313?v=4","gravatar_id":"","url":"https://api.github.com/users/M-Gregoire","html_url":"https://github.com/M-Gregoire","followers_url":"https://api.github.com/users/M-Gregoire/followers","following_url":"https://api.github.com/users/M-Gregoire/following{/other_user}","gists_url":"https://api.github.com/users/M-Gregoire/gists{/gist_id}","starred_url":"https://api.github.com/users/M-Gregoire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M-Gregoire/subscriptions","organizations_url":"https://api.github.com/users/M-Gregoire/orgs","repos_url":"https://api.github.com/users/M-Gregoire/repos","events_url":"https://api.github.com/users/M-Gregoire/events{/privacy}","received_events_url":"https://api.github.com/users/M-Gregoire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-02T08:38:48Z","updated_at":"2018-12-02T11:58:43Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Issue description\r\n\r\nI've configured a `wireguard service` to wait for the network to be online with the following:\r\n```\r\nsystemd.services.wireguard-wg0.after = [ \"NetworkManager-wait-online.service\" ];\r\nsystemd.services.wireguard-wg0.requires = [ \"NetworkManager-wait-online.service\" ];\r\n```\r\nThis does work on startup but trying to restart the service gives an error about `NetworkManager.service` not being found.\r\n```\r\nsudo systemctl restart wireguard-wg0.service\r\nFailed to start wireguard-wg0.service: Unit NetworkManager.service not found.\r\n```\r\n\r\nI tried using `network-online.target` and while I don't get any error, `wireguard` starts before the network is ready.\r\n\r\n### Steps to reproduce\r\n\r\nHere is my related config:\r\n```\r\nnetworking.networkmanager.enable = true;\r\nnetworking.networkmanager.packages = [ pkgs.networkmanagerapplet  ];\r\nnetworking.networkmanager.dns = \"none\";\r\nnetworking.networkmanager.unmanaged = [ \"docker0\" ];\r\nnetworking.nameservers = [ \"<IP>\" ];\r\n\r\n# Wireguard service here\r\n\r\nsystemd.services.wireguard-wg0.after = [ \"NetworkManager-wait-online.service\" ];\r\nsystemd.services.wireguard-wg0.requires = [ \"NetworkManager-wait-online.service\" ];\r\n```\r\n\r\n## Technical details\r\n\r\n```\r\n - system: `\"x86_64-linux\"`\r\n - host os: `Linux 4.14.74, NixOS, 18.09pre-git (Jellyfish)`\r\n - multi-user?: `yes`\r\n - sandbox: `yes`\r\n - version: `nix-env (Nix) 2.1.1`\r\n - nixpkgs: `/nix/store/mz3dkrc21b6mrrzns44xrqjycm9nyq74-18.09.tar.gz`\r\n```\r\n\r\n## Additional info\r\n\r\nI don't understand why it's works on startup. Right after a reboot:\r\n```\r\nsystemctl status wireguard-wg0.service\r\n● wireguard-wg0.service - WireGuard Tunnel - wg0\r\n   Loaded: loaded (/nix/store/83mcrmx466p45aa8zmixkgakkqypjmn0-unit-wireguard-wg0.service/wireguard-wg0.service; enabled; vendor preset: enabled)\r\n   Active: active (exited) since Sun 2018-12-02 09:39:51 CET; 16s ago\r\n  Process: 1161 ExecStart=/nix/store/f8ibavimszr0czkf2p8qbs9pnqskzqr2-unit-script-wireguard-wg0-start (code=exited, status=0/SUCCESS)\r\n Main PID: 1161 (code=exited, status=0/SUCCESS)\r\n\r\nDec 02 09:39:51 Mimir systemd[1]: Starting WireGuard Tunnel - wg0...\r\nDec 02 09:39:51 Mimir systemd[1]: Started WireGuard Tunnel - wg0.\r\n```\r\nwhile It doesn't when trying to restart manually..."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/443502099","html_url":"https://github.com/NixOS/nixpkgs/issues/51375#issuecomment-443502099","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/51375","id":443502099,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzUwMjA5OQ==","user":{"login":"Mic92","id":96200,"node_id":"MDQ6VXNlcjk2MjAw","avatar_url":"https://avatars3.githubusercontent.com/u/96200?v=4","gravatar_id":"","url":"https://api.github.com/users/Mic92","html_url":"https://github.com/Mic92","followers_url":"https://api.github.com/users/Mic92/followers","following_url":"https://api.github.com/users/Mic92/following{/other_user}","gists_url":"https://api.github.com/users/Mic92/gists{/gist_id}","starred_url":"https://api.github.com/users/Mic92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mic92/subscriptions","organizations_url":"https://api.github.com/users/Mic92/orgs","repos_url":"https://api.github.com/users/Mic92/repos","events_url":"https://api.github.com/users/Mic92/events{/privacy}","received_events_url":"https://api.github.com/users/Mic92/received_events","type":"User","site_admin":false},"created_at":"2018-12-02T11:58:43Z","updated_at":"2018-12-02T11:58:43Z","author_association":"CONTRIBUTOR","body":"Because we are renaming `NetworkManager.service` to `network-manager.service` this\r\nnow breaks other units: \r\n\r\n```\r\nsystemctl cat NetworkManager-wait-online.service\r\n# /nix/store/l3kjl4rsbj184g9vj2703xp2milwh28k-network-manager-1.12.2/etc/systemd/system/NetworkManager-wait-online.service\r\n[Unit]\r\nDescription=Network Manager Wait Online\r\nDocumentation=man:nm-online(1)\r\nRequires=NetworkManager.service\r\nAfter=NetworkManager.service\r\nBefore=network-online.target\r\n\r\n[Service]\r\nType=oneshot\r\nExecStart=/nix/store/l3kjl4rsbj184g9vj2703xp2milwh28k-network-manager-1.12.2/bin/nm-online -s -q --timeout=30\r\nRemainAfterExit=yes\r\n\r\n[Install]\r\nWantedBy=network-online.target\r\n```\r\n\r\ncc @flokli "}}
{"actor":{"display_login":"Mic92"}}