Subject: Re: bug#59181: [berlin] web services fail to start on reboot due to anonip

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 01 Nov 2024 17:30:26 +0900

Hi,

Maxim Cournoyer <[email-masked]> writes:

> Hi,
>
> Each time we reboot berlin, we must clear anonip files that it uses to
> process the nginx logs, which are supposed to be named pipes rather than
> empty files, like so:
>
>   # rm /var/run/anonip/*
>   # herd start nginx
>
> We should fix that.

OK, I've now narrowed this issue down to the nginx activation script,
which validates the configuration file, which causes nginx to write the
log files before our anonip service gets to create the named pipes at
their location.

Here's a small debug session in a VM showing this is the case:

--8<---------------cut here---------------start------------->8---
root@komputilo ~# ls /var/run/anonip
access.log  error.log
root@komputilo ~# rm /var/run/anonip/*
root@komputilo ~# ls /var/run/anonip
root@komputilo ~# "/gnu/store/kn56akgnfkqm0ppyfzhyh63ss06ff42s-nginx-1.27.1/sbin/nginx" "-c" "/gnu/store/zc2vj9ixcmdpkivkdyp16vw8lyaivvky-nginx.conf" "-p" "/var/run/nginx" "-t"
nginx: the configuration file /gnu/store/zc2vj9ixcmdpkivkdyp16vw8lyaivvky-nginx.conf syntax is ok
root@komputilo ~# ls /var/run/anonip
access.log  error.log
--8<---------------cut here---------------end--------------->8---

I suggest we simply recreate the log files in our anonip service start
slot; currently it checks and fails if they already exist.

-- 
Thanks,
Maxim