From 1126f1ffc91a303c4d22cd7b6005b2bcf86914f3 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Thu, 11 Jul 2024 23:49:02 -0700 Subject: [PATCH] fix(install): use /usr/sbin as install path and fix systemd dependency (#245) --- hack/dist/systar.sh | 4 ++-- resources/bundle/install.sh | 6 +++--- resources/bundle/uninstall.sh | 2 +- resources/openrc/kratad | 2 +- resources/openrc/kratanet | 2 +- resources/systemd/kratanet.service | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hack/dist/systar.sh b/hack/dist/systar.sh index eb83be6..168a190 100755 --- a/hack/dist/systar.sh +++ b/hack/dist/systar.sh @@ -22,9 +22,9 @@ tar xf "${OUTPUT_DIR}/bundle-systemd-${TARGET_ARCH}.tgz" mkdir sys cd sys -mkdir -p usr/bin usr/libexec +mkdir -p usr/bin usr/sbin mv ../krata/kratactl usr/bin -mv ../krata/kratanet ../krata/kratad usr/libexec/ +mv ../krata/kratanet ../krata/kratad usr/sbin/ if [ "${SYSTAR_VARIANT}" = "openrc" ] then diff --git a/resources/bundle/install.sh b/resources/bundle/install.sh index 32946a1..62eea59 100755 --- a/resources/bundle/install.sh +++ b/resources/bundle/install.sh @@ -23,11 +23,11 @@ remove_service_if_exists kratanet.service cp kratad.service /usr/lib/systemd/system/kratad.service cp kratanet.service /usr/lib/systemd/system/kratanet.service -cp kratad kratanet /usr/libexec +cp kratad kratanet /usr/sbin cp kratactl /usr/bin -chmod +x /usr/libexec/kratad -chmod +x /usr/libexec/kratanet +chmod +x /usr/sbin/kratad +chmod +x /usr/sbin/kratanet chmod +x /usr/bin/kratactl mkdir -p /var/lib/krata /usr/share/krata/guest diff --git a/resources/bundle/uninstall.sh b/resources/bundle/uninstall.sh index 927677e..2077469 100755 --- a/resources/bundle/uninstall.sh +++ b/resources/bundle/uninstall.sh @@ -8,5 +8,5 @@ rm -f /usr/lib/systemd/system/kratad.service rm -f /usr/lib/systemd/system/kratanet.service rm -f /usr/bin/kratactl -rm -f /usr/libexec/kratad /usr/libexec/kratanet +rm -f /usr/sbin/kratad /usr/sbin/kratanet rm -rf /usr/share/krata diff --git a/resources/openrc/kratad b/resources/openrc/kratad index 4c480ee..9d2015c 100644 --- a/resources/openrc/kratad +++ b/resources/openrc/kratad @@ -1,6 +1,6 @@ #!/sbin/openrc-run description="Krata Isolation Engine" -command="/usr/libexec/kratad" +command="/usr/sbin/kratad" supervisor="supervise-daemon" output_log="/var/log/kratad.log" error_log="/var/log/kratad.err" diff --git a/resources/openrc/kratanet b/resources/openrc/kratanet index 79fbfa5..26f87ab 100644 --- a/resources/openrc/kratanet +++ b/resources/openrc/kratanet @@ -1,6 +1,6 @@ #!/sbin/openrc-run description="Krata Networking Daemon" -command="/usr/libexec/kratanet" +command="/usr/sbin/kratanet" supervisor="supervise-daemon" output_log="/var/log/kratanet.log" error_log="/var/log/kratanet.err" diff --git a/resources/systemd/kratanet.service b/resources/systemd/kratanet.service index e1a2489..b9bb2e7 100644 --- a/resources/systemd/kratanet.service +++ b/resources/systemd/kratanet.service @@ -1,9 +1,9 @@ [Unit] Description=Krata Networking Engine - -[Service] Wants=kratad.service After=kratad.service + +[Service] Restart=on-failure Type=simple ExecStart=/usr/sbin/kratanet