mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	 6c96269024
			
		
	
	
		6c96269024
		
			
		
	
	
	
	
		
			
			This reverts commit 79b20949b2 since it
doesn't work with the systemd version shipped with RHEL7-based systems.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #14943
Closes #14945
		
	
			
		
			
				
	
	
		
			16 lines
		
	
	
		
			448 B
		
	
	
	
		
			SYSTEMD
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			448 B
		
	
	
	
		
			SYSTEMD
		
	
	
	
	
	
| [Unit]
 | |
| Description=zpool trim on %i
 | |
| Documentation=man:zpool-trim(8)
 | |
| Requires=zfs.target
 | |
| After=zfs.target
 | |
| ConditionACPower=true
 | |
| ConditionPathIsDirectory=/sys/module/zfs
 | |
| 
 | |
| [Service]
 | |
| EnvironmentFile=-@initconfdir@/zfs
 | |
| ExecStart=/bin/sh -c '\
 | |
| if @sbindir@/zpool status %i | grep -q "(trimming)"; then\
 | |
| exec @sbindir@/zpool wait -t trim %i;\
 | |
| else exec @sbindir@/zpool trim -w %i; fi'
 | |
| ExecStop=-/bin/sh -c '@sbindir@/zpool trim -s %i 2>/dev/null || true'
 |