1đź‘Ť
So you say (in the comments) that the status for gunicorn.service
says “exited” rather than “running” after you start it.
Most of the times, this means a service Type=
misconfiguration. The default is Type=simple
, which expects a non-forking process. Probably, your daemon forks into background after startup, which confuses systemd:
If set to
simple
(the default if neitherType=
norBusName=
, but
ExecStart=
are specified), it is expected that the process configured
with ExecStart= is the main process of the service.If set to
forking
, it is expected that the process configured with
ExecStart=
will call fork() as part of its start-up. The parent
process is expected to exit when start-up is complete and all
communication channels are set up.
So, to check this hypothesis, run the daemon binary from shell. If it releases the shell immediately, then your daemon is “forking” and you need to pass the corresponding option in your unit file:
[Service]
Type=forking