diff --git a/conf/systemd.service b/conf/systemd.service index baf1489..4072a8b 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=ztncui Group=ztncui -Environment="PATH=__PATH__" +Environment="PATH=__ENV_PATH__" WorkingDirectory=__FINALPATH__/src/ ExecStart=__NODEJS_PATH__/npm start diff --git a/scripts/install b/scripts/install index 19c9851..264834f 100644 --- a/scripts/install +++ b/scripts/install @@ -211,8 +211,10 @@ ynh_script_progression --message="Configuring a systemd service..." --time --wei ### - As well as the section "RESTORE SYSTEMD" in the restore script ### - And the section "SETUP SYSTEMD" in the upgrade script +# Store current PATH +env_path=$PATH # Create a dedicated systemd config -ynh_add_systemd_config_vars --others_var="path nodejs_path" +ynh_add_systemd_config_vars --others_var="env_path nodejs_path" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index e2a18a1..d683589 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -183,8 +183,10 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 +# Store current PATH +env_path=$PATH # Create a dedicated systemd config -ynh_add_systemd_config_vars --others_var="path nodejs_path" +ynh_add_systemd_config_vars --others_var="env_path nodejs_path" #================================================= # GENERIC FINALIZATION