Comments (5)
I think when we played around before with having it restart itself it
didn't work. Presumably because when you stop you obviously then can't
start again! So you need to do the restart from another process. I think.
On 22 Nov 2015 04:37, "John Cass" [email protected] wrote:
It may be useful to have an option available to restart the Mopidy service
to deal with situations where the actor dies unexpectedly (e.g. due to a
misbehaving backend extension).This would be quicker than having to do a full reboot, and easier than
having to log in to the terminal to issue the command manually.It probably means just adding WebServiceRestartRequestHandler that does service
mopidy restart, similar to
mopidy-websettings/mopidy_websettings/__init__.py
Lines 143 to 151 in 1c55d94
?—
Reply to this email directly or view it on GitHub
#17.
from mopidy-websettings.
And in musicbox we have a process manager to restart mopidy (and other
things) if/when they crash. The name of it escapes me.
On 22 Nov 2015 13:11, "Nick Steel" [email protected] wrote:
I think when we played around before with having it restart itself it
didn't work. Presumably because when you stop you obviously then can't
start again! So you need to do the restart from another process. I think.
On 22 Nov 2015 04:37, "John Cass" [email protected] wrote:It may be useful to have an option available to restart the Mopidy
service to deal with situations where the actor dies unexpectedly (e.g. due
to a misbehaving backend extension).This would be quicker than having to do a full reboot, and easier than
having to log in to the terminal to issue the command manually.It probably means just adding WebServiceRestartRequestHandler that does service
mopidy restart, similar to
mopidy-websettings/mopidy_websettings/__init__.py
Lines 143 to 151 in 1c55d94
?—
Reply to this email directly or view it on GitHub
#17.
from mopidy-websettings.
Yes you may be thinking of monit.
The problem is that the Mopidy actor may be dead even though Mopidy itself keeps on responding on port 6680 (which is what monit checks for). This means that if an internal Mopidy error occurs that causes certain extensions to stop working monit will not always pick up on it.
I haven't been able to figure out how to get the service to restart itself though. Simply spawning a separate process to run the os command does not appear to be sufficient as the SIGTERM signal is propagated to all subprocesses, which means they all die when the main process goes down.
from mopidy-websettings.
That is a good point.
You can probably send a command to monit and have it do the restart but that's not very helpful if you don't have monit running.
Simply spawning a separate process to run the os command does not appear to be sufficient as the SIGTERM signal is propagated to all subprocesses, which means they all die when the main process goes down.
I think it needs to be a different process group to stop this happening. Or maybe just use python-daemon?
from mopidy-websettings.
I'm not getting anywhere with this. I tried creating a temporary shell script that ignores SIGTERM and creates a subprocess from within the script:
script = '''#!/bin/sh
python -c 'import subprocess, signal\nsignal.signal(signal.SIGTERM, signal.SIG_IGN)\nsubprocess.Popen(["service", "mopidy", "restart"])'
'''
script_file = tempfile.NamedTemporaryFile('wt')
script_file.write(script)
script_file.flush()
subprocess.call(["sh", script_file.name], close_fds=True)
This, and everything else I've tried, just dies along with the main mopidy process.
Messing with the process groups and dealing with sessions and orphans seems pretty complicated (http://linux.die.net/man/2/setpgid).
Does anybody have any code examples that we could perhaps use as a baseline?
from mopidy-websettings.
Related Issues (20)
- Technical issue: default values for booleans are ignored
- Feature Request: Google music all access toggle in web ui
- Question: Can I use it? HOT 3
- Pip install gives build Error HOT 2
- Remove "Resize filesystem" option
- Examples for Autoplay Url
- Highlight the need to change the root password
- Style the apply settings page
- Updates for PiMusicbox v0.7
- spotify connect HOT 2
- Can't connect (404 Not Found?) HOT 4
- Https jquery or local library HOT 1
- "And make sure the http extension is working"
- Multiline config options not supported HOT 6
- Mopidy-Websettings does not appear to be recognised as installed HOT 2
- Mopidy wont find Websettings Frontend HOT 13
- Include jquery HOT 1
- Can't load config file on FreeNas jail HOT 1
- Extension throws an 500: Internal Server Error HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mopidy-websettings.