On Centos 7 after reboot

How can I make sure NGINX is only started after the glusterFS mount is completed?

I tried adding a line to rc.local but nginx fails to start and the directory is not mounted at all after reboot. This is the mount command.

/usr/sbin/mount.glusterfs localhost:/Replicatedvolume /home -o direct-io-mode=enable

which works when I run it manually and then start nginx/

thank you

  • Why are you mounting in rc.local?!? – Michael Hampton Apr 2 at 14:06
  • to make it work after reboot automatically? What kind of question is that – Misterr Moron Apr 3 at 15:53
  • It's a serious question. You're supposed to put it in /etc/fstab like every other mount. You didn't explain why you chose not to follow the directions. – Michael Hampton Apr 3 at 16:02

In case someone wonders, I had to put "sleep 5" before the mount command in rc.local

Might be working with less seconds but sleep 1 had no effect.

I also added service nginx start to the rc.local script below the mount and it now works.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.