diff --git a/conf/systemd.service b/conf/systemd.service index 35c2d16..eb1c958 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=__NODEJS_PATH__/node __FINALPATH__/server >> /var/log/__APP__/__APP__.log 2>&1 +ExecStart=/bin/sh -c '__NODEJS_PATH__/node __FINALPATH__/server >> /var/log/__APP__/__APP__.log 2>&1' [Install] WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index ab0b3f5..3eb34c6 100644 --- a/scripts/install +++ b/scripts/install @@ -170,9 +170,17 @@ ynh_system_user_create "$app" "$final_path" #================================================= # SPECIFIC SETUP #================================================= -# ... +# CREATE LOG FOLDER #================================================= +mkdir -p "/var/log/$app" +chown -R "$app":"$app" "/var/log/$app" + +#================================================= +# MAKE SETUP +#================================================= + + chown -R "$app":"$app" "$final_path" pushd $final_path diff --git a/scripts/restore b/scripts/restore index 0005bb5..4151059 100644 --- a/scripts/restore +++ b/scripts/restore @@ -101,6 +101,7 @@ ynh_install_nodejs 10 ynh_restore_file "/etc/systemd/system/$app.service" systemctl enable $app.service +systemctl daemon-reload #================================================= # ADVERTISE SERVICE IN ADMIN PANEL @@ -129,6 +130,13 @@ ynh_restore_file "/etc/logrotate.d/$app" #systemctl reload php5-fpm systemctl reload nginx +#================================================= +# CREATE LOG FOLDER +#================================================= + +mkdir -p "/var/log/$app" +chown -R "$app":"$app" "/var/log/$app" + #================================================= # START SERVICE #=================================================