Good morning! I show you a .service that randomly stops sometimes but it won’t restart. I would like to see what it would be possible to do to make it restart automatically and quickly!
[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 ExecStart=/opt/emby-server/bin/emby-server RestartForceExitStatus=3 User=emby [Install] WantedBy=multi-user.target
As it does not stop frequently, I would like to know if this way the problem would be solved!
[Unit] Description=Emby Server is a personal media server with apps on just about ever> After=network.target
[Service] EnvironmentFile=/etc/emby-server.conf WorkingDirectory=/opt/emby-server ExecStart=/opt/emby-server/bin/emby-server User=emby Restart=on-failure RestartSec=5s
[Install] WantedBy=multi-user.target
Thank you!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
DigitalOcean has a pretty good tutorial that explains such cases here:
Having said that, what you’ve written looks like it should work however usually when a service crashes it’s because the Droplet has killed it or there was an issue with said service. This means that most probably it won’t start again.
In such cases, I often urge people to check the logs and see why this behavior is seen. Usually, services shouldn’t crash.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.