From d33d82adfe4873e8e4867557ae25f89acbe95f4d Mon Sep 17 00:00:00 2001 From: anmol26s Date: Mon, 1 Oct 2018 02:04:27 +0530 Subject: [PATCH] changed path while creating password --- conf/systemd.service | 3 ++- scripts/install | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 1c67d11..8f5be9d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,8 @@ Environment=NODE_ENV=production Environment=NODE_CONFIG_DIR=__FINALPATH__/config User=__APP__ Group=__APP__ -ExecStart=/bin/sh -c '/usr/bin/npm start' +Environment="PATH=__ENV_PATH__" +ExecStart=/bin/sh -c ' npm start' WorkingDirectory=__FINALPATH__/ StandardOutput=syslog StandardError=syslog diff --git a/scripts/install b/scripts/install index 63e9740..ae188e3 100644 --- a/scripts/install +++ b/scripts/install @@ -214,10 +214,13 @@ chown -R "$app":"$app" "$final_path" "$datadir" systemctl reload nginx + + #================================================= # SETUP SYSTEMD #================================================= +ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service" # Create a dedicated systemd config ynh_add_systemd_config systemctl enable "$app" @@ -231,7 +234,7 @@ systemctl start "$app" ( cd "$final_path" sleep 30 - echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production /usr/bin/npm run reset-password -- -u root + echo $admin_pass | NODE_CONFIG_DIR="$final_path/config" NODE_ENV=production npm run reset-password -- -u root ) #=================================================