mirror of
https://github.com/YunoHost-Apps/writefreely_ynh.git
synced 2024-09-03 20:36:02 +02:00
Switch from log files to journalctl
This commit is contained in:
parent
4adf6733f1
commit
cb0e112722
6 changed files with 13 additions and 24 deletions
|
@ -6,8 +6,11 @@ After=network.target
|
|||
Type=simple
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
WorkingDirectory=__FINALPATH__/
|
||||
ExecStart=/bin/sh -c '__FINALPATH__/writefreely >> /var/log/__APP__/__APP__.log 2>&1'
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
WorkingDirectory=__FINALPATH__
|
||||
ExecStart=__FINALPATH__/writefreely
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -73,7 +73,7 @@ ynh_mysql_dump_db "$db_name" > db.sql
|
|||
# BACKUP LOGROTATE
|
||||
#=================================================
|
||||
|
||||
ynh_backup "/etc/logrotate.d/$app"
|
||||
#ynh_backup "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP SYSTEMD
|
||||
|
|
|
@ -288,13 +288,6 @@ ynh_store_file_checksum "$final_path/config.ini"
|
|||
|
||||
#=================================================
|
||||
# SPECIFIC SETUP
|
||||
#=================================================
|
||||
# CREATE LOG FOLDER
|
||||
#=================================================
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app":"$app" "/var/log/$app"
|
||||
|
||||
#=================================================
|
||||
# MAKE SETUP
|
||||
#=================================================
|
||||
|
@ -333,7 +326,7 @@ chown -R "$app":"$app" "$final_path"
|
|||
### - And the section "SETUP LOGROTATE" in the upgrade script
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate
|
||||
#ynh_use_logrotate
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
|
@ -350,7 +343,7 @@ ynh_use_logrotate
|
|||
#yunohost service add $app --log "/var/log/$app/APP.log"
|
||||
|
||||
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
|
|
@ -91,7 +91,7 @@ ynh_remove_nginx_config
|
|||
#=================================================
|
||||
|
||||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
#ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# CLOSE A PORT
|
||||
|
@ -116,7 +116,7 @@ fi
|
|||
ynh_secure_remove "/etc/$app/"
|
||||
|
||||
# Remove the log files
|
||||
ynh_secure_remove "/var/log/$app/"
|
||||
#ynh_secure_remove "/var/log/$app/"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -114,7 +114,7 @@ systemctl daemon-reload
|
|||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log "/var/log/$app/$app.log"
|
||||
yunohost service add $app --description "$app daemon for WriteFreely" --log_type systemd
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE CRON FILE
|
||||
|
@ -126,7 +126,7 @@ yunohost service add $app --description "$app daemon for WriteFreely" --log "/va
|
|||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_restore_file "/etc/logrotate.d/$app"
|
||||
#ynh_restore_file "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
@ -137,13 +137,6 @@ 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
|
||||
#=================================================
|
||||
|
|
|
@ -166,7 +166,7 @@ fi
|
|||
#=================================================
|
||||
|
||||
# Use logrotate to manage app-specific logfile(s)
|
||||
ynh_use_logrotate --non-append
|
||||
#ynh_use_logrotate --non-append
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
|
|
Loading…
Add table
Reference in a new issue