Starting a service fails with "New main PID does not belong to service, and PID file is not owned by root. Refusing"

Solution Verified - Updated -

Issue

  • Since the upgrade to RHEL 7.7, a service with property Type=forking and property PIDFile 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content