From d3951d7c6a584537c5feb0ce235b8927c6fa486b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Tue, 7 Nov 2017 16:00:56 -0700 Subject: [PATCH] fix installer once and for all? --- dist/etc/tmpfiles.d/walnut.conf | 11 ++--------- installer/install-for-systemd.sh | 9 ++++++++- installer/install.sh | 11 +++++------ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/dist/etc/tmpfiles.d/walnut.conf b/dist/etc/tmpfiles.d/walnut.conf index c6e1cbc..079634f 100644 --- a/dist/etc/tmpfiles.d/walnut.conf +++ b/dist/etc/tmpfiles.d/walnut.conf @@ -1,12 +1,5 @@ -# /etc/tmpfiles.d/walnut.conf +# /etc/tmpfiles.d/goldilocks.conf # See https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html # Type Path Mode UID GID Age Argument -#d /etc/walnut 0755 www-data www-data - - -#d /etc/ssl/walnut 0750 www-data www-data - - -#d /srv/walnut 0775 www-data www-data - - -#d /srv/www 0775 www-data www-data - - -#d /opt/walnut 0775 www-data www-data - - -#d /var/walnut 0775 www-data www-data - - -#d /var/log/walnut 0750 www-data www-data - - -#d /run/walnut 0755 www-data www-data - - +d /run/goldilocks 0755 MY_USER MY_GROUP - - diff --git a/installer/install-for-systemd.sh b/installer/install-for-systemd.sh index 17a0bee..1aab34f 100644 --- a/installer/install-for-systemd.sh +++ b/installer/install-for-systemd.sh @@ -11,6 +11,10 @@ sed "s/MY_USER/$my_user/g" "$my_app_dist/$my_app_systemd_service" > "$my_app_dis sed "s/MY_GROUP/$my_group/g" "$my_app_dist/$my_app_systemd_service.2" > "$my_app_dist/$my_app_systemd_service" rm "$my_app_dist/$my_app_systemd_service.2" safe_copy_config "$my_app_dist/$my_app_systemd_service" "$my_root/$my_app_systemd_service" + +sed "s/MY_USER/$my_user/g" "$my_app_dist/$my_app_systemd_tmpfiles" > "$my_app_dist/$my_app_systemd_tmpfiles.2" +sed "s/MY_GROUP/$my_group/g" "$my_app_dist/$my_app_systemd_tmpfiles.2" > "$my_app_dist/$my_app_systemd_tmpfiles" +rm "$my_app_dist/$my_app_systemd_tmpfiles.2" safe_copy_config "$my_app_dist/$my_app_systemd_tmpfiles" "$my_root/$my_app_systemd_tmpfiles" $sudo_cmd systemctl stop "${my_app_name}.service" >/dev/null 2>/dev/null || true @@ -18,6 +22,7 @@ $sudo_cmd systemctl daemon-reload $sudo_cmd systemctl start "${my_app_name}.service" $sudo_cmd systemctl enable "${my_app_name}.service" +echo "" echo "" echo "Fun systemd commands to remember:" echo " $sudo_cmd systemctl daemon-reload" @@ -25,4 +30,6 @@ echo " $sudo_cmd systemctl restart $my_app_name.service" echo "" echo "$my_app_name started with systemctl, check its status like so:" echo " $sudo_cmd systemctl status $my_app_name" -echo " $sudo_cmd journalctl -xe -u $my_app_name" +echo " $sudo_cmd journalctl -xefu $my_app_name" +echo "" +echo "" diff --git a/installer/install.sh b/installer/install.sh index 9180f0d..7897e9e 100644 --- a/installer/install.sh +++ b/installer/install.sh @@ -7,17 +7,16 @@ set -u ### VERSION ### my_name=walnut my_app_pkg_name=com.daplie.walnut.web -#my_app_ver="v1.1" -my_app_ver="installer-v2" +my_app_ver="v1.2" my_azp_oauth3_ver="v1.2" export NODE_VERSION="v8.9.0" if [ -z "${my_tmp-}" ]; then my_tmp="$(mktemp -d)" - mkdir -p $my_tmp/opt/$my_name/lib/node_modules/$my_name + mkdir -p $my_tmp/opt/$my_name/core echo "Installing to $my_tmp (will be moved after install)" - git clone ./ $my_tmp/opt/$my_name/lib/node_modules/$my_name - pushd $my_tmp/opt/$my_name/lib/node_modules/$my_name + git clone ./ $my_tmp/opt/$my_name/core + pushd $my_tmp/opt/$my_name/core fi ################# @@ -186,7 +185,7 @@ echo " api.cloud.example.com" echo "" echo "Check the WALNUT README.md for more info and how to set up /etc/goldilocks/goldilocks.yml" echo "" -echo "Unistall: rm -rf /srv/walnut/ /var/walnut/ /etc/walnut/ /opt/walnut/ /var/log/walnut/ /etc/systemd/system/walnut.service" +echo "Unistall: rm -rf /srv/walnut/ /var/walnut/ /etc/walnut/ /opt/walnut/ /var/log/walnut/ /etc/systemd/system/walnut.service /etc/tmpfiles.d/walnut.conf"