I'm diving into "How Linux Works" and trying to get my head around systemd and Podman. I get that systemctl is used because it manages processes like a babysitter, restarting them if they fail. But here's my issue: when I start a Podman network using systemctl, I can see it's running, but when I try to stop it with systemctl, it doesn't actually stop. I'm specifically starting a service called demo-network and then attempting to stop bookme-network, yet the demo-network keeps running! Aren't we supposed to be able to manage this through systemctl? Shouldn't using podman network rm be considered a workaround rather than a solution?
3 Answers
I think there's a bit of a mix-up in what you're trying to do. You started demo-network but then tried to stop bookme-network. If you want to stop a specific network, make sure you're targeting the correct service. You can’t control demo-network if you're trying to stop something else!
You might just need to use sudo to get that to work. It should help, but remember the key benefit of Podman is running it as a regular user. But if you're dealing with system services, sometimes root access can make a difference!
True, but I'd prefer not to use sudo with Podman whenever possible. It just kinda goes against the grain of what Podman is.
Check if you have `NetworkDeleteOnStop=true` configured for your network service. If it’s set to false, stopping the podman service won't remove the network automatically. You can find this in the network's unit file under [Network]. Keep in mind, I haven't tested this functionality yet, but it might be what you're looking for!

Got it! I see where I messed up now. Just trying to get the hang of it all.