--- a
+++ b/main/trunk/platform/unix/rpm_preun.txt
@@ -0,0 +1,17 @@
+# Remove rxapi service
+if [ -x /usr/bin/systemctl ]; then
+   systemctl stop rxapid.service
+   rm -f /etc/systemd/system/rxapid.service
+   systemctl --system daemon-reload
+elif [ -x /sbin/insserv ]; then
+   service rxapid stop
+   # try insserv first (for Suse)
+   insserv -f rxapid
+   # Remove the rxapi daemon
+   rm -f /etc/init.d/rxapid
+else
+   service rxapid stop
+   chkconfig --del rxapid
+   rm -f /etc/init.d/rxapid
+fi
+rm -f %{_bindir}/rexxtry.rex