From e462978154e90712999221788f723f6d1450dd8e Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 11 Dec 2017 22:24:26 +0000 Subject: [PATCH] install service before chown --- installer/install-for-systemd.sh | 2 ++ installer/install.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/installer/install-for-systemd.sh b/installer/install-for-systemd.sh index 1aab34f..95ce1b6 100644 --- a/installer/install-for-systemd.sh +++ b/installer/install-for-systemd.sh @@ -11,11 +11,13 @@ 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" +$sudo_cmd chown root:root "$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 chown root:root "$my_root/$my_app_systemd_tmpfiles" $sudo_cmd systemctl stop "${my_app_name}.service" >/dev/null 2>/dev/null || true $sudo_cmd systemctl daemon-reload diff --git a/installer/install.sh b/installer/install.sh index 958a877..1098f99 100644 --- a/installer/install.sh +++ b/installer/install.sh @@ -119,6 +119,8 @@ set -e source ./installer/my-user-my-group.sh echo "User $my_user Group $my_group" +source ./installer/install-system-service.sh + $sudo_cmd chown -R $my_user:$my_group $my_tmp/* $sudo_cmd chown root:root $my_tmp/* $sudo_cmd chown root:root $my_tmp @@ -126,7 +128,6 @@ $sudo_cmd chmod 0755 $my_tmp # don't change permissions on /, /etc, etc $sudo_cmd rsync -a --ignore-existing $my_tmp/ $my_root/ $sudo_cmd rsync -a --ignore-existing $my_app_dist/etc/$my_name/$my_name.yml $my_root/etc/$my_name/$my_name.yml -source ./installer/install-system-service.sh # Change to admin perms $sudo_cmd chown -R $my_user:$my_group $my_root/opt/$my_name