barrygordon Posted July 10, 2010 Share Posted July 10, 2010 I have a telnet driver that I wrote and incorporated in my Theater control system. When the theater starts up it will spinup the drives on the unRaid, and when the theater shuts down it spins them down. If the drive is spun down when I issue the spinup command (/root/mdcmd spinup n), the usual case, then the return from unraid to the telnet client is delayed until the drive has spun up. Is there some way that I can issue that operation or a different sequence to cause a drive to be spun up but to immediately return so that I get back to the prompt so I can issue the next spinup command. Will issuing the command with background processing requested (/root/mdcmd spinup n &) do what I want? Also is there any way to command a spinup of multiple drives with out using spinup groups. I may end up using spinup groups but right now I am just curious about direct command alternatives. I issue a sequence to wait till All the drives are spun up when I actually want to watch a movie. Any help appreciated. Addendum: Once again Joe L is ahead of me. It appears his "spinup when accessed" script may be just what I want. I need to study that and perhaps just adopt it as the control mechanism and drop the telnet interface. I would still like help in understanding re my original questions. Addendum 2: I still need the original help if possible as I would like to issue the commands when I know I am tuning on the Media player as opposed to using an iterated ping to ascertain player state. TIA Link to comment
BRiT Posted July 10, 2010 Share Posted July 10, 2010 You could run the command in a different thread. If you're using C, you could even go as primative as doing a Fork()/Exec() pair. Link to comment
barrygordon Posted July 10, 2010 Author Share Posted July 10, 2010 It looks like if I run the command in the background (/root/mdcmd spinup n &) then it does just what I want. I haven't coded "C" in decades. Link to comment
purko Posted July 10, 2010 Share Posted July 10, 2010 Are you trying to spin up ALL the disks? Link to comment
barrygordon Posted July 10, 2010 Author Share Posted July 10, 2010 Not necessarily, but at the current time due to the size of the array (4 drives), I do. Since I do not use spingroups and my librarian knows exactly which disk to spin up I can do it when the actual movie to watch is selected. That would imply a slight delay before the movies starts as I wait for the disks to fully spin up, or rather the media player waits. I have the flexibility and time to experiment. Currently all the disks are spun up when the theater is powered up, and spun down when the theater is shut off. I do double check before starting a movie that the disk needed is spun up to avoid a possible timeout on the player. If I can get that timeout extended (I did not write the player code) then I will just allow the access to spin it up. Link to comment
WeeboTech Posted July 11, 2010 Share Posted July 11, 2010 It looks like if I run the command in the background (/root/mdcmd spinup n &) then it does just what I want. I haven't coded "C" in decades. I would just do a fork. Have you looked at mdcmd. It's very simple. If you fork, in the child write the message to /proc/mdcmd then read the response and write it to syslog, you are done. #more /root/mdcmd #!/bin/bash # echo $* >/proc/mdcmd cat /proc/mdcmd >/tmp/mdresp cat /tmp/mdresp Link to comment
barrygordon Posted July 11, 2010 Author Share Posted July 11, 2010 Thanks for all the help guys. AFAICT it seems to be doing what I want by just adding the ampersand at the end of the spinup and spindown commands. The return to telnet is immediate and I just go on initializing the rest of the theater. By the time the PJ is wrmed up the drives are fully spun up and selecting a movie is as it should be (no spin delay) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.