mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Be more robust against broken config or service failing to start, show info to help debugging
This commit is contained in:
parent
01a6aa1371
commit
34fd4e90bd
1 changed files with 5 additions and 3 deletions
|
@ -26,7 +26,8 @@ do_init_regen() {
|
||||||
ynh_render_template "yunohost_admin.conf" "${nginx_conf_dir}/yunohost_admin.conf"
|
ynh_render_template "yunohost_admin.conf" "${nginx_conf_dir}/yunohost_admin.conf"
|
||||||
|
|
||||||
# Restart nginx if conf looks good, otherwise display error and exit unhappy
|
# Restart nginx if conf looks good, otherwise display error and exit unhappy
|
||||||
nginx -t 2>/dev/null && service nginx restart || (nginx -t && exit 1)
|
nginx -t 2>/dev/null || { nginx -t; exit 1; }
|
||||||
|
systemctl restart nginx || { journalctl --no-pager --lines=10 -u nginx >&2; exit 1; }
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
@ -109,8 +110,9 @@ do_post_regen() {
|
||||||
mkdir -p "/etc/nginx/conf.d/${domain}.d"
|
mkdir -p "/etc/nginx/conf.d/${domain}.d"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Reload nginx configuration
|
# Reload nginx if conf looks good, otherwise display error and exit unhappy
|
||||||
pgrep nginx && service nginx reload
|
nginx -t 2>/dev/null || { nginx -t; exit 1; }
|
||||||
|
pgrep nginx && systemctl reload nginx || { journalctl --no-pager --lines=10 -u nginx >&2; exit 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE=${2:-0}
|
FORCE=${2:-0}
|
||||||
|
|
Loading…
Add table
Reference in a new issue