Post Reply 
Feature Request: Re-Scan/inotify
26-04-2012, 16:29 (This post was last modified: 26-04-2012 16:46 by KoS.)
Post: #9
RE: Feature Request: Re-Scan/inotify
(24-04-2012 19:14)simoncn Wrote:  
(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:

Code:
sleep 5; echo 'restart' | java -jar /opt/minimserver/lib/minimwatch.jar
the sleep here delays the whole execution/start of minimwatch and not only the echo command :-(

You would do the following:
Code:
echo -e "sleep 5\nrestart\nsleep 10\nexit" | java -jar /opt/minimserver/lib/minimwatch.jar

MinimWatch 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. Smile
in the meantime i've now used a small expect script to do the restart :-)
Code:
#!/usr/bin/expect
spawn java -jar /opt/minimserver/lib/minimwatch.jar
sleep 5
send "restart\n"
sleep 3
send "exit\n"


Quote: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.jar
that would be the perfect combination/extension. or something like "select local1" or so... if somebody has an minim server running on the network too, i wouldn't be happy to restart his one ;-)

Quote:
Quote: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?
hmm.. haven't realized the problem with the SIGHUP when exiting from a shell. you could use instead another signal for the restart of the daemon, e.g. SIGUSR1 or SIGUSR2 ?



(24-04-2012 14:54)simoncn Wrote:  Kinsky works as you say on Windows. On iOS, if you browse up the hierarchy, Kinsky doesn't refresh what's displayed. So if you're looking at the contents of an album, and you browse up to the list of all albums, you'll see an old list of albums instead of a current list. If you browse down the hierarchy, Kinsky iOS does refresh the contents.
just tested it and you're right. sorry for the des-information :-( so they are missing a refresh button :-) the ChorusDSHD app on iOS has the sample problem with refreshing.. but at least it has an refresh button.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread

Forum Jump:


User(s) browsing this thread: 1 Guest(s)