This replicates some of the more important functionality of the defunct pvc-flush.service unit. On presence of a trigger file (i.e. /etc/pvc/autoready), it will trigger a "node ready" on boot. It does nothing on shutdown as this must be handled by other mechanisms, though a similar autoflush could be added as well.
		
			
				
	
	
		
			17 lines
		
	
	
		
			663 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			663 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/bin/sh
 | |
| 
 | |
| # Reload systemd's view of the units
 | |
| systemctl daemon-reload
 | |
| 
 | |
| # Enable the service and target
 | |
| systemctl enable /lib/systemd/system/pvcnoded.service
 | |
| systemctl enable /lib/systemd/system/pvcautoready.service
 | |
| systemctl enable /lib/systemd/system/pvc.target
 | |
| 
 | |
| # Inform administrator of the service restart/startup not occurring automatically
 | |
| if systemctl is-active --quiet pvcnoded.service; then
 | |
|     echo "NOTE: The PVC node daemon (pvcnoded.service) has not been restarted; this is up to the administrator."
 | |
| else
 | |
|     echo "NOTE: The PVC node daemon (pvcnoded.service) has not been started; create a config file at /etc/pvc/pvcnoded.yaml then start it."
 | |
| fi
 |