You are not logged in.
I have a running wg-quick service. When I do a
systemctl status wg-quick@name-name.serviceit confirms that it's active. However when I do a
systemctl statusit does not include wg-quick in the listing. Why is that?
Offline
If you look carefully at the output of
systemctl status wg-quick@name-name.serviceyou'll notice that it says "Active: active (exited)" This is because the wg-quick@ service is a "oneshot" service meaning it just fires once and exits. You can see the contents of the service unit by running
systemctl cat wg-quick@name-name.servicewhere you can see something like this
...
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/wg-quick up %i
ExecStop=/usr/bin/wg-quick down %i
Environment=WG_ENDPOINT_RESOLUTION_RETRIES=infinityYou'll also notice that it has "RemainAfterExit=yes" and this will make it continue to show as active even though it has finished running. This is so that you can have other services start after wg-quick@ starts. You can read more about this is the man page.
The output of
systemctl statusis only showing running services.
Hopefully that helps!
Last edited by zaxmyth (2020-02-07 14:54:39)
Offline
systemctl statusis only showing running services.
It does not shows services, but cgroups and processes running in those cgroups. systemd creates a control group for each service which automatically disappears when the service has no running processes.
To get services and other units, give no option or use
systemctl list-unitsIf you want a representation of the dependency tree, then use
systemctl list-dependenciesLast edited by progandy (2020-02-07 15:24:50)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Thanks for your kind answers, @zaxmyth and @progandy
Offline
Please remember to mark your thread [SOLVED] (edit the title of your first post).
Offline