Jump to content

Start script is broken?


stemid

Recommended Posts

I've been using beta for a while now but before that I remember the stable release having this same issue.

 

The start script is unnecessarily complex imo and everytime I upgrade I have to do this small edit to make it run on my Fedora 26 server.

*** /usr/lib/emby-server/emby-server.sh 2017-12-13 23:24:34.965702018 +0100
--- emby-server.sh      2017-12-13 23:24:28.406805774 +0100
*************** fi
*** 107,115 ****
  case "$1" in
    start)
      echo $$ > $PIDFILE
!     umask $UMASK
!     exec env $MAGICK_HOME_ENV $MAGICK_CODER_FILTER_PATH_ENV $MAGICK_CODER_MODULE_PATH_ENV \
!           $MONO_EXEC_ENV $MONO_EXEC $MONO_EXEC_OPTS $EMBY_EXEC $EMBY_OPTS
      ;;
    clear)
      [[ -e $PIDFILE ]] && rm -rf $PIDFILE
--- 107,115 ----
  case "$1" in
    start)
      echo $$ > $PIDFILE
!     exec su -s /bin/sh -c 'umask $0; exec "$1" "$@"' $EMBY_USER -- \
!       $UMASK env $MAGICK_HOME_ENV $MAGICK_CODER_FILTER_PATH_ENV $MAGICK_CODER_MODULE_PATH_ENV \
!       $MONO_EXEC_ENV $MONO_EXEC $MONO_EXEC_OPTS $EMBY_EXEC $EMBY_OPTS
      ;;
    clear)
      [[ -e $PIDFILE ]] && rm -rf $PIDFILE

I can see many others using CentOS or Fedora here so maybe I'm missing something simple but either way I think that part of the start script makes no sense and editing it has made emby start for me.

 

If I don't edit it I get the following error in the log.

dec 13 23:16:43 nas02 systemd[1]: Started Emby Media Server.                                                                                                   
dec 13 23:16:43 nas02 emby-server[1380]: /usr/lib/emby-server/emby-server.sh: rad 109: /var/run/emby-server.pid: Permission denied 
dec 13 23:16:43 nas02 emby-server[1380]: /usr/lib/emby-server/emby-server.sh: rad 110: exec: su: finns inte                                                      

Which is in Swedish I'm afraid but what it says is that exec reports that su does not exist. Changing su to absolute path also helps but being a bash grammar nazi I prefer my solution.

 

Edit: Almost forgot to mention that I also have these overrides in /etc/systemd/system/emby-server.service.d/override.conf to ensure it runs as the emby user.

[Service]
SyslogIdentifier=emby-server
EnvironmentFile=/etc/default/emby-server
User=emby

Edited by stemid
Link to comment
Share on other sites

dcrdev

Well that's the mono version and yes the startup script was overly complex, although I always overcame that problem by creating an override service in /etc/systemd/system as oppose to editing the script; that way updates didn't break anything.

 

However the .net core version - available from the homepage/github doesn't face that particular problem.

Link to comment
Share on other sites

I don't understand, which version are you using? I checked the version of my rpm package installed, emby-server-beta, and it actually matches the version on the emby.media download page for fedora. 3.2.50.5. I believe the website says 3.2.50.0.

 

So which version am I supposed to be using?

Link to comment
Share on other sites

dcrdev

Well there's the old rpm - the mono based version; the one I believe your using and then there's the one built against the .net core runtime.

 

I believe the old rpm's are still being built on the opensuse build service and that's why you have the latest version of Emby.

 

Essentially you want this rpm for the beta:

https://github.com/MediaBrowser/Emby/releases/download/3.2.50.5/emby-server-rpm_3.2.50.5_x86_64.rpm

 

Or this one for stable:

https://github.com/MediaBrowser/Emby/releases/download/3.2.50.0/emby-server-rpm_3.2.50.0_x86_64.rpm

 

Sadly the new packages aren't in a repository any more - so you'll have to remove the existing repo from /etc/yum.repos.d

Edited by dcrdev
Link to comment
Share on other sites

Yes we are still building the mono based packages to avoid having to force everyone to migrate to a new installation.

 

If you want to try the .NET Core installation, instructions are on the website. Thanks !

Link to comment
Share on other sites

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...