When running
systemctl enable my-service
it gets correctly enabled (the link is created into the right WantedBy-target in /etc/systemd/system) but it is not started.
However, when rebooting the machine systemd starts the service.
What do I need to do to have systemd start the service when enabling the service?
For reference, here's my unit-file:
[Unit]
Description=WebSocket-server-application
[Service]
ExecStart=/usr/bin/ws-server.app
Restart=always
[Install]
WantedBy=multi-user.target
(A little bit of background: systemctl enable
is called during package-installation. I need to have the service started once the package has been installed.)
systemctl enable --now myservice
– Orsiris de Jong Apr 20 '21 at 10:32