mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 23:06:04 +00:00 
			
		
		
		
	These can be added by other packages if they need to do something on clean shutdown. Crash only software can ignore this. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
		
			
				
	
	
		
			21 lines
		
	
	
		
			398 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			398 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| # execute other shutdown processes
 | |
| SHUTS="$(find /etc/shutdown.d -type f 2>/dev/null | sort)"
 | |
| for f in $SHUTS
 | |
| do
 | |
|         $f
 | |
| done
 | |
| 
 | |
| # kill all processes and unmount filesystems
 | |
| /usr/sbin/killall5 -15
 | |
| /bin/sleep 5
 | |
| /usr/sbin/killall5 -9
 | |
| /sbin/swapoff -a
 | |
| /bin/echo "Unmounting filesystems"
 | |
| /bin/umount -a -r
 | |
| 
 | |
| # shutdown or reboot
 | |
| [ "$1" = "reboot" ] && exec /sbin/reboot -f
 | |
| /sbin/poweroff -f
 |