I have a home server running TrueNAS Core. Inside a Jail, I have Plex mediaserver running so I can easily view my photos on my TV. Due to some bug in Plex, it sometimes crashes when I add new pictures. Of course this'll get fixed eventually, but until then I want to set something up so that Plex will automatically start again after it crashes.
I have tried setting up daemontools, but none of the guides I followed resulted in Plex automatically restarting. I think this is because I have Plex setup as a service instead of running a single script to start it.
Is there a way to monitor certain services on FreeBSD, and automatically restart them when they go down? I've searched everywhere I know but my queries yield no useful results.
Thanks