# Controlling Apache startup

**URL:** <https://forums.suse.com/t/controlling-apache-startup/34514>\
**Category:** SLES Configure-Administer\
**Created:** [November 4, 2019, 9:16pm UTC](https://forums.suse.com/t/controlling-apache-startup/34514 "2019-11-04T21:16:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndersG](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AndersG](https://forums.suse.com/u/AndersG)\
**Post date:** [November 4, 2019, 9:16pm UTC](https://forums.suse.com/t/controlling-apache-startup/34514/1 "2019-11-04T21:16:28Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [November 4, 2019, 11:11pm UTC](https://forums.suse.com/t/controlling-apache-startup/34514/2 "2019-11-04T23:11:23Z")

</div>

Hi Anders  
What other nns services are present?

```auto
systemctl list-units | grep nss
```

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

---

<div class="post-metadata">

**Author:** ![AndersG](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AndersG](https://forums.suse.com/u/AndersG)\
**Post date:** [November 5, 2019, 7:56pm UTC](https://forums.suse.com/t/controlling-apache-startup/34514/3 "2019-11-05T19:56:01Z")

</div>

Hi Malcolm!

```auto
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?

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [November 5, 2019, 9:47pm UTC](https://forums.suse.com/t/controlling-apache-startup/34514/4 "2019-11-05T21:47:05Z")

</div>

[QUOTE=AndersG;58783]Hi Malcolm!

```auto
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…

---

<div class="post-metadata">

**Author:** ![AndersG](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@AndersG](https://forums.suse.com/u/AndersG)\
**Post date:** [November 6, 2019, 12:40pm UTC](https://forums.suse.com/t/controlling-apache-startup/34514/5 "2019-11-06T12:40:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [November 6, 2019, 2:11pm UTC](https://forums.suse.com/t/controlling-apache-startup/34514/6 "2019-11-06T14:11:17Z")

</div>

[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?
