|
Feature Request: Re-Scan/inotify
|
|
24-04-2012, 19:14
Post: #8
|
|||
|
|||
RE: Feature Request: Re-Scan/inotify
(24-04-2012 17:55)KoS Wrote:Quote:A simple solution would be to add a new MinimWatch command "sleep <n>" to sleep for <n> seconds. You could include this in the echo string to provide the necessary delay. Would this be suitable?i thought also about that, but somehow i don't know how to combine the two so that i works like it should: You would do the following: Code: echo -e "sleep 5\nrestart\nsleep 10\nexit" | java -jar /opt/minimserver/lib/minimwatch.jarMinimWatch will start and process the "sleep 5" command immediately. It will wait 5 seconds (while MinimServer is discovered), then it will process the "restart" command. It will wait 10 seconds (while MinimServer restarts), then it will process the "exit" command. You can adjust the two sleep times based on how long things take in your setup. I've written some prototype code to test this, and it works very well. Quote:if there are multiple minimserver on the network, will then always the local one be choosen as the first? so that the restart command restart the local one? No, the selection of a MinimServer instance will be random, based on which MinimServer instance responds first to the M-SEARCH discovery message. So this approach doesn't work if you'll be running multiple MinimServer instances. It would be possible to extend MinimWatch to allow it to select a specific MinimServer instance (based on the displayName). With this, you'd need to use a command string like: Code: echo -e "sleep 5\nselect server1\nrestart\nsleep 10\nexit" | java -jar /opt/minimserver/lib/minimwatch.jarQuote:or would it be possible to make it like for other unix daemons where a SIGHUP signal to the minimserver would force it to reload, or rescan, the media library? There's a problem with this, because some NAS versions of Linux send a SIGHUP to MinimServer on exit from the shell that started MinimServer (even if MinimServer was started as a background process). To prevent this SIGHUP from ending the MinimServer process, I've added a --nohup option to MinimServer that makes it ignore SIGHUP. This is equivalent to using the nohup program to launch MinimServer. I presume that a Linux daemon that uses SIGHUP to reload its configuration would also reload its configuration when the shell that started the daemon exits. This doesn't seem ideal. How do these Linux daemons handle this? Quote:i think i can live with it if it's possible to force the rescan by a script. so i can write an inotify-script that then forces the rescan. OK, that makes sense. Quote:i'll add some bug reports & feature requests as separate threads, i hope thats fine? Please go ahead and do that. It's definitely a good idea to use a separate thread for each topic. |
|||
|
« Next Oldest | Next Newest »
|
| Messages In This Thread |
|
Feature Request: Re-Scan/inotify - KoS - 26-03-2012, 11:30
RE: Feature Request: Re-Scan/inotify - simoncn - 26-03-2012, 12:19
RE: Feature Request: Re-Scan/inotify - KoS - 26-03-2012, 13:57
RE: Feature Request: Re-Scan/inotify - simoncn - 26-03-2012, 17:51
RE: Feature Request: Re-Scan/inotify - KoS - 24-04-2012, 12:03
RE: Feature Request: Re-Scan/inotify - simoncn - 24-04-2012, 14:54
RE: Feature Request: Re-Scan/inotify - KoS - 24-04-2012, 17:55
RE: Feature Request: Re-Scan/inotify - KoS - 30-04-2012, 14:55
RE: Feature Request: Re-Scan/inotify - simoncn - 30-04-2012, 18:48
RE: Feature Request: Re-Scan/inotify - KoS - 16-07-2012, 11:26
RE: Feature Request: Re-Scan/inotify - alegend - 23-12-2012, 18:49
RE: Feature Request: Re-Scan/inotify - winxi - 24-12-2012, 10:34
RE: Feature Request: Re-Scan/inotify - alegend - 24-12-2012, 13:18
|
User(s) browsing this thread: 2 Guest(s)

Search
Member List
Calendar
Help



