1

I got this problem. This even work when using start/stop but not on enable. What can be wrong?

pi@raspberrypi:/etc/systemd/system $ service gserv enable
    gserv: unrecognized service
    pi@raspberrypi:/etc/systemd/system $ service gserv status
    Warning: The unit file, source configuration file or drop-ins of gserv.service c
    ● gserv.service - Gunicorn Flask
       Loaded: loaded (/etc/systemd/system/gserv.service; enabled; vendor preset: en
       Active: failed (Result: exit-code) since Sat 2020-10-24 23:50:18 EEST; 

1 Answers1

1

What I am seeing here is using the old service mechanism called 'system V init' (aka Upstart) and not 'systemd'. Some distros still use it, most do not. It uses keyword systemctl and not service.

One thing that is confusing about your error is that there are some mechanisms built into systemd that try to play nice with older init scripts. Your "service" command is part of init.. and yet if you look at the text, you can see that systemd is handling it. Some service commands seem to work (via systemd). Others do not. Your milage will vary so you might as well get used to using the correct systemctl commmand.

  • Instead of...sudo service gserv enable

  • Try..........sudo systemctl enable gserv

  • Instead of...service gserv status

  • Try..........systemctl status gserv

Here is a great page on the differences, tips, and why the change.

If this still doesn't fix your problem, let me know.. we can figure this out and document it for the next guy. :)