mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	contrib: rc.archlinux.asterisk uses invalid redirect.
`rc.archlinux.asterisk`, which explicitly requests bash in its
shebang, uses the following command syntax:
  ${DAEMON} -rx "core stop now" > /dev/null 2&>1
The intent of which is to execute:
  ${DAEMON} -rx "core stop now"
While sending both stdout and stderr to `/dev/null`. Unfortunately,
because the `&` is in the wrong place, bash is interpreting the `2` as
just an additional argument to the `$DAEMON` command and not as a file
descriptor and proceeds to use the bashism `&>` to send stderr and
stdout to a file named `1`.
So we clean it up and just use bash's shortcut syntax.
Issue raised and a fix suggested (but not used) by peutch on GitHub¹.
ASTERISK-30449 #close
1. https://github.com/asterisk/asterisk/pull/31
Change-Id: Ie279bf4efb4d95cbf507313483d316e977303d19
(cherry picked from commit 5283d444d9)
			
			
This commit is contained in:
		
				
					committed by
					
						 Asterisk Development Team
						Asterisk Development Team
					
				
			
			
				
	
			
			
			
						parent
						
							86c9ee22f8
						
					
				
				
					commit
					2268895b88
				
			| @@ -45,7 +45,7 @@ case "$1" in | ||||
|   stop) | ||||
|     if [ -r ${ASTVARRUNDIR}/asterisk.pid ]; then | ||||
|       stat_busy "Stopping Asterisk..." | ||||
|       ${DAEMON} -rx "core stop now" > /dev/null 2&>1 | ||||
|       ${DAEMON} -rx "core stop now" &>/dev/null | ||||
|       if [ $? -gt 0 ]; then | ||||
|         stat_fail | ||||
|       else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user