Closed Timple closed 1 year ago
Subtle ping. I was bit by this again :slightly_frowning_face:
Sorry for the delay in looking into this. Would you happen to know how you managed to get an empty PID file? I didn't account for that when I wrote this bit of logic to do the pidfile cleanup.
I have been able to reproduce the the issue with the following.
docker build -t flungo/avahi:local src
CONTAINER="$(docker run -d flungo/avahi:local)"
docker exec -it "${CONTAINER}" sh -c 'echo > /var/run/avahi-daemon/pid'
docker kill "${CONTAINER}"
docker start "${CONTAINER}"
docker logs "${CONTAINER}"
It looks like you have accidentally deleted the actual fix you made in a45f73e25bb7c7201377b2d2d0ac65a8d8a0d874. The order of these last two branches don't need to be swapped - I wrote it in the current form so that each if/elif
conditions look for a justification to delete the file and then the else
case exits if it actually seems like avahi is already running.
Could you make the fix/condition you made in a45f73e25bb7c7201377b2d2d0ac65a8d8a0d874 the first condition? That should fix it and it makes sense to check if it's empty first as even "$$" == "${AVAHI_PID}"
, while it doesn't fail, does assume that ${AVAHI_PID}
contains something sensible.
Would you happen to know how you managed to get an empty PID file?
Nope. But we use a service to manage our containers (balena). So I'm impressed that you managed to reproduce this so quickly.
edit: in hindsight I now spot the trick that you actually create an empty pid file on purpose. I'm not sure how they arise in our setting. We share the /var/run/avahi-daemon/
directory with several dockers in a docker-compose file. But I wouldn't know why any of these dockers would create an empty pid file. 🙁
Could you make...
I'll get on it tomorrow!
Looks good. Thanks for reporting and contributing!
We had an issue with an empty PID file: