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