mirror of
https://github.com/YunoHost-Apps/ffsync_ynh.git
synced 2024-09-03 18:26:38 +02:00
Merge branch 'testing'
This commit is contained in:
commit
9fff589efd
5 changed files with 40 additions and 28 deletions
|
@ -1,20 +0,0 @@
|
|||
[Unit]
|
||||
Description=%i uWSGI app
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
RuntimeDirectory=%i
|
||||
ExecStart=/usr/bin/uwsgi \
|
||||
--ini /etc/uwsgi/apps-available/%i.ini \
|
||||
--socket /var/run/%i/app.socket \
|
||||
--logto /var/log/uwsgi/%i/%i.log
|
||||
User=%i
|
||||
Group=www-data
|
||||
Restart=on-failure
|
||||
KillSignal=SIGQUIT
|
||||
Type=notify
|
||||
StandardError=syslog
|
||||
NotifyAccess=all
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
2
conf/uwsgi-app@override.service
Normal file
2
conf/uwsgi-app@override.service
Normal file
|
@ -0,0 +1,2 @@
|
|||
[Unit]
|
||||
After=mysql.service
|
|
@ -6,7 +6,28 @@
|
|||
ynh_check_global_uwsgi_config () {
|
||||
uwsgi --version || ynh_die "You need to add uwsgi (and appropriate plugin) as a dependency"
|
||||
|
||||
cp ../conf/uwsgi-app@.service /etc/systemd/system/uwsgi-app@.service
|
||||
cat > /etc/systemd/system/uwsgi-app@.service <<EOF
|
||||
[Unit]
|
||||
Description=%i uWSGI app
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
RuntimeDirectory=%i
|
||||
ExecStart=/usr/bin/uwsgi \
|
||||
--ini /etc/uwsgi/apps-available/%i.ini \
|
||||
--socket /var/run/%i/app.socket \
|
||||
--logto /var/log/uwsgi/%i/%i.log
|
||||
User=%i
|
||||
Group=www-data
|
||||
Restart=on-failure
|
||||
KillSignal=SIGQUIT
|
||||
Type=notify
|
||||
StandardError=syslog
|
||||
NotifyAccess=all
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
}
|
||||
|
@ -26,6 +47,9 @@ ynh_check_global_uwsgi_config () {
|
|||
# __PATH_2__ by $path_2
|
||||
# __PORT_2__ by $port_2
|
||||
#
|
||||
# To be able to customise the settings of the systemd unit you can override the rules with the file "conf/uwsgi-app@override.service".
|
||||
# This file will be automatically placed on the good place
|
||||
#
|
||||
# usage: ynh_add_uwsgi_service
|
||||
#
|
||||
# to interact with your service: `systemctl <action> uwsgi-app@app`
|
||||
|
@ -70,8 +94,13 @@ ynh_add_uwsgi_service () {
|
|||
chown $app:root /var/log/uwsgi/$app
|
||||
chmod -R u=rwX,g=rX,o= /var/log/uwsgi/$app
|
||||
|
||||
# Setup specific Systemd rules if necessary
|
||||
test -e ../conf/uwsgi-app@override.service && \
|
||||
mkdir /etc/systemd/system/uwsgi-app@$app.service.d && \
|
||||
cp ../conf/uwsgi-app@override.service /etc/systemd/system/uwsgi-app@$app.service.d/override.conf
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl stop "uwsgi-app@$app.service"
|
||||
systemctl stop "uwsgi-app@$app.service" || true
|
||||
systemctl enable "uwsgi-app@$app.service"
|
||||
systemctl start "uwsgi-app@$app.service"
|
||||
|
||||
|
@ -91,5 +120,6 @@ ynh_remove_uwsgi_service () {
|
|||
|
||||
ynh_secure_remove "$finaluwsgiini"
|
||||
ynh_secure_remove "/var/log/uwsgi/$app"
|
||||
ynh_secure_remove "/etc/systemd/system/uwsgi-app@$app.service.d"
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ ynh_system_user_create "$app" "$final_path"
|
|||
# pip installation
|
||||
#=================================================
|
||||
|
||||
virtualenv "$final_path/local"
|
||||
virtualenv --python=$(which python2 python | head -n 1) "$final_path/local"
|
||||
# Init virtualenv
|
||||
(
|
||||
set +o nounset
|
||||
|
@ -122,10 +122,10 @@ virtualenv "$final_path/local"
|
|||
set -o nounset
|
||||
cd "$final_path"
|
||||
pip install --upgrade pip
|
||||
pip install pyramid_chameleon
|
||||
pip install --upgrade pyramid_chameleon
|
||||
CFLAGS="-Wno-error -Wno-error=format-security" \
|
||||
ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" \
|
||||
pip install --requirement "$final_path/requirements.txt"
|
||||
pip install --upgrade --requirement "$final_path/requirements.txt"
|
||||
|
||||
python "$final_path/setup.py" develop
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ ynh_system_user_create "$app"
|
|||
# pip installation
|
||||
#=================================================
|
||||
|
||||
virtualenv "$final_path/local"
|
||||
virtualenv --python=$(which python2 python | head -n 1) "$final_path/local"
|
||||
# Init virtualenv
|
||||
(
|
||||
set +o nounset
|
||||
|
@ -141,10 +141,10 @@ virtualenv "$final_path/local"
|
|||
set -o nounset
|
||||
cd "$final_path"
|
||||
pip install --upgrade pip
|
||||
pip install pyramid_chameleon
|
||||
pip install --upgrade pyramid_chameleon
|
||||
CFLAGS="-Wno-error -Wno-error=format-security" \
|
||||
ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" \
|
||||
pip install --requirement "$final_path/requirements.txt"
|
||||
pip install --upgrade --requirement "$final_path/requirements.txt"
|
||||
|
||||
python "$final_path/setup.py" develop
|
||||
|
||||
|
|
Loading…
Reference in a new issue