PREIN
/bin/sh
getent group couchdb >/dev/null || groupadd -r couchdb
getent passwd couchdb >/dev/null || \
useradd -r -g couchdb -d /var/lib/couchdb -s /bin/bash \
-c "Couchdb Database Server" couchdb
exit 0
PREUN
/bin/sh
if [ $1 -eq 0 ] && [ -x /usr/bin/systemctl ]; then
# Package removal, not upgrade
/usr/bin/systemctl --no-reload disable --now couchdb.service || :
fi
POSTIN
/bin/sh
if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ]; then
# Initial installation
/usr/bin/systemctl --no-reload preset couchdb.service || :
fi
POSTUN
/bin/sh
if [ $1 -ge 1 ] && [ -x /usr/bin/systemctl ]; then
# Package upgrade, not uninstall
/usr/bin/systemctl try-restart couchdb.service || :
fi