jant90 15 Posted February 20, 2016 Share Posted February 20, 2016 (edited) I just installed Emby Server on my Ubuntu 14.04 server but I noticed I can't restart Emby from the webinterface. Manually executing "sudo /usr/lib/emby-server/restart.sh" from cli works fine. However when pressing the restart button in the webinferce Emby only shuts down. Is this a permissions issue of some sorts? I need to be root to successfully restart from cli. I installed the latest stable Emby Server (3.0.5871.0) from the repo using apt-get as per the instructions. EDIT: I also tried a chown, but that didn't help either (so I changed it back to root just in case): sudo chown -R emby:emby /usr/lib/emby-server EDIT2: It could also be useful to mention that Emby start fine when booting the system. Edited February 20, 2016 by jant90 Link to comment Share on other sites More sharing options...
TSandman 3 Posted February 20, 2016 Share Posted February 20, 2016 It's not just fresh installs, I've got the same thing here, since one or two updates ago (don't remember) "sudo service restart emby-server" works and restart the server but not from the web interface (server shuts down and doesn't restart) Link to comment Share on other sites More sharing options...
everydayevil 6 Posted February 20, 2016 Share Posted February 20, 2016 Just tested mine and confirmed for me as well.I usually start/stop via sudo service emby-server rather than GUI button so didn't notice this. I wonder if this impacts other emby initiated restarts (upgrade reboots, etc) Link to comment Share on other sites More sharing options...
f-u-t 7 Posted February 20, 2016 Share Posted February 20, 2016 (edited) .............. Edited March 12, 2016 by mymovies Link to comment Share on other sites More sharing options...
haeffnkr 3 Posted February 21, 2016 Share Posted February 21, 2016 I also can not restart from the web page. Link to comment Share on other sites More sharing options...
Solution jant90 15 Posted February 22, 2016 Author Solution Share Posted February 22, 2016 I looked at the sudoers file thinking Emby might not have the right permissions or something but I found quite a big file from Emby ensuring all required permissions were in place. So I took the restart.sh file down to the very basic and now it's restarting fine from the web interface, so "sudo nano /usr/lib/emby-server/restart.sh": #!/bin/bash service emby-server restart I hope this file will remain in tact during Emby updates. 2 Link to comment Share on other sites More sharing options...
everydayevil 6 Posted February 22, 2016 Share Posted February 22, 2016 (edited) Disregard for now i misread some of that code and my changes were wrong... restart was intermittently working. jant90, I went through and looked at the restart.sh after I saw your fix. I found the reason the existing code wasn't working. if you want to fix the existing code use this..... Tested on my system and working. ___________________________________________________#!/bin/bashNAME=emby-serverrestart_cmds=("s6-svc -t /var/run/s6/services/${NAME}" \ "systemctl restart ${NAME}" \ "service ${NAME} restart" \ "/etc/init.d/${NAME} restart" \ "invoke-rc.d ${NAME} restart")PIDFILE=`find /var/run -name "emby*.pid" -print -quit`[ -n "$PIDFILE" ] && EMBY_PID=`cat ${PIDFILE} 2> /dev/null || true`for restart_cmds in "${restart_cmds[@]}"; do cmd=$(echo "$restart_cmds" | awk '{print $1}') cmd_loc=$(command -v ${cmd}) if [ -n "$cmd_loc" ]; then restart_cmds=$(echo "$restart_cmds" | sed -e "s%${cmd}%${cmd_loc}%") exec sudo $restart_cmds > /dev/null 2>&1 || true sleep 1 if ! kill -0 $EMBY_PID > /dev/null; then break fi fidone_________________________________________________________________- Luke, There were multiple typos in the restart_cmds variable cmd singular vs cmds plural -everydayevil Edited February 22, 2016 by everydayevil Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted February 22, 2016 Share Posted February 22, 2016 This will not remain intact. The updates overwrite the file. Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted February 22, 2016 Share Posted February 22, 2016 Thank you all for your feedback though. I believe I discovered the issue. It has to do with the sudoers file. The emby group needs permission to secured directories such as /sbin. I will try and address it. 2 Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted February 22, 2016 Share Posted February 22, 2016 Please see the following as well for future error submissions: https://github.com/MediaBrowser/Wiki/wiki/Linux-Troubleshooting-Guide-and-FAQ Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted February 23, 2016 Share Posted February 23, 2016 Same here on Debian 7, but this started long time ago. But its not such a big problem because i do most restarts with ssh. Update and upgrade is not affected, also at server reboot it starts trough the init script. I just tested a debian 7 clean install, version 3.0.5871.0 and restart works perfectly fine. I will check ubuntu 14.04 next. Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted February 23, 2016 Share Posted February 23, 2016 Can confirm an issue on ubuntu 14.04. 1 Link to comment Share on other sites More sharing options...
runtimesandbox 153 Posted February 24, 2016 Share Posted February 24, 2016 From my experience it was an issue with Ubuntu 14.04 I have since moved to Debain 8.3 and it is not a problem there. 1 Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted February 27, 2016 Share Posted February 27, 2016 From my experience it was an issue with Ubuntu 14.04 I have since moved to Debain 8.3 and it is not a problem there. Yes, it seems to be only an issue with 14.04. Link to comment Share on other sites More sharing options...
jant90 15 Posted March 29, 2016 Author Share Posted March 29, 2016 (edited) @@hurricanehrndz please fix this in the next release, if it's just an Ubuntu 14.04 issue then it's just a matter of detecting the OS and just doing a simple service restart. My suggestion, place this code at the start of the restart.sh script and we, Ubuntu 14.04 users, are happy again: #!/bin/bash if [[ $(lsb_release -d) == *"Ubuntu 14.04"* ]] ; then service emby-server restart exit fi Easy enough and should have no downsides as it only executes on Ubuntu 14.04 systems. Edited March 29, 2016 by jant90 Link to comment Share on other sites More sharing options...
AdamBearWA 3 Posted March 30, 2016 Share Posted March 30, 2016 Pretty sure I had the same issue in 15.04 & 15.10. Also, when updating via apt-get, the service never comes back on. Might be related? Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted March 31, 2016 Share Posted March 31, 2016 @@hurricanehrndz please fix this in the next release, if it's just an Ubuntu 14.04 issue then it's just a matter of detecting the OS and just doing a simple service restart. My suggestion, place this code at the start of the restart.sh script and we, Ubuntu 14.04 users, are happy again: #!/bin/bash if [[ $(lsb_release -d) == *"Ubuntu 14.04"* ]] ; then service emby-server restart exit fi Easy enough and should have no downsides as it only executes on Ubuntu 14.04 systems. I have tried running the command and that same script on my 14.04 and it will not restart. I don't see this issue anywhere else. I can not depend on lsb_release. I will try again. In my testing situations I have not be able to get emby to restart at all within 14.04 no matter what restart command I use. Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted March 31, 2016 Share Posted March 31, 2016 Pretty sure I had the same issue in 15.04 & 15.10. Also, when updating via apt-get, the service never comes back on. Might be related? Not in my testing, if using systemd. Link to comment Share on other sites More sharing options...
jant90 15 Posted April 18, 2016 Author Share Posted April 18, 2016 Not in my testing, if using systemd. I basically run apt-get -y install emby-server from cron (as root) every night to auto-update Emby and then it restarts perfectly fine indeed. However the restart.sh file gets overridden and to solve that issue for me I just added a line to my auto-update script to change the restart.sh script to what I proposed. This solves both the missing auto-update feature and the restart issue for me. I do hope you get to the bottom of this issue though, the contradicting bug reports in this thread must be very frustrating. Link to comment Share on other sites More sharing options...
hurricanehrndz 149 Posted April 18, 2016 Share Posted April 18, 2016 Yeah, with 16.04 about to come out. I hope people care a lot less about 14.04 Sent from my D6603 using Tapatalk Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now