diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-01-10 15:32:29 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-01-10 15:32:29 +0100 |
commit | 17c4250b475c871004ea404c4d6c57ac68596353 (patch) | |
tree | 2c095bf4eeb1b36924f2a535a852437628a37638 /debian/sane-utils.postinst | |
parent | 6023d0ffc729e956df760122594853ba6b3c4fa6 (diff) |
stop scanbd before move the home directroy
Diffstat (limited to 'debian/sane-utils.postinst')
-rw-r--r-- | debian/sane-utils.postinst | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/debian/sane-utils.postinst b/debian/sane-utils.postinst index c29b29c..83857a6 100644 --- a/debian/sane-utils.postinst +++ b/debian/sane-utils.postinst @@ -30,9 +30,19 @@ if [ "$1" = "configure" ] || [ "$1" = "reconfigure" ]; then fi # Move home from /home/saned to /var/lib/saned - if getent passwd | grep -q "^saned:" | grep "/home/saned"; then - echo "Moving homedir from /home/saned to /var/lib/saned" - usermod -d /var/lib/saned saned + if getent passwd | grep -q "^saned:" | grep -q "/home/saned"; then + echo "Test for running scanbd" + if ps -Af | grep -q "saned" | grep -q "scanbd"; then + echo "Stop scanbd" + invoke-rc.d --quiet scanbd stop + echo "Move homedir from /home/saned to /var/lib/saned" + usermod -d /var/lib/saned saned + echo "Start scanbd" + invoke-rc.d --quiet scanbd start + else + echo "Move homedir from /home/saned to /var/lib/saned" + usermod -d /var/lib/saned saned + fi fi if [ "$SANED_IN_SCANNER" = "true" ]; then adduser --quiet saned scanner |