Controlling Apache startup

Hi!

I have this problem where Apache starts before NSS is fully loaded and fails as my document directory is on an NSS drive. When I look at the services file it does look like it should not start before nss, but it does. Any ideas? This os OES 2018 which is SLES 12 based.

[CODE][Unit]
Description=The Apache Webserver
After=network.target nss-lookup.target time-sync.target remote-fs.target
Before=getty@tty1.service plymouth-quit.service xdm.service
PartOf=apache2.target

[Service]
Type=notify
PrivateTmp=true
ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start
ExecReload=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful
ExecStop=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful-stop
KillMode=mixed
TasksMax=infinity
NotifyAccess=all

[Install]
WantedBy=multi-user.target
Alias=httpd.service apache.service[/CODE]

Hi Anders
What other nns services are present?

systemctl list-units | grep nss

It might need the actual mount not just the lookup added?

Hi Malcolm!

argo:~ # systemctl list-units | grep nss
  media-nss-VOL1.mount                                                                      loaded active mounted   /media/nss/VOL1
  opt-novell-nss-mnt-.pools-VOL1_POOL.mount                                                 loaded active mounted   /opt/novell/nss/mnt/.pools/VOL1_POOL
  ncp2nss.service                                                                           loaded active running   Novell NCP/NSS IPC daemon
  novell-nss.service                                                                        loaded active running   Novell Storage Services (NSS) file system.
  nss-lookup.target                                                                         loaded active active    Host and Network Name Lookups
  nss-user-lookup.target                                                                    loaded active active    User and Group Name Lookups
argo:~ #

Should I have it rely on media-nss-VOL1.mount instead?

[QUOTE=AndersG;58783]Hi Malcolm!

argo:~ # systemctl list-units | grep nss
  media-nss-VOL1.mount                                                                      loaded active mounted   /media/nss/VOL1
  opt-novell-nss-mnt-.pools-VOL1_POOL.mount                                                 loaded active mounted   /opt/novell/nss/mnt/.pools/VOL1_POOL
  ncp2nss.service                                                                           loaded active running   Novell NCP/NSS IPC daemon
  novell-nss.service                                                                        loaded active running   Novell Storage Services (NSS) file system.
  nss-lookup.target                                                                         loaded active active    Host and Network Name Lookups
  nss-user-lookup.target                                                                    loaded active active    User and Group Name Lookups
argo:~ #

Should I have it rely on media-nss-VOL1.mount instead?[/QUOTE]
Hi
Looks like it, so if you copy the /usr/lib/systemd/system/apache2.service over to /etc/systemd/system directory and stop/disable the original one, then modify/start/enable the version in /etc/systemd/system/ you should be good to go…

OK. But would not changing:
After=network.target nss-lookup.target time-sync.target remote-fs.target
to:
After=network.target media-nss-VOL1.mount time-sync.target remote-fs.target

Work as well?

[QUOTE=AndersG;58790]OK. But would not changing:
After=network.target nss-lookup.target time-sync.target remote-fs.target
to:
After=network.target media-nss-VOL1.mount time-sync.target remote-fs.target

Work as well?[/QUOTE]
Hi
Yes it would, but the next update and the service gets overwritten… probably rename the service to say nss_apache2.service and disable the apache2 one…

Just check the remote-fs.target as well, that may be where the problem lies?