1

I want to start Apache after mounting a NFS (GlusterFS) share, but it keeps starting before the mount step. I set the order in /etc/rc*.d/ but it didn't work.

I always can edit the scripts to sleep a few seconds or wait for the share, but I'd like to know what's the best/correct way to do so.

Thanks a lot.

1 Answer 1

1

In the /etc/rc.d directory there is also a file called rc.local, which is the rc file that init will run after everything else is done. So you could take off that from default startup sequence and put under rc.local

chkconfig httpd off
echo "/etc/init.d/httpd start" >> /etc/init.d/rc.local

this should work for above scenario unless you have some other requirement.

However, boot process should run according to naming order if you see SXX, KXX where XX is number [order].

You can also check rcorder depending upon availability in your distribution..

3
  • I already tried that. GlusterFS takes almost 20 seconds to mount the partition. Because of that, even using rc.local, Apache doesn't start. I guess I'll need to create a script to wait for GlusterFS vefore starting Apache. That's not a polite solution, but it works. Jul 5, 2014 at 22:58
  • though i won't put sleep 20 [or similar], i would simply execute on completion, i.e. one script for both services startup. In future it might well take seconds more than what it takes now, good luck ))
    – tike
    Jul 5, 2014 at 23:08
  • That's exactly what I was thinking. I can check for mounted volumes and, only after that, start Apache. Thanks. Jul 6, 2014 at 2:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .