Skip to content

Commit

Permalink
fix(distrib): Fixed Kura SystemD Unit dependencies (#5623)
Browse files Browse the repository at this point in the history
Added kura.service for NN; updated unit deps

Signed-off-by: pierantoniomerlino <[email protected]>
  • Loading branch information
pierantoniomerlino authored Jan 8, 2025
1 parent 88a6ed1 commit 087eda8
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
11 changes: 10 additions & 1 deletion kura/distrib/src/main/ant/build_equinox_distrib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,19 @@ fi]]>
<copy file="src/main/resources/common/kura.service"
tofile="${project.build.directory}/${build.output.name}/kura.service"
failonerror="false" />
<copy file="src/main/resources/common/kura.service.nn"
tofile="${project.build.directory}/${build.output.name}/kura.service.nn"
failonerror="false" />
<replaceregexp
file="${project.build.directory}/${build.output.name}/kura_install.sh"
match="INSTALL_DIR=.*" replace="INSTALL_DIR=${kura.install.dir}" />
<replaceregexp
file="${project.build.directory}/${build.output.name}/kura.service"
match="INSTALL_DIR" replace="${kura.install.dir}" />

<replaceregexp
file="${project.build.directory}/${build.output.name}/kura.service.nn"
match="INSTALL_DIR" replace="${kura.install.dir}" />

<zip destfile="${project.build.directory}/${build.output.name}.zip">

<zipfileset
Expand Down Expand Up @@ -449,6 +455,9 @@ fi]]>
<zipfileset
file="${project.build.directory}/${build.output.name}/kura.service"
prefix="${build.output.name}/${install.folder}" />
<zipfileset
file="${project.build.directory}/${build.output.name}/kura.service.nn"
prefix="${build.output.name}/${install.folder}" />
<zipfileset file="src/main/resources/${build.name}/firewall.service"
prefix="${build.output.name}/${install.folder}" filemode="700" />
<zipfileset file="src/main/resources/${build.name}/firewall.init"
Expand Down
2 changes: 1 addition & 1 deletion kura/distrib/src/main/resources/aarch64-nn/kura_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions kura/distrib/src/main/resources/common/kura.service
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 20 additions & 0 deletions kura/distrib/src/main/resources/common/kura.service.nn
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kura/distrib/src/main/resources/x86_64-nn/kura_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 087eda8

Please sign in to comment.