Apache's PidFile directory is removed every boot

Solution 1:

The issue was that, when installing Apache, group apache wasn't being created.

# systemctl status systemd-tmpfiles-setup.service
systemd-tmpfiles-setup.service - Create Volatile Files and Directories
  Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-setup.service; static)
  Active: failed (Result: exit-code) since Tue 2014-09-30 09:40:30 EDT; 3h 24min ago
Docs: man:tmpfiles.d(5)
      man:systemd-tmpfiles(8)
  Process: 724 ExecStart=/usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev (code=exited, status=1/FAILURE)
Main PID: 724 (code=exited, status=1/FAILURE)

Sep 30 09:40:30 servername systemd-tmpfiles[724]: [/usr/lib/tmpfiles.d/httpd.conf:1] Unknown group 'apache'.
Sep 30 09:40:30 servername systemd-tmpfiles[724]: [/usr/lib/tmpfiles.d/httpd.conf:2] Unknown user 'apache'.
Sep 30 09:40:30 servername systemd[1]: systemd-tmpfiles-setup.service: main process exited, code=exited, status=1/FAILURE
Sep 30 09:40:30 servername systemd[1]: Failed to start Create Volatile Files and Directories.
Sep 30 09:40:30 servername systemd[1]: Unit systemd-tmpfiles-setup.service entered failed state.

That's because I've a NIS server configured, whith a NIS apache user. As it has an apache user, Apache installation doesn't create apache group. But apache group also exists on NIS! Well, NIS is messing up things.

Bottom line is: I have to stop ypbind, install Apache and then restart ypbind (or just create manually a apache group in /etc/group).

Solution 2:

I had the same solution for my problem as @datakid with the difference that after a reboot the systemd-tmpfiles-setup.service was dead again.

For my solution you first need to know that I mounted my /var directory on a different disk. And there was the problem. My /etc/fstab for the /var looked like this:

/dev/xvdb1 /var ext4 defaults,noatime,_netdev,nofail 0 2

So the problem was the _netdev. Because this might be useful for a NFS, where you need a network but not for my case with the /vardirectory

Here's the explanation for _netdev:

The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).

After i removed the _netdev everything was working again, also after reboot