mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	terminate-psql-sessions: Allow running without sudo.
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							042893a448
						
					
				
				
					commit
					327b70cb19
				
			| @@ -15,7 +15,7 @@ tables="$(printf "'%s'," "${@//\'/\'\'}")" | ||||
| tables="${tables%,}" | ||||
|  | ||||
| if [ "$EUID" -eq 0 ]; then | ||||
|     sudo -u "$DEFAULT_USER" psql postgres "$DEFAULT_USER" <<EOF | ||||
|     su - "$DEFAULT_USER" -c "psql postgres '$DEFAULT_USER'" <<EOF | ||||
| SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname IN ($tables); | ||||
| EOF | ||||
| else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user