mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 23:19:06 +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
|
%check
|
||||||
# go test should be here... :)
|
# 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
|
%post
|
||||||
%systemd_post %{name}.service
|
%systemd_post %{name}.service
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%systemd_preun %{name}.service
|
%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
|
%files
|
||||||
%dir %{_sysconfdir}/%{name}
|
%dir %{_sysconfdir}/%{name}
|
||||||
%{_sbindir}/%{name}
|
%{_sbindir}/%{name}
|
||||||
|
Loading…
Reference in New Issue
Block a user