Plex kept shitting the bed every time the SMB share randomly dropped offline. After getting sick of jumping in to fix it manually over and over, I hacked together a script that shuts down the Plex service when the share bails, tries to remount the damn thing, and fires Plex back up once the share is stable again.
# MPSS (Mount Point Service Sync)
@@ 7,10 10,6 @@
MPSS dynamically controls start/stop of services (plexmediaserver, tdarr_node, Tdarr_Uptime, emby-server) based on presence or absence of "MOUNT_POINT_ALIVE" file on a network share. It logs actions to /var/log/mpss.log and trims the log to 200 lines.
-
## Usage Example
-
----------------
-
-
I run several services in my linux environment that depend on data on a network share to function. Occasionally that share goes offline for some reason. This script was written to ensure those services are shut down when the mount point becomes unavailable.