mirror of
https://github.com/YunoHost-Apps/weblate_ynh.git
synced 2024-10-01 13:35:04 +02:00
add uwsgi.service
This commit is contained in:
parent
6c1da284ae
commit
87de11d74c
3 changed files with 35 additions and 6 deletions
18
conf/uwsgi_service
Normal file
18
conf/uwsgi_service
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
[Unit]
|
||||||
|
Description=uWSGI instance to weblate
|
||||||
|
Requires=network.target
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
RemainAfterExit=yes
|
||||||
|
WorkingDirectory=__FINALPATH__
|
||||||
|
ExecStart=/usr/bin/uwsgi --ini-paste /etc/uwsgi/apps-enabled/__NAME__.uwsgi.ini
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
ExecStop=/bin/kill -INT $MAINPID
|
||||||
|
Restart=always
|
||||||
|
StandardError=syslog
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -126,12 +126,16 @@ ynh_replace_string "__FINALPATH__" "$final_path" $final_path/uwsgi.ini
|
||||||
sudo mkdir -p /etc/uwsgi/apps-enabled/
|
sudo mkdir -p /etc/uwsgi/apps-enabled/
|
||||||
sudo ln -s $final_path/uwsgi.ini /etc/uwsgi/apps-enabled/$app.uwsgi.ini
|
sudo ln -s $final_path/uwsgi.ini /etc/uwsgi/apps-enabled/$app.uwsgi.ini
|
||||||
|
|
||||||
# Start service
|
sudo cp ../conf/uwsgi_service /etc/systemd/system/$app.uwsgi.service
|
||||||
sudo systemctl enable uwsgi
|
ynh_replace_string "__NAME__" "$app" /etc/systemd/system/$app.uwsgi.service
|
||||||
sudo systemctl restart uwsgi
|
ynh_replace_string "__FINALPATH__" "$final_path" /etc/systemd/system/$app.uwsgi.service
|
||||||
|
|
||||||
# Add umap.uwsgi as a service
|
# Start service
|
||||||
sudo yunohost service add $app.uwsgi
|
sudo systemctl enable $app.uwsgi.service
|
||||||
|
sudo systemctl restart $app.uwsgi.service
|
||||||
|
|
||||||
|
# Add weblate.uwsgi as a service
|
||||||
|
sudo yunohost service add $app.service
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP settings.py
|
# SPECIFIC SETUP settings.py
|
||||||
|
@ -169,7 +173,6 @@ sudo $final_path/manage.py collectstatic --noinput
|
||||||
|
|
||||||
cp ../conf/cron_weblate /etc/cron.d/$app
|
cp ../conf/cron_weblate /etc/cron.d/$app
|
||||||
ynh_replace_string "__FINALPATH__" "$final_path/" /etc/cron.d/$app
|
ynh_replace_string "__FINALPATH__" "$final_path/" /etc/cron.d/$app
|
||||||
chmod +x $final_path/script/lutim
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CHECKSUM OF THE CONFIG FILE
|
# STORE THE CHECKSUM OF THE CONFIG FILE
|
||||||
|
|
|
@ -79,6 +79,14 @@ ynh_secure_remove "/etc/$app/"
|
||||||
# Remove the log files
|
# Remove the log files
|
||||||
ynh_secure_remove "/var/log/$app/"
|
ynh_secure_remove "/var/log/$app/"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE uwsgi and systemd files
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_secure_remove "/etc/uwsgi/apps-enabled/$app.uwsgi.ini"
|
||||||
|
|
||||||
|
ynh_secure_remove "/etc/systemd/system/$app.uwsgi.service"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue