Felipe Jhony Felipe Jhony - 2 months ago 6
Linux Question

How to make a systemctl unit (or service) start with system (on boot)

I have these options on my .service file:

Description=Atualizador de Sincronizacao


but it does not start with the system (like sshd does, for instance) so I need to run a "systemctl start" command every time.

What option do I need to add in this unit so it starts with the system?


Required the [Install] section on this unit where I added a WantedBy=multi-user.target so the service would start when the system starts.

Finally I had to enable the unit with the command that Marshall Whittaker gave me:

systemctl enable myservice.service