mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	add flow request
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16625 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		
							
								
								
									
										22
									
								
								xCAT/postscripts/xcatflowrequest
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								xCAT/postscripts/xcatflowrequest
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| #!/bin/bash | ||||
| # IBM(c) 2013  EPL license http://www.eclipse.org/legal/epl-v10.html | ||||
| # This routine when called, contacts xcatd.  It will return to the caller when xcatd is | ||||
| # ready to process the request | ||||
| # It is called by xcatdsklspost before calling getpostscripts.awk | ||||
| # it is called by remoteshell before calling getcredentials.awk | ||||
| # | ||||
| exec 13<>/dev/udp/$1/$2 | ||||
| echo "resourcerequest: xcatd" >&13 | ||||
| parpid=$$ | ||||
| touch /tmp/goahead.$parpid | ||||
| touch /tmp/killme.$parpid | ||||
| exec 2> /dev/null | ||||
| while ! grep 'resourcerequest: ok' /tmp/goahead.$parpid > /dev/null; do | ||||
| 	( | ||||
| 	  mypid=$BASHPID | ||||
| 	  (sleep $(((RANDOM%60)+120)).$((RANDOM%50)); if [ -f /tmp/killme.$parpid ]; then kill -TERM $mypid; fi) & | ||||
| 	  exec awk '{print $0 > "/tmp/goahead.'$parpid'";exit}' <&13 | ||||
| 	)	 | ||||
| done | ||||
| rm /tmp/killme.$parpid | ||||
|  | ||||
		Reference in New Issue
	
	Block a user