1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

Configure logging to /var/log/ihatemoney

This commit is contained in:
Salamandar 2023-06-12 16:53:23 +02:00
parent 81a203bbd8
commit 85fbd43466
3 changed files with 16 additions and 0 deletions

View file

@ -6,10 +6,15 @@ After=network.target mysql.service
[Service]
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/
Environment=IHATEMONEY_SETTINGS_FILE_PATH=__INSTALL_DIR__/ihatemoney.cfg
ExecStart=__INSTALL_DIR__/venv/bin/gunicorn -c __INSTALL_DIR__/gunicorn.conf.py ihatemoney.wsgi:application
Restart=always
RestartSec=2
StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit
[Install]
WantedBy=multi-user.target

View file

@ -64,6 +64,10 @@ ynh_add_config --template="../conf/ihatemoney.cfg" --destination="$install_dir/i
chmod 640 "$install_dir/ihatemoney.cfg"
chown $app:$app "$install_dir/ihatemoney.cfg"
# Configure log directory
mkdir -p "/var/log/$app"
chown -R $app:$app "/var/log/$app"
#=================================================
# SETUP SYSTEMD
#=================================================

View file

@ -91,6 +91,13 @@ if [ -z "$hashed_password" ] && [ test -f "${install_dir}/venv/bin/activate" ];
ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password
fi
if [ ! -d "/var/log/$app" ]; then
# Configure log directory
mkdir -p "/var/log/$app"
chown -R $app:$app "/var/log/$app"
fi
#=================================================
# SPECIFIC UPGRADE
#=================================================