From 4f0db8bc9c93f0b87b9e7cd54e0307c5c6aab39e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 20 Nov 2018 16:57:44 -0700 Subject: [PATCH] continue when systemd --user fails --- usr/share/install_helper.sh | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/usr/share/install_helper.sh b/usr/share/install_helper.sh index e92f8ed..19655fd 100644 --- a/usr/share/install_helper.sh +++ b/usr/share/install_helper.sh @@ -493,16 +493,22 @@ elif [ "systemd" == "$my_system_launcher" ]; then else echo -n "." fi - systemctl --user daemon-reload - # enable also puts success output to stderr... why? - systemctl --user enable $my_app >/dev/null 2>/dev/null - #echo " > systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer" - #systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer - if [ -n "${TELEBIT_DEBUG}" ]; then - echo " > systemctl --user start $my_app" + set +e + if systemctl --user daemon-reload; then + # enable also puts success output to stderr... why? + systemctl --user enable $my_app >/dev/null 2>/dev/null + #echo " > systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer" + #systemctl --user enable systemd-tmpfiles-setup.service systemd-tmpfiles-clean.timer + if [ -n "${TELEBIT_DEBUG}" ]; then + echo " > systemctl --user start $my_app" + fi + systemctl --user stop $my_app >/dev/null 2>/dev/null + systemctl --user start $my_app >/dev/null + else + echo "libpam-systemd is missing, which is required on Linux to register Telebit with the user launcher." + echo "sudo apt-install -y libpam-systemd" + sudo apt-install -y libpam-systemd fi - systemctl --user stop $my_app >/dev/null 2>/dev/null - systemctl --user start $my_app >/dev/null sleep 2; # give it time to start _is_running=$(systemctl --user status --no-pager $my_app 2>/dev/null | grep "active.*running") if [ -z "$_is_running" ]; then @@ -510,6 +516,7 @@ elif [ "systemd" == "$my_system_launcher" ]; then systemctl --user status --no-pager $my_app exit 1 fi + set -e echo -n "." else