Jump to content

Delay the Start of Emby at Boot


Go to solution Solved by Luke,

Recommended Posts

EODCrafter
Posted

Is this the correct way to delay the start of Emby at Boot on Ubuntu? I have a program that Emby causes DLNA conflict with that needs to run first....

[Unit]
Description=Emby Server is a personal media server with apps on just about every device.
After=network.target

[Service]
EnvironmentFile=/etc/emby-server.conf
WorkingDirectory=/opt/emby-server
ExecStartPre=-/bin/sleep 20
ExecStart=/opt/emby-server/bin/emby-server
RestartForceExitStatus=3
User=emby

[Install]
WantedBy=multi-user.target

This is what I found by googling.....

 

ExecStartPre=-/bin/sleep 20

mastrmind11
Posted

seems reasonable to me.

  • Like 1
  • Solution
Posted

Yes, please try it and report your experience. Thanks.

  • Like 1
  • 1 year later...
redaktorn
Posted (edited)

I was also interested in delaying the start of emby in my Linux system.
My reason was that emby-service started before network connection was ready.
This caused the built in search for updates (aplication and plugin) to fail at startup + DLNA does not load.
(Both can of course be fixed after starting emby - but I wanted it done at boot)

My way of doing it was:
Copy files: emby-server.service and emby-server@.service (Now correct name)
From:  /usr/lib/systemd/system/
To:  /etc/systemd/system/

In both files edit section [Service] so it looks like this:

[Service]
EnvironmentFile=/etc/emby-server.conf
WorkingDirectory=/opt/emby-server

ExecStartPre=-/bin/sleep 30
ExecStart=/opt/emby-server/bin/emby-server
RestartForceExitStatus=3
User=emby


(Thanks to EODCrafter above for the red line. I just changed delay 20 to 30)

The reason I prefer to copy the files before editing is that /etc/systemd/system/ has priority over /usr/lib/systemd/system/.
Changes will be more permanent.

This works just fine for me running Linux Mint Mate version 19.3
I have noted no problems at all.
And I can enjoy that search for updates and DLNA works as they should already from boot.

Edit: Fix a small error on filename. The second file to copy is emby-server@.service (not embyserver@.service as it said before)

Edited by redaktorn
Fixed an error - wrong filename
  • Like 1
Posted

^ That's great, thanks for the info !

  • 1 year later...
Posted
On 28/07/2020 at 18:44, redaktorn said:

I was also interested in delaying the start of emby in my Linux system.
My reason was that emby-service started before network connection was ready.
This caused the built in search for updates (aplication and plugin) to fail at startup + DLNA does not load.
(Both can of course be fixed after starting emby - but I wanted it done at boot)

My way of doing it was:
Copy files: emby-server.service and emby-server@.service (Now correct name)
From:  /usr/lib/systemd/system/
To:  /etc/systemd/system/

In both files edit section [Service] so it looks like this:

[Service]
EnvironmentFile=/etc/emby-server.conf
WorkingDirectory=/opt/emby-server

ExecStartPre=-/bin/sleep 30
ExecStart=/opt/emby-server/bin/emby-server
RestartForceExitStatus=3
User=emby


(Thanks to EODCrafter above for the red line. I just changed delay 20 to 30)

The reason I prefer to copy the files before editing is that /etc/systemd/system/ has priority over /usr/lib/systemd/system/.
Changes will be more permanent.

This works just fine for me running Linux Mint Mate version 19.3
I have noted no problems at all.
And I can enjoy that search for updates and DLNA works as they should already from boot.

Edit: Fix a small error on filename. The second file to copy is emby-server@.service (not embyserver@.service as it said before)

Hi, thanks for this... very useful!!

 

Also just for absolute clarity: when you say 'copy files' from:  /usr/lib/systemd/system/ to:  /etc/systemd/system/ I have assumed you obviously mean 'move files' ...

Posted
4 minutes ago, Pseudomax said:

Hi, thanks for this... very useful!!

 

Also just for absolute clarity: when you say 'copy files' from:  /usr/lib/systemd/system/ to:  /etc/systemd/system/ I have assumed you obviously mean 'move files' ...

Copy or move, it does not matter. /etc/systemd/system takes priority.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...