diff --git a/conf/systemd.service b/conf/systemd.service index a7fbff7..a469cbb 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,9 +7,9 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=__FINALPATH__/server/index.js +ExecStart=node__FINALPATH__/server/index.js Restart=always -Environment=PATH=/usr/bin:/usr/local/bin +Environment=PATH=/usr/bin:/usr/local/bin:__NODEJS_PATH__ Environment=NODE_ENV=production [Install] diff --git a/scripts/install b/scripts/install index e53b295..e4cb182 100644 --- a/scripts/install +++ b/scripts/install @@ -199,6 +199,7 @@ ynh_print_info "Configuring a systemd service ..." ### - And the section "SETUP SYSTEMD" in the upgrade script # Create a dedicated systemd config +ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service" ynh_add_systemd_config #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index d82e46b..39a97a5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -166,6 +166,7 @@ ynh_print_info "Upgrading logrotate configuration..." ynh_print_info "Upgrading systemd configuration..." # Create a dedicated systemd config +ynh_replace_string "__NODEJS_PATH__" "$nodejs_path" "../conf/systemd.service" ynh_add_systemd_config #=================================================