i am trying to follow the following tutorial to deploy my flask app. https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-18-04
i am seeing the error, current command vanished from the unit file, execution of the command list wont be resumed, when i check systemctl of the gunicorn i just configured.
and this is my unit file.
thank you in advance
4
Answers
I know I’m late in replying, but this is a really weird thing that seems to happen once in a while.
The fix is obscure: you will have to manually edit a system file, so be extra-careful when doing that. The file in question is
/usr/lib/systemd/system/initrd-switch-root.service
.As root, open that file with your favourite editor, and scroll down to the line that says:
and change it to
Then run
systemctl daemon-reload
, and you should be able to start your unit.In my case (a completely different application), I have noticed that the error still lingers, but at least the application truly starts…
Source: https://github.com/systemd/systemd/issues/16076
Note that the above-mentioned fix was applied to
systemd
version 246 or 247 or so, back in mid-2020. However, Ubuntu 20.04.3 LTS, as of today (September 2021), still usessystemd
245. Your own Ubuntu 18.04 is very likely using an even earlier version.You have to stop and disable the service:
My solution was to stop the project, reload daemon and start once again.
For me, I was creating a Ruby application service and made a change in the systemd file to start in a different ip and i was having the same error. As the @kefeng91 suggested I did this
and Worked after doing the
systemctl daemon-reload
and checking in the
systemctl status example.service
As I understood in every change of the .service we need to stop and reload the service