I'm trying to load a script on boot in Ubuntu Server 18.04.
My .service script is installed in /etc/systemd/system, and I can
service my-service start
service my-service stop
but when I try to run at boot (which according to the web I should do) with
service my-service enable
the system responds with
my-service: unrecognised service
Searching the web only tells me how to do it in older versions of Ubuntu which do not apply to 18.04 and I am unable to determine the correct terminology to find the answer.
# filename: /etc/systemd/system/my-service.service [Unit] Description=My Service After=network.target After=mysqld.service [Service] User=the-user WorkingDirectory=/home/the-user/path-to-script ExecStart=/home/the-user/path-to-script/start.sh SuccessExitStatus=0 TimeoutStopSec=10 Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target
The question (obviously) is: What am I doing wrong? How can I start this service on boot?
Thanks in advance