Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

asynchronous spin up

Featured Replies

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

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.

  • Author

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.

Are you trying to spin up ALL the disks?

 

  • Author

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. 

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

  • Author

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)

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.