I have some systemd units installed and running. Let's say I manually uninstall
- removing its .service (and .socket) files
- removing all symlinks (e.g from default.target.wants/)
I can run
systemctl daemon-reload, and then I see:
# systemctl status foo.service foo.service Loaded: error (Reason: No such file or directory) Active: active (running) since Mon 2013-07-08 13:50:29 EST; 48s ago Main PID: 1642 (node)
So systemd knows that it's not installed, and that it is running. Is there some command I can use to stop all running services which no longer have a unit file?
Things I've already considered:
systemctl isolate <current-target>
This would have the side effect of stopping other manually-started services that aren't required by the current target.
systemctl disableinstead of manually removing files
I'd like to, but this script may be run from a host machine with access to the file system of a running container - it can't call
systemctl stop foo.service
This implies I know which services have been uninstalled. I don't want to have to figure this out (or remember it), I want a general command that can be run at any time to stop any lingering services.