Repository navigation
Description
Context
scripts/postinstall.sh is not idempotent — running it twice on an already-configured system may overwrite config or re-create directories incorrectly. It also does not check for critical FUSE prerequisites: user_allow_other in /etc/fuse.conf and open file limits. Operators frequently run into silent failures from missing FUSE config.
What to implement
Rewrite scripts/postinstall.sh with:
Idempotency pattern — use guard checks throughout:
[ -f /etc/objectfs/config.yaml ] || cp /usr/share/objectfs/configs/example.yaml /etc/objectfs/config.yaml
[ -d /var/cache/objectfs ] || mkdir -p /var/cache/objectfscheck_fuse_module function:
check_fuse_module() {
modprobe fuse 2>/dev/null || true
if ! grep -q "^user_allow_other" /etc/fuse.conf 2>/dev/null; then
echo "WARNING: /etc/fuse.conf missing 'user_allow_other'" >&2
echo " Fix: echo 'user_allow_other' >> /etc/fuse.conf" >&2
fi
}check_system_limits function — check ulimit -n vs 65536, print hint to add DefaultLimitNOFILE=65536 to /etc/systemd/system.conf if needed.
Script must exit 0 in all cases. Warnings go to stderr, not stdout. Installation must succeed even on systems without FUSE (e.g., build servers).
Add shellcheck lint to CI via .pre-commit-config.yaml.
Acceptance criteria
- Running postinstall twice produces identical filesystem state as running once
- Missing
/etc/fuse.confor missinguser_allow_otherprints a clear warning with exact remediation command - Script exits 0 whether FUSE is present or not
shellcheck scripts/postinstall.shpasses in CI
Sequencing
Independent — can land any time in v0.11.0.
Activity
feat(packaging): deb/rpm packages, and the uninstall script they make…