Bug ID 978543
Summary apache should start after remote-fs (nfs mounts)
Classification openSUSE
Product openSUSE Distribution
Version Leap 42.1
Hardware Other
OS openSUSE 42.1
Status NEW
Severity Major
Priority P5 - None
Component Apache
Assignee bnc-team-apache@forge.provo.novell.com
Reporter adaugherity@tamu.edu
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4)
AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17
Build Identifier: 

Currently with systemd, apache and NFS mounts are started in parallel.  This is
a regression from sysvinit, where apache had:
# Required-Start:               $local_fs $remote_fs $network

If apache is configured with a DocumentRoot on an NFS mount, or includes some
config files from said mount, it may fail on boot.  (It sometimes succeeds,
depending on how long the NFS mount takes -- it is nondeterministic.)

Behavior is identical on both Leap 42.1 and SLES 12 SP1, which of course share
apache packages.

Reproducible: Sometimes

Steps to Reproduce:
1. Add an NFS mount to /etc/fstab.
2. Configure apache DocumentRoot to somewhere under this mount point.
3. Reboot.
Actual Results:  
Apache (sometimes) fails to start on boot:
May 02 18:25:27 dhcp-108 start_apache2[839]: AH00526: Syntax error on line 7 of
/etc/apache2/default-server.conf:
May 02 18:25:27 dhcp-108 start_apache2[839]: DocumentRoot must be a directory
May 02 18:25:28 dhcp-108 start_apache2[898]: httpd (no pid file) not running
May 02 18:25:28 dhcp-108 systemd[1]: Failed to start The Apache Webserver.

Expected Results:  
Apache starts properly after NFS filesystems are mounted.

The fix is to add remote-fs.target to the After setting in the systemd unit
file:
--- /usr/lib/systemd/system/apache2.service    2015-11-05 07:42:10.000000000
-0600
+++ /etc/systemd/system/apache2.service    2016-05-02 14:33:25.569065156 -0500
@@ -1,6 +1,6 @@
 [Unit]
 Description=The Apache Webserver
-After=network.target nss-lookup.target time-sync.target
+After=network.target nss-lookup.target time-sync.target remote-fs.target
 Before=getty@tty1.service plymouth-quit.service xdm.service

 [Service]
====
Fedora encountered this same bug a couple years ago in RHBZ#751591, coming to
the conclusion that After=remote-fs.target is the proper fix.


You are receiving this mail because: