January 26, 201214 yr Hello, on unraid 5, when I press the "stop" button what file does it use to stop the array and unmount all the drives? I have a couple of items i'd like to stop in order of a proper unmount. I edited the file rc.unRAID under "stop" but that didn't do the trick. Is there another file i need to edit to kill certain services when i press stop?
January 26, 201214 yr Hello, on unraid 5, when I press the "stop" button what file does it use to stop the array and unmount all the drives? I have a couple of items i'd like to stop in order of a proper unmount. I edited the file rc.unRAID under "stop" but that didn't do the trick. Is there another file i need to edit to kill certain services when i press stop? It does it from within emhttp. There is a "stop" event though, but you need scripts as it is expecting in the right directory structure to have them invoked. (I do not know the structure off-hand, sorry... The event you want is the pre-stop event that exists in later 5.0 betas, so your program can stop before the attempt to unmount the drives occur.
January 26, 201214 yr Author Thanks for the response. I have beta 14 running. in /usr/local/emhttp/plugins/webGui i don't see a pre-stop script Is this something I will have to build manually? Finally, how does cache_dirs shutdown properly when I press stop?
January 29, 201214 yr Author Hi, So far, I looked at the logs and it seems like the stop even first calls on this: Jan 29 10:34:43 kenny emhttp: shcmd (58): /usr/local/sbin/emhttp_event stopping_svcs Jan 29 10:34:43 kenny emhttp_event: stopping_svcs Jan 29 10:34:43 kenny emhttp: shcmd (59): ps axc | grep -q rpc.mountd Jan 29 10:34:43 kenny emhttp: _shcmd: shcmd (59): exit status: 1 Jan 29 10:34:43 kenny emhttp: Stop SMB... Jan 29 10:34:43 kenny emhttp: shcmd (60): /etc/rc.d/rc.samba stop |& logger Jan 29 10:34:43 kenny emhttp: Spinning up all drives... Jan 29 10:34:43 kenny emhttp: Sync filesystems... I looked at the emhttp_event file in /usr/local/sbin/ and the file seems "empty". What i mean, it's all hashed out. I am itnerested in this part of the file: # stopping_svcs # Occurs during cmdStop execution. # Nothing has actually been stopped yet, about to stop network services. But i don't know how to edit it or add items to it. I did a search but i can't filter through it because emhttp_event shows up in logs so it revealed way too many results. The wiki shows that it was introduced in Beta2 but there are not entries on how to use the file.
February 3, 201214 yr Author Hello, anyone know how to call emhttp_event or how to accomplish what i need to do?
February 5, 201214 yr Author I seem to have it figured out. Gotta unhash "Stopping_svcs" and anything below it will run. I guess the same is true for any other event. So I have my go script that looks like this; sed -i "/to stop network services./a /etc/rc.d/unraid.d/rc.unraid_swapfile stop" /usr/local/sbin/emhttp_event sed -i "/to stop network services./a /etc/rc.d/unraid.d/rc.unraid_mysqld stop" /usr/local/sbin/emhttp_event sed -i "/to stop network services./a stopping_svcs" /usr/local/sbin/emhttp_event It does the trick, now anytime i press the stop button, i don't have to telnet in and manually stop those processes.
Archived
This topic is now archived and is closed to further replies.