if [ $1 -gt 1 ] ; then
systemctl stop tef-simulator.socket
systemctl stop tef-simulator.service
+ if systemctl list-unit-files tef-simulator-debugproxy.service | grep tef-simulator ; then
+ systemctl stop tef-simulator-debugproxy.socket
+ systemctl stop tef-simulator-debugproxy.service
+ fi
fi
%post
systemctl stop tef-simulator.socket
systemctl stop tef-simulator.service
systemctl disable tef-simulator.socket
+ systemctl stop tef-simulator-debugproxy.socket
+ systemctl stop tef-simulator-debugproxy.service
+ systemctl disable tef-simulator-debugproxy.socket
fi
%postun
%attr(770,root,security_fw) %{tastore_dir}
%attr(444,security_fw,security_fw) %{_unitdir}/tef-simulator.service
%attr(444,security_fw,security_fw) %{_unitdir}/tef-simulator.socket
+%attr(444,security_fw,security_fw) %{_unitdir}/tef-simulator-debugproxy.service
+%attr(444,security_fw,security_fw) %{_unitdir}/tef-simulator-debugproxy.socket
%attr(755,security_fw,security_fw) %{lib_dir}/tef/simulator/libteec.so
%attr(770,root,security_fw) %{talog_dir}
%attr(770,root,security_fw) %{storage_dir}
==================
- Make a new daemon - tef-simulator-debugproxy
- Runs with `System` label, as `security_fw` user, exposes a
- `/var/run/tef-simulator-debugproxy` socket
+ `/var/run/simdaemon-debugproxy` socket
- The socket has a `security_fw` owner and group, `0660` permissions
- When launching a TA in debug mode, tef-simulator opens the debugproxy socket
and tells the debugproxy which port it should listen to
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/tef-simulator.service.in
${CMAKE_SOURCE_DIR}/systemd/tef-simulator.service @ONLY)
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/systemd/tef-simulator-debugproxy.service.in
+ ${CMAKE_SOURCE_DIR}/systemd/tef-simulator-debugproxy.service @ONLY)
INSTALL(FILES
${CMAKE_SOURCE_DIR}/systemd/tef-simulator.service
${CMAKE_SOURCE_DIR}/systemd/tef-simulator.socket
+ ${CMAKE_SOURCE_DIR}/systemd/tef-simulator-debugproxy.service
+ ${CMAKE_SOURCE_DIR}/systemd/tef-simulator-debugproxy.socket
DESTINATION
${SYSTEMD_UNIT_DIR}
)
--- /dev/null
+[Unit]
+Description=TEF Simulator Daemon debug proxy
+Requires=tef-simulator-debugproxy.socket
+DefaultDependencies=no
+
+[Service]
+User=security_fw
+Group=security_fw
+CapabilityBoundingSet=
+SmackProcessLabel=System
+ExecStart=@SYSTEMD_CFG_BIN_DIR@/tef-simulator-debugproxy
+RuntimeDirectory=@SERVICE_NAME@
+
+[Install]
+WantedBy=multi-user.target