diff options
Diffstat (limited to 'debian')
-rwxr-xr-x | debian/keysafe-server.postinst | 2 | ||||
-rwxr-xr-x | debian/keysafe-server.postrm | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/debian/keysafe-server.postinst b/debian/keysafe-server.postinst index 38508cc..7282e29 100755 --- a/debian/keysafe-server.postinst +++ b/debian/keysafe-server.postinst @@ -6,7 +6,7 @@ if ! getent passwd _keysafe >/dev/null; then adduser --system --group --disabled-login --disabled-password \ --home /var/lib/keysafe --force-badname _keysafe chmod 700 /var/lib/keysafe -else +elif [ -d "/var/lib/keysafe" ]; then chown -R _keysafe:_keysafe /var/lib/keysafe fi diff --git a/debian/keysafe-server.postrm b/debian/keysafe-server.postrm index 1ee50af..10ebfea 100755 --- a/debian/keysafe-server.postrm +++ b/debian/keysafe-server.postrm @@ -8,7 +8,9 @@ set -e # delete the _keysafe user and group, after chowning the shard storage # to root so that it does not end up owned by another system user if [ "$1" = "purge" ]; then - chown -R root:root /var/lib/keysafe + if [ -e "/var/lib/keysafe" ]; then + chown -R root:root /var/lib/keysafe + fi userdel _keysafe || true groupdel _keysafe || true fi |