acn128 1 Posted August 17, 2018 Share Posted August 17, 2018 Hi, as I am using Debian Stretch with the classic SysVinit, the provided .deb file does not work correctly - as the package does not supply a init script. The older packages from the third party repository included one, but the emby.media-packages do not. So I created an init script which is working on my system, see the attached file (I had to rename it to .txt for being able to attach it). It uses the /etc/default/emby-server and /etc/emby-server.conf mechanism for setting the defaults and includes the commands from /opt/emby-server/bin/emby-server (as only one such script is really needed...). To start and stop Emby, it uses start-stop-daemon which works well on my system and creates/removes the PID file on its own to address the process. Feel free to use it or to include it in the next packages. Regards, Anna emby-server.txt Link to comment Share on other sites More sharing options...
mastrmind11 717 Posted August 17, 2018 Share Posted August 17, 2018 nice work. Link to comment Share on other sites More sharing options...
Luke 37065 Posted August 17, 2018 Share Posted August 17, 2018 Thanks for the info. Yes it's true the packages do not support SysVinit as of this time. Link to comment Share on other sites More sharing options...
Luke 37065 Posted August 17, 2018 Share Posted August 17, 2018 Does the restart button in the server dashboard work with this? Link to comment Share on other sites More sharing options...
acn128 1 Posted August 17, 2018 Author Share Posted August 17, 2018 @Luke: In my opinion, it *should* do nothing, as restarting a daemon process via some "/etc/init.d/emby-server restart" is something that only root should be able to do. Besides, I don't know what should happen - the process (EmbyServer) runs as user "emby". It has no rights to start the init scripts and other system-related things (as we are on a UNIX operating system). Btw: What should "restart" and "shutdown" really do? Reboot or shutdown the OS? (Are you kidding me?!) Regards, Anna Link to comment Share on other sites More sharing options...
Luke 37065 Posted August 17, 2018 Share Posted August 17, 2018 The software, not the system. Link to comment Share on other sites More sharing options...
acn128 1 Posted August 17, 2018 Author Share Posted August 17, 2018 (edited) Oh, I've tried the "restart" button, the following things appear in the logfile: 2018-08-17 15:56:22.506 Info HttpServer: HTTP POST http://xxxxx:8096/emby/System/Restart. UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:52.9) Gecko/20100101 Goanna/4.1 Firefox/52.9 PaleMoon/28.0.0 2018-08-17 15:56:22.508 Info HttpServer: HTTP Response 204 to 1.1.1.1. Time: 2ms. http://xxxxx:8096/emby/System/Restart 2018-08-17 15:56:22.513 Info App: Calling RestartInternal 2018-08-17 15:56:22.517 Info App: Disposing CoreAppHost 2018-08-17 15:56:22.517 Info App: Disposing IsoManager 2018-08-17 15:56:22.517 Info App: Disposing TaskManager 2018-08-17 15:56:22.519 Info App: Disposing InstallationManager 2018-08-17 15:56:22.520 Info App: Disposing SqliteUserRepository 2018-08-17 15:56:22.540 Info HttpServer: HTTP GET http://xxxxx:8096/web/favicon.ico. UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:52.9) Gecko/20100101 Goanna/4.1 Firefox/52.9 PaleMoon/28.0.0 2018-08-17 15:56:22.540 Info HttpServer: HTTP Response 304 to 1.1.1.1. Time: 0ms. http://xxxxx:8096/web/favicon.ico 2018-08-17 15:56:22.729 Info App: Disposing SqliteDisplayPreferencesRepository 2018-08-17 15:56:22.782 Info HttpServer: HTTP GET http://xxxxx:8096/emby/System/Info. UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:52.9) Gecko/20100101 Goanna/4.1 Firefox/52.9 PaleMoon/28.0.0 2018-08-17 15:56:22.783 Info HttpServer: HTTP Response 200 to 1.1.1.1. Time: 1ms. http://xxxxx:8096/emby/System/Info 2018-08-17 15:56:22.843 Info App: Disposing SqliteItemRepository 2018-08-17 15:56:23.303 Info HttpServer: HTTP GET http://xxxxx:8096/emby/System/Info. UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:52.9) Gecko/20100101 Goanna/4.1 Firefox/52.9 PaleMoon/28.0.0 2018-08-17 15:56:23.305 Info HttpServer: HTTP Response 200 to 1.1.1.1. Time: 3ms. http://xxxxx:8096/emby/System/Info After that, Emby answers with a "503 Service Unavailable"..... As it seems, the software quits, but does not get restarted. Maybe I should add some check or look if start-stop-daemon could do something here. But at least I do not use these buttons right now. Edited August 17, 2018 by acn128 Link to comment Share on other sites More sharing options...
acn128 1 Posted August 17, 2018 Author Share Posted August 17, 2018 How is this reboot/shutdown implemented? Link to comment Share on other sites More sharing options...
jamesdtyler 0 Posted November 16, 2018 Share Posted November 16, 2018 I see a section of the init file refers to "$EMBY_USER" and "$EMBY_GROUP", and I get an error when starting. I attempted to set both to my existing user, and it seemed to think that was ok. Are there defaults that the DEB package creates with the POSTINST script. Finally, the convention seems different for this server than some of the other servers out there (i.e. nzbdrone,or sonarr) is this text file meant to be contained in "/etc/init.d/emby-server" "/etc/default/emby-server.conf" or "(something else)" monodevelop started the git version(allowing me to run the wizard), but I could not determine how to add the server to sysV. seeking this information, I arrived at this post. Thanks, Jay Link to comment Share on other sites More sharing options...
acn128 1 Posted November 19, 2018 Author Share Posted November 19, 2018 Hallo Jay, the script needs the files /etc/default/emby-server and /etc/emby-server.conf. The "default" file holds the defaults as provided by Emby and in /etc/emby-server.conf you should enter your local overrides. What error do you see? Anna Link to comment Share on other sites More sharing options...
jamesdtyler 0 Posted November 19, 2018 Share Posted November 19, 2018 The 3.6 deb installed, but I don't think that the postinst script was ever performed. error is "[....] Starting emby-server daemon:start-stop-daemon: missing group name" I manually went through the "configure" section of postinst, with sudo. postinst: configure) getent group emby > /dev/null 2>&1 || groupadd -r emby getent passwd emby > /dev/null 2>&1 && usermod -c 'Emby Server' -g emby -d /var/lib/emby -m -s /usr/bin/nologin emby getent passwd emby > /dev/null 2>&1 || useradd -r -c 'Emby Server' -g emby -d /var/lib/emby -m -s /usr/bin/nologin emby passwd -l emby > /dev/null [ -d /var/lib/emby ] || mkdir /var/lib/emby chmod 755 /var/lib/emby chown emby:emby -R /var/lib/emby if [ -x "$(which systemctl)" ]; then systemctl daemon-reload systemctl enable emby-server || true systemctl start emby-server || true else service emby-server start fi ;; commands like so... groupadd -r emby usermod -c 'Emby Server' -g emby -d /var/lib/emby -m -s /usr/bin/nologin emby useradd -r -c 'Emby Server' -g emby -d /var/lib/emby -m -s /usr/bin/nologin emby passwd -l emby > /dev/null mkdir /var/lib/emby chmod 755 /var/lib/emby chown emby:emby -R /var/lib/emby ldconfig service emby-server start did a reboot... tyler@shade:~$ sudo service emby-server status [FAIL] emby-server is not running ... failed! tyler@shade:~$ sudo service emby-server start [....] Starting emby-server daemon:start-stop-daemon: missing group name failed! tyler@shade:~$ ls -al /var/lib | grep emby drwxr-xr-x 2 emby emby 4096 Nov 19 10:34 emby (scratches head) files installed on system with -la https://pastebin.com/gNNKLDme perhaps my files have incorrect contents? Thanks, Jay Link to comment Share on other sites More sharing options...
jamesdtyler 0 Posted November 19, 2018 Share Posted November 19, 2018 (edited) contents of said files: https://pastebin.com/9WPkDT1m Edited November 19, 2018 by jamesdtyler Link to comment Share on other sites More sharing options...
sczan1101 0 Posted March 15, 2019 Share Posted March 15, 2019 (edited) Thanks for your work. I reinstall emby-server, but thers is no file /etc/default/emby-server # service emby-server start /etc/init.d/emby-server:line33: /etc/default/emby-server: no such file or directory I stayed in this interface for more than ten minutes. Alerts > scan media library failed Unable to cast object of type 'MediaBrowser.Controller.Entities.Folder' to type 'MediaBrowser.Controller.Entities.AggregateFolder'. at Emby.Server.Implementations.Library.LibraryManager.CreateRootFolder() at Emby.Server.Implementations.Library.LibraryManager.get_RootFolder() at Emby.Server.Implementations.IO.LibraryMonitor.Start() at Emby.Server.Implementations.Library.LibraryManager.ValidateMediaLibraryInternal(IProgress`1 progress, CancellationToken cancellationToken) at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker.ExecuteInternal(TaskOptions options) Edited March 15, 2019 by sczan1101 Link to comment Share on other sites More sharing options...
Luke 37065 Posted March 15, 2019 Share Posted March 15, 2019 Please attach the complete emby server log. Thanks. Link to comment Share on other sites More sharing options...
mastrmind11 717 Posted March 15, 2019 Share Posted March 15, 2019 find emby-server and tweak the script.. 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