Launch a toolbox with systemd

I installed Apache in a toolbox. What’s the best way to launch it at boot time?

I can write my own apache.service on the host, but is there a way to use whatever the package provides?

There is no systemd instance running in a toolbox. If you want to launch user level services via containers, I’d recommend you use podman rootless containers.

2 Likes

I agree with @siosm. Use a rootless Podman container to deploy Apache. It will have you create a volume for it for your site, so if you’re developing a website you just do it in the volume directory. As for your original question: once you have the container running you can have Podman create a systemd unit for you with podman generate systemd -f -n <container / pod name>. Then you just copy that file into ${HOME}/.local/share/systemd/user/, run systemctl --user daemon-reload, followed by systemctl --user enable <container / pod name>.service --now and your Apache container will start at boot every time.

1 Like