mgutt Posted April 7, 2021 Share Posted April 7, 2021 Sending a disk to sleep is easy: mdcmd spindown 0 mdcmd spindown 1 ... I tried to reverse engineer the icon click, but was not successful. As an example. Clicking the icon calls "http://tower/webGui/include/ToggleState.php" with the following POST content: device=Device&name=cache&action=down&state=STARTED&csrf=blabla&csrf_token=blabla As "device" has been set to "Device" it calls this line in "ToggleState.php": if ($name) emhttpd("cmdSpin$action=$name"); else emhttpd("cmdSpin{$device}All=true"); Which executes curl: $ch = curl_init("http://127.0.0.1/update.htm?$cmd&startState=$state&csrf_token=$csrf"); curl_setopt_array($ch, [CURLOPT_UNIX_SOCKET_PATH => '/var/run/emhttpd.socket', CURLOPT_RETURNTRANSFER => true]); curl_exec($ch); The update.htm part confuses me as a static HTML page is not able to execute anything. Maybe this is rewritten through the NGINX webserver?! Whatever... I tried to find the "cmdSpin" string in the Unraid Source Code and was only successful in the unassigned devices plugin: function spin_disk($down, $dev) { if ($down) { exec("/usr/local/sbin/emcmd cmdSpindown=$dev"); } else { exec("/usr/local/sbin/emcmd cmdSpinup=$dev"); } } EDIT: Ok. This command works: /usr/local/sbin/emcmd cmdSpindown=cache Why isn't this mentioned anywhere? ^^ Quote Link to comment
T-Birth Posted July 15, 2022 Share Posted July 15, 2022 Simple Question: Is the labeling cache in the command to spindown every drive that is used as cache or should I adjust it per drive label ? Example: I have a cache drive explicitly for docker labeled "vmdockercache" Thanks. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.