Starting a service fails with "New main PID does not belong to service, and PID file is not owned by root. Refusing"
Issue
-
Since the upgrade to RHEL 7.7, a service with property
Type=forking
and propertyPIDFile
defined doesn't start and its status shows the following error messages:<timestamp> <hostname> myservice[<PID>]: Starting myservice <timestamp> <hostname> myservice[<PID>]: myservice started. <timestamp> <hostname> systemd[1]: New main PID <PID> does not belong to service, and PID file is not owned by root. Refusing. <timestamp> <hostname> systemd[1]: New main PID <PID> does not belong to service, and PID file is not owned by root. Refusing. <timestamp> <hostname> systemd[1]: Failed to start myservice. <timestamp> <hostname> systemd[1]: Unit myservice.service entered failed state. <timestamp> <hostname> systemd[1]: myservice.service failed.
Environment
- Red Hat Enterprise Linux 7.7 and later
- systemd-219-67
- Red Hat Enterprise Linux 8
- systemd-239
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.