[GH-ISSUE #8] Script Doesn't Restart Plex #1

Closed
opened 2026-03-04 19:17:15 +03:00 by kerem · 9 comments
Owner

Originally created by @dweagle on GitHub (Jul 1, 2024).
Original GitHub issue: https://github.com/007revad/Linux_Plex_Backup/issues/8

Ubuntu 24.04
Plex: Plex version: 1.40.4.8626

Hello, thanks for the script! I got it running, but I get the following error in the log. It ran ran successfully, but when it went to restart Plex, it threw this error.

Starting Plex...
/usr/lib/plexmediaserver/Resources/start.sh: 11: ./Plex Media Server: not found

Thank you

Originally created by @dweagle on GitHub (Jul 1, 2024). Original GitHub issue: https://github.com/007revad/Linux_Plex_Backup/issues/8 Ubuntu 24.04 Plex: Plex version: 1.40.4.8626 Hello, thanks for the script! I got it running, but I get the following error in the log. It ran ran successfully, but when it went to restart Plex, it threw this error. Starting Plex... /usr/lib/plexmediaserver/Resources/start.sh: 11: ./Plex Media Server: not found Thank you
kerem closed this issue 2026-03-04 19:17:15 +03:00
Author
Owner

@007revad commented on GitHub (Jul 2, 2024):

I've released a new version to fix the failing to start Plex issue.
https://github.com/007revad/Linux_Plex_Backup/releases/tag/v1.0.3

<!-- gh-comment-id:2201518873 --> @007revad commented on GitHub (Jul 2, 2024): I've released a new version to fix the failing to start Plex issue. https://github.com/007revad/Linux_Plex_Backup/releases/tag/v1.0.3
Author
Owner

@dweagle commented on GitHub (Jul 2, 2024):

Very cool! Thanks

<!-- gh-comment-id:2201569367 --> @dweagle commented on GitHub (Jul 2, 2024): Very cool! Thanks
Author
Owner

@dweagle commented on GitHub (Jul 2, 2024):

Got a new error with new script:

Starting Plex...
libc++abi: terminating with uncaught exception of type std::runtime_error: Failed to load certificate file '/usr/lib/plexmediaserver/Resources/Resources/cacert.pem': No such file or directory
****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /root/Library/Application Support/Plex Media Server/Crash Reports/1.40.4.8626-f67205e8e/PLEX MEDIA SERVER/ee3d85d0-1030-41f4-700c5798-38683e83.dmp
Error in command line:the argument for option '--serverUuid' should follow immediately after the equal sign
Crash Uploader options:

Minidump Upload options:
--directory arg Directory to scan for crash reports
--serverUuid arg UUID of the server that crashed
--platform arg Platform string
--platformVersion arg Platform version string
--vendor arg Vendor string
--device arg Device string
--model arg Device model string
--allowRetries arg Whether we will allow retries

Session Health options:
--sessionStatus arg Seassion health status (exited, crashed, or abnormal)
--sessionStart arg Session start timestamp in UTC or epoch time
--sessionDuration arg Session duration in seconds

Common options:
--userId arg User that owns this product
--version arg Version of the product
--sentryUrl arg Sentry URL to upload to
--sentryKey arg Sentry Key for the project
Aborted (core dumped)

<!-- gh-comment-id:2201580552 --> @dweagle commented on GitHub (Jul 2, 2024): Got a new error with new script: Starting Plex... libc++abi: terminating with uncaught exception of type std::runtime_error: Failed to load certificate file '/usr/lib/plexmediaserver/Resources/Resources/cacert.pem': No such file or directory ****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /root/Library/Application Support/Plex Media Server/Crash Reports/1.40.4.8626-f67205e8e/PLEX MEDIA SERVER/ee3d85d0-1030-41f4-700c5798-38683e83.dmp Error in command line:the argument for option '--serverUuid' should follow immediately after the equal sign Crash Uploader options: Minidump Upload options: --directory arg Directory to scan for crash reports --serverUuid arg UUID of the server that crashed --platform arg Platform string --platformVersion arg Platform version string --vendor arg Vendor string --device arg Device string --model arg Device model string --allowRetries arg Whether we will allow retries Session Health options: --sessionStatus arg Seassion health status (exited, crashed, or abnormal) --sessionStart arg Session start timestamp in UTC or epoch time --sessionDuration arg Session duration in seconds Common options: --userId arg User that owns this product --version arg Version of the product --sentryUrl arg Sentry URL to upload to --sentryKey arg Sentry Key for the project Aborted (core dumped)
Author
Owner

@007revad commented on GitHub (Jul 2, 2024):

Hmm, that's gone from a minor problem to a big problem :(

<!-- gh-comment-id:2201589573 --> @007revad commented on GitHub (Jul 2, 2024): Hmm, that's gone from a minor problem to a big problem :(
Author
Owner

@dweagle commented on GitHub (Jul 2, 2024):

Oh no! Can it just have a systemctl command to start it back up again? I'm not fluent in code so I don't know the reason why the start.sh is used. I just saw systemctl was used to shut it down.

<!-- gh-comment-id:2201592902 --> @dweagle commented on GitHub (Jul 2, 2024): Oh no! Can it just have a systemctl command to start it back up again? I'm not fluent in code so I don't know the reason why the start.sh is used. I just saw systemctl was used to shut it down.
Author
Owner

@007revad commented on GitHub (Jul 2, 2024):

start.sh exports variables that Plex needs

#!/bin/sh
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname ${SCRIPT}`
export LD_LIBRARY_PATH="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
ulimit -s 3000
./Plex\ Media\ Server

Do you want to stop plexmediaserver with:

systemctl stop plexmediaserver

then see if it will start with:

systemctl start plexmediaserver

Or I could change the script to copy '/usr/lib/plexmediaserver/Resources/cacert.pem' to '/usr/lib/plexmediaserver/Resources/Resources/cacert.pem' (which is a bit of hack but should work).

<!-- gh-comment-id:2201605301 --> @007revad commented on GitHub (Jul 2, 2024): start.sh exports variables that Plex needs ``` #!/bin/sh SCRIPT=$(readlink -f $0) SCRIPTPATH=`dirname ${SCRIPT}` export LD_LIBRARY_PATH="${SCRIPTPATH}" export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}" export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 export LC_ALL="en_US.UTF-8" export LANG="en_US.UTF-8" ulimit -s 3000 ./Plex\ Media\ Server ``` Do you want to stop plexmediaserver with: ``` systemctl stop plexmediaserver ``` then see if it will start with: ``` systemctl start plexmediaserver ``` Or I could change the script to copy '/usr/lib/plexmediaserver/Resources/cacert.pem' to '/usr/lib/plexmediaserver/Resources/Resources/cacert.pem' (which is a bit of hack but should work).
Author
Owner

@dweagle commented on GitHub (Jul 2, 2024):

It starts with systemctl start plexmediaserver. That's how I manually restarted it at the command line after the error. What is the best way to do it?

<!-- gh-comment-id:2201610286 --> @dweagle commented on GitHub (Jul 2, 2024): It starts with systemctl start plexmediaserver. That's how I manually restarted it at the command line after the error. What is the best way to do it?
Author
Owner

@007revad commented on GitHub (Jul 2, 2024):

Excellent. Maybe start.sh is only used by the package installer.

I've released a new version that uses systemctl start plexmediaserver
https://github.com/007revad/Linux_Plex_Backup/releases/tag/v1.0.4

<!-- gh-comment-id:2201639435 --> @007revad commented on GitHub (Jul 2, 2024): Excellent. Maybe start.sh is only used by the package installer. I've released a new version that uses systemctl start plexmediaserver https://github.com/007revad/Linux_Plex_Backup/releases/tag/v1.0.4
Author
Owner

@dweagle commented on GitHub (Jul 2, 2024):

That did it! I appreciate it. Thanks for the nice and easy to use script.

<!-- gh-comment-id:2201646088 --> @dweagle commented on GitHub (Jul 2, 2024): That did it! I appreciate it. Thanks for the nice and easy to use script.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Linux_Plex_Backup#1
No description provided.