1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/plume_ynh.git synced 2024-09-03 20:15:54 +02:00

Fix Service logs

This commit is contained in:
yalh76 2019-02-02 00:33:42 +01:00
parent ee285b8eca
commit 8e2027b5ee
3 changed files with 20 additions and 6 deletions

View file

@ -5,8 +5,9 @@ After=network.target
[Service]
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__FINALPATH__/__APP__
ExecStart=__FINALPATH__/.cargo/bin/plume
ExecStart=/bin/sh -c '__FINALPATH__/.cargo/bin/plume >> /var/log/__APP__/__APP__.log 2>&1'
TimeoutSec=30
Restart=always

View file

@ -181,13 +181,17 @@ ynh_system_user_create "$app" "$final_path"
#=================================================
# SPECIFIC SETUP
#=================================================
# ...
# CREATE LOG FOLDER
#=================================================
# setup application config
sudo cp ../conf/.env $final_path/$app/.env
mkdir -p "/var/log/$app"
chown -R "$app":"$app" "/var/log/$app"
#=================================================
# MODIFY A CONFIG FILE
#=================================================
# setup application config
sudo cp "../conf/.env" "$final_path/$app/.env"
ynh_replace_string "__DBNAME__" "$db_name" "$final_path/$app/.env"
ynh_replace_string "__PSQLPWD__" "$db_pwd" "$final_path/$app/.env"
ynh_replace_string "__DOMAIN__" "$domain" "$final_path/$app/.env"
@ -195,10 +199,12 @@ ynh_replace_string "__PORT__" "$port" "$final_path/$app/.env"
ynh_replace_string "__DB_USER__" "$app" "$final_path/$app/.env"
ynh_replace_string "__KEY__" "$random_key" "$final_path/$app/.env"
#=================================================
# MAKE SETUP
#=================================================
# Set right permissions
chown -R $app: $final_path
chown -R "$app":"$app" $final_path
# App settings
( cd $final_path && sudo -u "$app" RUSTUP_HOME=$final_path/.rustup CARGO_HOME=$final_path/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=nightly' )

View file

@ -104,6 +104,7 @@ ynh_install_app_dependencies gettext postgresql postgresql-contrib libpq-dev git
ynh_restore_file "/etc/systemd/system/$app.service"
systemctl enable $app.service
systemctl daemon-reload
#Fix Your search index is locked.
@ -136,6 +137,12 @@ 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