mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	Generated by `pyupgrade --py3-plus --keep-percent-format` on all our Python code except `zthumbor` and `zulip-ec2-configure-interfaces`, followed by manual indentation fixes. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
		
			
				
	
	
		
			30 lines
		
	
	
		
			634 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			634 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env python3
 | |
| 
 | |
| import os
 | |
| import signal
 | |
| import sys
 | |
| 
 | |
| os.chdir(os.path.join(os.path.dirname(__file__), '..'))
 | |
| pid_file_path = os.path.join(os.path.join(os.getcwd(), 'var/run/run_dev.pid'))
 | |
| 
 | |
| try:
 | |
|     with open(pid_file_path) as pid_file:
 | |
|         try:
 | |
|             pid = int(pid_file.read())
 | |
|         except ValueError:
 | |
|             print('PID value is not an integer!')
 | |
|             sys.exit(1)
 | |
| except Exception as e:
 | |
|     print("PID file can't be opened!")
 | |
|     print(e)
 | |
|     sys.exit(1)
 | |
| 
 | |
| # Kill development server process group.
 | |
| try:
 | |
|     os.killpg(pid, signal.SIGTERM)
 | |
| except OSError as e:
 | |
|     print(e)
 | |
|     sys.exit(1)
 | |
| 
 | |
| print("Done")
 |