Skip to content

Commit

Permalink
Only reload nginx if active (#4208)
Browse files Browse the repository at this point in the history
When installing cozy-stack deb package, nginx is a recommended
dependency.

On Ubuntu, recommended dependencies are installed by default with the
package so nginx get installed with cozy-stack.

In postinstall script, we reload nginx if we find it installed but in
case nginx is installed but not active (not started yet), reload fails
and the whole postinst script fail, leaving cozy-stack package in an
unconfigured state.

To prevent this situation, we now only reload nginx if it is active
(running)
  • Loading branch information
sblaisot authored Nov 7, 2023
2 parents d6831be + a5300aa commit 9c4c1a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion debian/cozy-stack.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ configure)
install -o cozy-stack -g cozy -m u=rwX,g=rwX,o= -d /var/lib/cozy

[ -f /usr/sbin/rsyslogd ] && systemctl restart rsyslog
[ -f /usr/sbin/nginx ] && systemctl reload nginx
if systemctl -q is-active nginx; then
systemctl reload nginx
fi
else
if [ ! -f /etc/cozy/.cozy-admin-passphrase ]; then
db_input critical cozy-stack/admin/passphrase
Expand Down

0 comments on commit 9c4c1a0

Please sign in to comment.