[fix] Check if package is actually uninstalling in preun and postun
This commit is contained in:
parent
8fb7ce644c
commit
f02648ccfc
|
@ -26,19 +26,17 @@ Netoik rest API server
|
||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
useradd --no-create-home --system --user-group %{name}
|
id %{name} || useradd --no-create-home --system --user-group %{name}
|
||||||
|
|
||||||
%post
|
%post
|
||||||
systemctl stop %{name}-server.service
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl start %{name}-server.service
|
systemctl restart %{name}-server.service
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
systemctl stop %{name}-server.service
|
$1 -eq 0 && systemctl stop %{name}-server.service
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
systemctl daemon-reload
|
$1 -eq 0 && systemctl daemon-reload && userdel %{name}
|
||||||
userdel %{name}
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%attr(755, root, root) %dir %{_var}/%{name}
|
%attr(755, root, root) %dir %{_var}/%{name}
|
||||||
|
|
Loading…
Reference in New Issue