GithubHelp home page GithubHelp logo

Comments (10)

ChuckPa avatar ChuckPa commented on June 9, 2024 1

I wrote this to support LinuxServer.io and Plex,inc images.

If you create the container and enter the container, you find:

bash-4.3# docker container list
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
bash-4.3# sudo docker container list
CONTAINER ID   IMAGE                       COMMAND   CREATED          STATUS                             PORTS                                                                                                                                                                                                          NAMES
40710f3df261   plexinc/pms-docker:latest   "/init"   15 seconds ago   Up 13 seconds (health: starting)   0.0.0.0:49157->1900/udp, 0.0.0.0:49155->8324/tcp, 0.0.0.0:49154->32400/tcp, 0.0.0.0:49156->32410/udp, 0.0.0.0:49155->32412/udp, 0.0.0.0:49154->32413/udp, 0.0.0.0:49153->32414/udp, 0.0.0.0:49153->32469/tcp   plexinc-pms-docker
bash-4.3# sudo docker exec -it plexinc-pms-docker bash
root@plexinc-pms-docker:/# ls
bin	data  healthcheck.sh  installBinary.sh	lib64	 media	plex-common.sh	 root  srv  transcode  version.txt
boot	dev   home	      lib		libexec  mnt	plex_service.sh  run   sys  usr
config	etc   init	      lib32		libx32	 opt	proc		 sbin  tmp  var
root@plexinc-pms-docker:/# cat /proc/1/comm
s6-svscan
root@plexinc-pms-docker:/# exit
bash-4.3# hostname
moesern
bash-4.3# uname -a
Linux moesern 3.10.105 #25556 SMP Sat Aug 28 02:15:59 CST 2021 x86_64 GNU/Linux synology_avoton_1815+
bash-4.3# 

Please notice: PID 1 is s6-svscan which I test for.

Going back into the container, you find PMS executables right where they are expected as well as the abstracted PMS metadata files. Remember, docker hides where things really are. Inside the container, everyone sees the same environment.

root@plexinc-pms-docker:/# ls /usr/lib/plexmediaserver
 CrashUploader		   'Plex Media Fingerprinter'  'Plex Relay'	   'Plex Transcoder'	  etc
'Plex Commercial Skipper'  'Plex Media Scanner'        'Plex SQLite'	   'Plex Tuner Service'   lib
'Plex DLNA Server'	   'Plex Media Server'	       'Plex Script Host'   Resources
root@plexinc-pms-docker:/# root@plexinc-pms-docker:/# cd /config
root@plexinc-pms-docker:~# ls
DBRepair.sh  Library
root@plexinc-pms-docker:~# ./DBRepair.sh 
Plex Media Server is currently running, cannot continue.
Please stop Plex Media Server and restart this utility.
root@plexinc-pms-docker:~# /plex_service.sh -d
root@plexinc-pms-docker:~# 
root@plexinc-pms-docker:~# ./DBRepair.sh 
 
 
 
      Plex Media Server Database Repair Utility (Docker)
 
Select
 
  1. Check database
  2. Vacuum database
  3. Reindex database
  4. Attempt database repair
  5. Replace current database with newest usable backup copy
  6. Undo last successful action (Vacuum, Reindex, Repair, or Replace)
  7. Import Viewstate / Watch history from another PMS database
  8. Show logfile
  9. Exit
 
Enter choice: 9
 
Ok to remove temporary databases/workfiles for this session? (Y/N) ? y
Are you sure (Y/N) ? y
Deleting all temporary work files.
root@plexinc-pms-docker:~# ls /config/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases
DBRepair.log  com.plexapp.plugins.library.blobs.db  com.plexapp.plugins.library.db
root@plexinc-pms-docker:~#

If you try to run it from outside the container, it won't know where to look.
Supported Linux and NAS platforms always put things in the same place.
Inside the container, everything is always in the same place without regard to what's "outside".

Docker lets you both name it anything you want AND put it anywhere you want.
Unless it's inside the container, it won't know where to look for all the files it needs.

Does it all make sense now?

For you, place the DBRepair.sh script file right next to Library in your filesystem.
This way, cd /config and it will be right there.

from plexdbrepair.

2bits avatar 2bits commented on June 9, 2024

It looks like we test for Docker in line 400 of master where it says,

  # Docker
  elif [ -f /bin/s6-svscan ] && [ -d "/config/Library/Application Support" ]; then

from plexdbrepair.

drumtechphoto avatar drumtechphoto commented on June 9, 2024

It looks like we test for Docker in line 400 of master where it says,

  # Docker
  elif [ -f /bin/s6-svscan ] && [ -d "/config/Library/Application Support" ]; then

@2bits Thank you for the reply. Not sure how to proceed from here. Not super high priority but this tool would be great to use as I do have over 25TB of Plex Media.

Any way for someone to pm me: I can allow a remote session into the pc so this can be looked into "live"? Maybe I am doing something wrong? I am human after all.

from plexdbrepair.

drumtechphoto avatar drumtechphoto commented on June 9, 2024

Also looking into the script self, line #398. the directory is not on my Synology.
PLEX_SQLITE="/usr/lib/plexmediaserver/Plex SQLite"

Docker was installed using the Synology Package Manager
plex container installed using the Docker UI on the Synology.

from plexdbrepair.

ChuckPa avatar ChuckPa commented on June 9, 2024

@drumtechphoto

Does it make sense now?

from plexdbrepair.

drumtechphoto avatar drumtechphoto commented on June 9, 2024

@drumtechphoto

Does it make sense now?

Thanks for the thorough guide, helps a lot. This is making sense now and I am currently working on this. Sorry for the late reply, been real busy with work and cleaning up my Plex Media Files to be more organized with cleaner Directories and File names.

from plexdbrepair.

drumtechphoto avatar drumtechphoto commented on June 9, 2024

@ChuckPa I can get the Repair Tool to startup but cannot stop the Plex Service in the docker container as required. "/plex_service.sh: No such file or directory"

root@PlexNAS2019:/# docker exec -it plex /bin/bash

root@PlexNAS2019:/# ps -eaf
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Nov27 ? 00:00:00 /package/admin/s6/command/s6-svscan -d4 -- /run/service
root 24 1 0 Nov27 ? 00:00:00 s6-supervise s6-linux-init-shutdownd
root 29 24 0 Nov27 ? 00:00:00 /package/admin/s6-linux-init/command/s6-linux-init-shutdownd -c /run/s6/basedir -g 3000 -C -B
root 45 1 0 Nov27 ? 00:00:00 s6-supervise s6rc-oneshot-runner
root 46 1 0 Nov27 ? 00:00:00 s6-supervise s6rc-fdholder
root 47 1 0 Nov27 ? 00:00:00 s6-supervise svc-plex
root 55 45 0 Nov27 ? 00:00:00 /package/admin/s6/command/s6-ipcserverd -1 -- /package/admin/s6/command/s6-ipcserver-access -v0 -E -l0 -i data/rules -- /pac
abc 201 47 0 Nov27 ? 00:00:10 /usr/lib/plexmediaserver/Plex Media Server
abc 287 201 0 Nov27 ? 00:00:07 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-5070ad484/Framework.bundle/Contents/Resources/
abc 346 201 0 Nov27 ? 00:00:01 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resour
abc 347 201 0 Nov27 ? 00:00:02 /usr/lib/plexmediaserver/Plex DLNA Server
abc 375 201 0 Nov27 ? 00:00:08 Plex Plug-in [com.plexapp.plugins.WebTools] /usr/lib/plexmediaserver/Resources/Plug-ins-5070ad484/Framework.bundle/Contents/
abc 458 201 0 Nov27 ? 00:00:04 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-5070ad484/Framework.bundle/Contents/Resou
root 1176 0 0 00:04 pts/1 00:00:00 /bin/bash
root 1191 1176 0 00:05 pts/1 00:00:00 ps -eaf

root@PlexNAS2019:/# ls
NAS bin command defaults docker-mods home lib lib64 media opt proc run srv tmp usr volume1
app boot config dev etc init lib32 libx32 mnt package root sbin sys transcode var

root@PlexNAS2019:/# cat /proc/1/comm
s6-svscan

root@PlexNAS2019:/# /plex_service.sh -d
bash: /plex_service.sh: No such file or directory

from plexdbrepair.

ChuckPa avatar ChuckPa commented on June 9, 2024

As stated in the Readme.md


        # Stop Plex when using official Plex,inc image
        /plex_service.sh -d
--or--
        # Stop Plex when using Linuxserver.io Plex image
        s6-svc -d /var/run/service/svc-plex

from plexdbrepair.

drumtechphoto avatar drumtechphoto commented on June 9, 2024

s6-svc -d /var/run/service/svc-plex

OMG, I totally overlooked this. Got it. Good from here. Officially Closed.
Once again @ChuckPa I really do appreciate your time and hard work. Thanks again.

from plexdbrepair.

drumtechphoto avatar drumtechphoto commented on June 9, 2024

Ha, yes of course 🤣. Read the manual several times but overlooked / scrolled passed it... My key points in general and after your help: Stay Focused, Work Smarter, Slow and Steady gets the Job Done Correctly 😅

from plexdbrepair.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.