Describe the bug
Hi Zenoh team,
First of all, thanks for maintaining the official Debian repo — it makes installation super convenient.
I wanted to bring up a minor annoyance I've been running into on Ubuntu 26.04. I installed Zenoh from the Eclipse repository (the standard deb https://download.eclipse.org/zenoh/debian-repo/ ...), and I've noticed that every time I run sudo apt update, the /etc/zenohd folder gets wiped out. Not during an upgrade, not during a remove — just a plain apt update.
This caught me off guard because I usually keep my custom DEFAULT_CONFIG.json5 in there, and after a routine update, it's just gone and I have to recreate it.
I did some digging and found the exact culprit:
I extracted the zenohd_1.9.0_amd64.deb and looked at the DEBIAN/postrm script:
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
userdel zenohd > /dev/null 2>&1 || true
rm -rf /etc/zenohd /var/zenohd
;;
esac
The problem is that upgrade is included in the destructive branch. So every time the package upgrades, the old postrm runs with upgrade as the argument and deletes /etc/zenohd before dpkg's conffile handling even gets a chance. This means even though /etc/zenohd/zenohd.json5 is correctly registered as a conffile, it gets physically wiped out before dpkg can preserve it.
Also, /var/zenohd (the daemon's state directory) gets nuked on every upgrade too, and the zenohd system user is deleted and recreated.
I'm currently on version 1.10.1 and checked the postrm — it's still using the same logic, so the issue persists in the latest release.
It would be great if a future version could fix this by restricting the rm -rf to the purge case only. That's the Debian Policy way — config and state removal should only happen on purge, not on upgrade or remove.
Happy to provide more details if needed. Appreciate your work on this!
Cheers
To reproduce
To reproduce:
- Install an older version of
zenohd (e.g., 1.9.0) from the Eclipse repository.
- Upgrade to a newer version (e.g., 1.10.0 or 1.10.1) via
sudo apt upgrade.
- Check
/etc/zenohd — the entire directory, including any custom configuration files, will be gone.
- Check
/var/zenohd — the state directory will also be empty.
Expected result: Configuration files in /etc/zenohd should be preserved across upgrades, as per standard Debian package behavior.
Actual result: The directory is wiped out on every upgrade.
System info
- Platform: Ubuntu 26.04 (amd64)
- CPU: AMD Ryzen 9950X
- Zenoh version: 1.10.1
Describe the bug
Hi Zenoh team,
First of all, thanks for maintaining the official Debian repo — it makes installation super convenient.
I wanted to bring up a minor annoyance I've been running into on Ubuntu 26.04. I installed Zenoh from the Eclipse repository (the standard
deb https://download.eclipse.org/zenoh/debian-repo/ ...), and I've noticed that every time I runsudo apt update, the/etc/zenohdfolder gets wiped out. Not during an upgrade, not during a remove — just a plainapt update.This caught me off guard because I usually keep my custom
DEFAULT_CONFIG.json5in there, and after a routine update, it's just gone and I have to recreate it.I did some digging and found the exact culprit:
I extracted the
zenohd_1.9.0_amd64.deband looked at theDEBIAN/postrmscript:The problem is that
upgradeis included in the destructive branch. So every time the package upgrades, the old postrm runs withupgradeas the argument and deletes/etc/zenohdbefore dpkg's conffile handling even gets a chance. This means even though/etc/zenohd/zenohd.json5is correctly registered as a conffile, it gets physically wiped out before dpkg can preserve it.Also,
/var/zenohd(the daemon's state directory) gets nuked on every upgrade too, and thezenohdsystem user is deleted and recreated.I'm currently on version 1.10.1 and checked the postrm — it's still using the same logic, so the issue persists in the latest release.
It would be great if a future version could fix this by restricting the
rm -rfto thepurgecase only. That's the Debian Policy way — config and state removal should only happen on purge, not on upgrade or remove.Happy to provide more details if needed. Appreciate your work on this!
Cheers
To reproduce
To reproduce:
zenohd(e.g., 1.9.0) from the Eclipse repository.sudo apt upgrade./etc/zenohd— the entire directory, including any custom configuration files, will be gone./var/zenohd— the state directory will also be empty.Expected result: Configuration files in
/etc/zenohdshould be preserved across upgrades, as per standard Debian package behavior.Actual result: The directory is wiped out on every upgrade.
System info