From 087eda8d416cbfd464badc3e830e4290b02d78cc Mon Sep 17 00:00:00 2001 From: Pierantonio Merlino Date: Wed, 8 Jan 2025 16:02:29 +0100 Subject: [PATCH] fix(distrib): Fixed Kura SystemD Unit dependencies (#5623) Added kura.service for NN; updated unit deps Signed-off-by: pierantoniomerlino --- .../src/main/ant/build_equinox_distrib.xml | 11 +++++++++- .../main/resources/aarch64-nn/kura_install.sh | 2 +- .../src/main/resources/common/kura.service | 4 ++-- .../src/main/resources/common/kura.service.nn | 20 +++++++++++++++++++ .../docker-x86_64-nn/kura_install.sh | 2 +- .../main/resources/x86_64-nn/kura_install.sh | 2 +- 6 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 kura/distrib/src/main/resources/common/kura.service.nn diff --git a/kura/distrib/src/main/ant/build_equinox_distrib.xml b/kura/distrib/src/main/ant/build_equinox_distrib.xml index 101715d9030..3c071969636 100644 --- a/kura/distrib/src/main/ant/build_equinox_distrib.xml +++ b/kura/distrib/src/main/ant/build_equinox_distrib.xml @@ -397,13 +397,19 @@ fi]]> + - + + + /lib/systemd/system/kura.service +sed "s|INSTALL_DIR|${INSTALL_DIR}|" ${INSTALL_DIR}/kura/install/kura.service.nn > /lib/systemd/system/kura.service systemctl daemon-reload systemctl enable kura chmod +x ${INSTALL_DIR}/kura/bin/*.sh diff --git a/kura/distrib/src/main/resources/common/kura.service b/kura/distrib/src/main/resources/common/kura.service index 08328645844..2f3303e425f 100644 --- a/kura/distrib/src/main/resources/common/kura.service +++ b/kura/distrib/src/main/resources/common/kura.service @@ -1,7 +1,7 @@ [Unit] Description=Kura -Wants=networking.service dbus.service -After=networking.service dbus.service +Wants=NetworkManager.service ModemManager.service dbus.service +After=NetworkManager.service ModemManager.service dbus.service [Service] User=kurad diff --git a/kura/distrib/src/main/resources/common/kura.service.nn b/kura/distrib/src/main/resources/common/kura.service.nn new file mode 100644 index 00000000000..87fcf47634c --- /dev/null +++ b/kura/distrib/src/main/resources/common/kura.service.nn @@ -0,0 +1,20 @@ +[Unit] +Description=Kura +Wants=dbus.service +After=dbus.service + +[Service] +User=kurad +Group=kurad +Type=forking +ExecStart=/bin/sh INSTALL_DIR/kura/bin/start_kura_background.sh +ExecStopPost=/bin/sh -c 'if [ -f /tmp/watchdog ]; then echo w > `cat /tmp/watchdog`; fi' +PIDFile=/var/run/kura.pid +Restart=on-failure +RestartSec=5 +SuccessExitStatus=143 +KillMode=process +AmbientCapabilities=cap_net_admin cap_net_raw cap_dac_override cap_dac_read_search cap_net_bind_service cap_sys_boot cap_kill cap_sys_module cap_sys_time cap_sys_tty_config cap_syslog + +[Install] +WantedBy=multi-user.target diff --git a/kura/distrib/src/main/resources/docker-x86_64-nn/kura_install.sh b/kura/distrib/src/main/resources/docker-x86_64-nn/kura_install.sh index 791a36568bf..52f277b3bdb 100644 --- a/kura/distrib/src/main/resources/docker-x86_64-nn/kura_install.sh +++ b/kura/distrib/src/main/resources/docker-x86_64-nn/kura_install.sh @@ -18,7 +18,7 @@ INSTALL_DIR=/opt/eclipse ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura #set up Kura init -sed "s|INSTALL_DIR|${INSTALL_DIR}|" ${INSTALL_DIR}/kura/install/kura.service > /lib/systemd/system/kura.service +sed "s|INSTALL_DIR|${INSTALL_DIR}|" ${INSTALL_DIR}/kura/install/kura.service.nn > /lib/systemd/system/kura.service systemctl daemon-reload systemctl enable kura chmod +x ${INSTALL_DIR}/kura/bin/*.sh diff --git a/kura/distrib/src/main/resources/x86_64-nn/kura_install.sh b/kura/distrib/src/main/resources/x86_64-nn/kura_install.sh index cb8437b4b27..c764204f990 100755 --- a/kura/distrib/src/main/resources/x86_64-nn/kura_install.sh +++ b/kura/distrib/src/main/resources/x86_64-nn/kura_install.sh @@ -33,7 +33,7 @@ INSTALL_DIR=/opt/eclipse ln -sf ${INSTALL_DIR}/kura_* ${INSTALL_DIR}/kura # set up kura init -sed "s|INSTALL_DIR|${INSTALL_DIR}|" ${INSTALL_DIR}/kura/install/kura.service > /lib/systemd/system/kura.service +sed "s|INSTALL_DIR|${INSTALL_DIR}|" ${INSTALL_DIR}/kura/install/kura.service.nn > /lib/systemd/system/kura.service systemctl daemon-reload systemctl enable kura chmod +x ${INSTALL_DIR}/kura/bin/*.sh