diff --git a/conf/systemd.service b/conf/systemd.service index 71b2c4e..6033abb 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,10 +6,10 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -Environment=PATH=/usr/bin:/usr/local/bin:__NODEJS_PATH__ -Environment=NODE_ENV=production WorkingDirectory=__FINALPATH__ -ExecStart=__NODEJS_PATH__/node __FINALPATH__/tiddlywiki mywiki --listen port=__port__ authenticated-user-header=basic +Environment="NODE_ENV=production" +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=__FINALPATH__/ mywiki --listen port=__port__ authenticated-user-header=basic Restart=always [Install] diff --git a/scripts/install b/scripts/install index 32a68c1..6203265 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,8 @@ 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 + #$nodejs_path/node $final_path/tiddlywiki mywiki --init server + ynh_exec_as $app env "$ynh_node_load_PATH" $final_path/ mywiki --init server popd #================================================= @@ -106,7 +107,7 @@ popd #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_add_systemd_config +ynh_add_systemd_config --others_var="ynh_node_load_PATH" #================================================= # GENERIC FINALIZATION