April 20, 201016 yr Does unRaid call up any script when you hit the stop array button or does it just issue the unmount cmd? The reason I am asking, I have several things that need to be stopped so that it actually possible to stop the array..
April 20, 201016 yr Does unRaid call up any script when you hit the stop array button or does it just issue the unmount cmd? It does a whole bunch of things that nobody knows. That part is not open source.
April 20, 201016 yr Author So no real way of automating any additional stuff that needs to happen so a proper stop array can work I have to check and see what unmenu does with it's stop array button..
April 20, 201016 yr So no real way of automating any additional stuff that needs to happen so a proper stop array can work Not as of the current version. That has been discussed a lot in the past. Hopefully in ver.5 there will be hooks for that. http://lime-technology.com/forum/index.php?topic=5686.0
April 20, 201016 yr So no real way of automating any additional stuff that needs to happen so a proper stop array can work Not as of the current version. That has been discussed a lot in the past. Hopefully in ver.5 there will be hooks for that. http://lime-technology.com/forum/index.php?topic=5686.0 The script in the thread purko linked to will work if you invoke it with the "-u" option It will invoke all the /etc/rc.d/unraid.d/rc.* scripts with either "start" or "stop" arguments just after starting the array, and just before stopping the array. The "rc.*" scripts in /etc/rc.d/unraid.d must be executable. If you have unmenu, and have any packages auto-installing, you can put the following line in a file named unraid_addon_control.auto_install in the /boot/packages directory and it will automatically start it when the array is booted. root@Tower:/boot/packages# cat unraid_addon_control.auto_install /boot/custom/bin/unraid_addon_control.sh -u In the same way, I have an rc_files.auto_install in /boot/packages that copies into place the two rc.* scripts I am using currently and makes them executable. It looks like this: root@Tower:/boot/packages# cat rc_files.auto_install mkdir -p /etc/rc.d/unraid.d cp /boot/custom/etc/rc.spinup_when_accessed /etc/rc.d/unraid.d/rc.spinup_when_accessed chmod +x /etc/rc.d/unraid.d/rc.spinup_when_accessed cp /boot/custom/etc/rc.cache_dirs /etc/rc.d/unraid.d/rc.cache_dirs chmod +x /etc/rc.d/unraid.d/rc.cache_dirs The rc.spinup_when_accessed and rc.cache_dirs scripts I keep in /boot/custom/etc/ and copy them into place in the above script. They look like this: root@Tower:/boot/packages# cat /boot/custom/etc/rc.cache_dirs case $1 in start) [ -x /boot/custom/bin/cache_dirs ] && /boot/custom/bin/cache_dirs -w -e data -e Pictures -B ;; stop) [ -x /boot/custom/bin/cache_dirs ] && /boot/custom/bin/cache_dirs -q ;; esac and this: root@Tower:/boot/packages# cat /boot/custom/etc/rc.spinup_when_accessed case $1 in start) [ -x /boot/custom/bin/spinup_when_accessed.sh ] && /boot/custom/bin/spinup_when_accessed.sh -e data -e Pictures -m "192.168.2.251" ;; stop) [ -x /boot/custom/bin/spinup_when_accessed.sh ] && /boot/custom/bin/spinup_when_accessed.sh -q ;; esac With those in place, you will have the ability to start and stop add-on processes. They will start after the array starts, and stop prior to the array stopping. You can have as many rc.* scripts as you like, one for each add-on to be started and stopped. This is all just until we get true triggers in unRAID 5.0, but all we should need to do is replace the unraid_addon_control.sh script and everything else will already be in place. All you need do is create equivalent rc.* scripts for your processes as the two examples above and copy them into place into /etc/rc.d/unraid.d/ and then make them executable, again as in the rc_files.auto_install file I have in my /boot/packages. unmenu already installs a line in your "go" script to invoke all the auto_install files in /boot/packages when you reboot, so everything is put into place. The unraid_addon_control.sh program will only work with recent (4.5.3 the prior beta) versions of unraid. Joe L.
Archived
This topic is now archived and is closed to further replies.