1

I'm mounting samba network shares from fstab on a debian jessie server. On those shares, I'm storing files used by an apache2 webserver.

Is there a way to stop the apache2 service if the network shares go offline?

TheBrick
  • 13
  • 2

1 Answers1

0

When this file is not available if samba not working you can use simple bash script:


if [ -a "path/to/file" ]
   then
      return 0;
else
   systemctl stop apache2
   return 0;
fi

And add this script to cron for every minutes.

liske1
  • 114
  • 4