diff --git a/conf/systemd.service b/conf/systemd.service index cfb9b2b..b7bfb55 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,10 +7,11 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=__NODEJS_PATH__/node __FINALPATH__/tiddlywiki monwiki --listen port=__port__ authenticated-user-header=basic -Restart=always -Environment=PATH=/usr/bin:/usr/local/bin:__NODEJS_PATH__ +Environment="PATH=__ENV_PATH__" Environment=NODE_ENV=production +ExecStart=__YNH_NPM__ __FINALPATH__/tiddlywiki monwiki --listen port=__port__ authenticated-user-header=basic +Restart=always [Install] WantedBy=multi-user.target + diff --git a/scripts/install b/scripts/install index d57ea80..6d0a975 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path ynh_script_progression --message="tiddlywiki..." --weight=2 pushd $final_path - $nodejs_path/node $final_path/tiddlywiki monwiki --init server + $ynh_node $final_path/tiddlywiki monwiki --init server popd #================================================= @@ -106,8 +106,6 @@ popd #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/systemd.service" -ynh_replace_string --match_string="__port__" --replace_string="$port" --target_file="../conf/systemd.service" ynh_add_systemd_config #================================================= @@ -131,7 +129,7 @@ yunohost service add $app --description="Collaborative editor" --log="/var/log/$ #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started TiddlyWiki: interactive wiki." #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 612cf43..0ad1afa 100755 --- a/scripts/restore +++ b/scripts/restore @@ -100,8 +100,7 @@ yunohost service add $app --description="" --log="/var/log/$app/$app.log" #================================================= ynh_print_info --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="" - +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started TiddlyWiki: interactive wiki." #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 9dd4942..98322d5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -126,7 +126,7 @@ chown -R $app: $final_path #================================================= ynh_print_info --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="Started TiddlyWiki: interactive wiki." #================================================= # RELOAD NGINX