mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-10 04:27:25 +01:00
Add/Remove clustercockpit user and group in RPM
This commit is contained in:
parent
092e7f6a71
commit
0753c81156
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user