0

The quick version: I want to point my '/volume1/Plex/Library/Application Support/Plex Media Server/Logs/' directory to a black hole, so nothing gets written to it. Is there a way to do this? Will it stop Plex from keeping my hard drives spinning all day?

The long version:

I'm running a Synology NAS with lots of movies etc. I was using Synology's "DS Video" app on my Roku TV, which worked great until I started ripping my blu-rays with DTS audio. Unfortunately, DS Video can't play DTS audio for whatever reason. To make matters worse, DS Video is going to be discontinued on Roku TVs as of 12/31/2018 (according to the support rep who got back to me about the audio issue).

So I'm back to using Plex, which I stopped using months ago because it has a god-awful "feature" where it writes to log files on a regular basis, because stupid. See this, this, and this for just a few examples of people who don't like this "feature", with Plex basically refusing to change it.

Because Plex writes to the log files so often, my hard drives never spin down. When Plex is disabled, the disks spin down and stay nice and quiet until I need the NAS.

So I'm in the same boat as other Plex users who don't want Plex spinning up the drives all day. Is there a way to point the log directory that Plex uses to a black hole, like /dev/null or something? Will this allow the drives to spin down?

Other notes / disclaimers:

  • I know that NAS hard disks are perfectly ok with spinning all day long. I don't care. They make noise and I want them quiet until I need them. I don't need them often, so at most I might spin them up once a day.
  • FWIW I'm using two Seagate 10TB IronWolf Pro drives.
  • I don't care about the log files or Plex's reasoning for wanting them enabled.

2 Answers2

0

You can create a file just like /dev/null anywhere you like. The command is mknod.

Example:

mknod /path/to/black/hole c 1 3

(Source.)

If that doesn't work, (e.g. you don't know the exact path of the logfile in advance) my other suggestion would be to mount that directory as a ramdisk. Or, you could try a FUSE filesystem, but this is a less common configuration, and therefore you are more likely to have problems with it.

Nick ODell
  • 2,608
  • So should I just turn the logs directory itself into a black hole like so: mknod '/volume1/Plex/Library/Application Support/Plex Media Server/Logs/' c 1 3? – Mike Willis Aug 01 '18 at 03:12
  • No, this turns an individual file into a black hole. – Nick ODell Aug 01 '18 at 03:13
  • So how can I point the whole directory there? There are dozens, maybe hundreds of files in this directory, and I don't know if they rotate automatically or what, so doing them individually might not work – Mike Willis Aug 01 '18 at 03:30
0

If @Nick ODell's method won't work, just create a link to /dev/null in '/volume1/Plex/Library/Application Support/Plex Media Server/' as "Logs". (Assuming you want to get rid of the logs, you will have to delete "Logs" directory)

ln -s /dev/null /volume1/Plex/Library/Application Support/Plex\ Media\ Server/Logs

Check whether "Logs" now points to /dev/null when you type ls -l from within "Plex Media Server" directory.

Buddika
  • 132
  • I just set this up. Renamed the logs directory in case I need it at some point, and created the symlink as you mentioned. Will keep an eye on it tonight and tomorrow and let you know if it seems to have worked! – Mike Willis Aug 02 '18 at 02:27
  • UGH scratch that. Plex fails to run in this situation. I despair. – Mike Willis Aug 02 '18 at 02:29
  • Do you have SELinux set up? If so that might be the problem. Check the Type contexts of the original directory and the link created. In case of a context mismatch, here's a link to an answer which only changes the type context of the symbolic link. https://serverfault.com/questions/177061/how-do-i-assign-an-selinux-label-to-a-symlink-with-semanage-so-it-persists-after?newreg=6f903f1acc824dac8ab56857aa86e7e8 – Buddika Aug 02 '18 at 06:49
  • I don't think I have SELinux installed.. I tried getenforce and sestatus and both said command not found. I also noticed a subdirectory /PMS Plugin Logs inside the /Logs folder, which maybe is causing a problem too. Last night I had symlinked the Logs directory but what happens if Plex wanted to access the subdirectory? I just tried symlinking that too but it can't seem to create the symlink when the Logs directory has also been symlinked (and therefore doesn't exist).. – Mike Willis Aug 03 '18 at 00:48
  • If that is the issue, your only option would be to leave the logs directory as it is and use systemd-tmpfiles and configure it for automatic deletion of log files or set up a cron job. Those are the only two things I can think of at the moment. I will have to get my hands on a proper linux box to try to find a possible solution and will get back to you after 9th of August. Sorry for the delay. https://developers.redhat.com/blog/2016/09/20/managing-temporary-files-with-systemd-tmpfiles-on-rhel7/ – Buddika Aug 03 '18 at 10:34
  • I also googled around and found this, if you've already tried that, just ignore https://forums.plex.tv/t/disable-plex-server-log/70931/2 – Buddika Aug 03 '18 at 10:45
  • No worries @Buddika thank you for your help! I did disable all logs that they allow you to disable, but they insist on having some that can't be disabled, because maybe one day you might request tech support and in this case they want their support reps to have some log files to look at. So every Plex installation is always writing logs and keeping NAS drives from sleeping, because a small minority of users may need tech support that requires logs. Ridiculous. In any case, I'm thinking about disabling Plex and writing a process that turns it on when it detects incoming traffic on Plex's port. – Mike Willis Aug 03 '18 at 20:04