mirror of
				https://github.com/ClusterCockpit/cc-metric-collector.git
				synced 2025-11-04 02:35:07 +01:00 
			
		
		
		
	Add/Remove clustercockpit user and group in RPM
This commit is contained in:
		@@ -39,12 +39,26 @@ install -Dpm 0600 scripts/%{name}.config %{buildroot}%{_sysconfdir}/default/%{na
 | 
			
		||||
%check
 | 
			
		||||
# go test should be here... :)
 | 
			
		||||
 | 
			
		||||
%pre
 | 
			
		||||
getent group clustercockpit >/dev/null || groupadd -r clustercockpit
 | 
			
		||||
getent passwd clustercockpit >/dev/null || \
 | 
			
		||||
    useradd -r -g clustercockpit -d /nonexistent -s /sbin/nologin \
 | 
			
		||||
    -c "Create system user and group for CC metric collector" clustercockpit
 | 
			
		||||
exit 0
 | 
			
		||||
 | 
			
		||||
%post
 | 
			
		||||
%systemd_post %{name}.service
 | 
			
		||||
 | 
			
		||||
%preun
 | 
			
		||||
%systemd_preun %{name}.service
 | 
			
		||||
 | 
			
		||||
%postun
 | 
			
		||||
if [ "$1" = "1" ]; then
 | 
			
		||||
getent passwd clustercockpit >/dev/null && userdel clustercockpit
 | 
			
		||||
getent group clustercockpit >/dev/null && groupdel clustercockpit
 | 
			
		||||
fi
 | 
			
		||||
exit 0
 | 
			
		||||
 | 
			
		||||
%files
 | 
			
		||||
%dir %{_sysconfdir}/%{name}
 | 
			
		||||
%{_sbindir}/%{name}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user