From 1f9361fec0548ab685d2d69fa51d597e1ce2c1a4 Mon Sep 17 00:00:00 2001 From: Stephan Pauxberger Date: Mon, 27 Feb 2023 12:55:31 +0100 Subject: [PATCH] Service: correctly extract home dir (#6487) --- packaging/scripts/preinstall.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packaging/scripts/preinstall.sh b/packaging/scripts/preinstall.sh index 2a2fd67f1..0c8f563eb 100644 --- a/packaging/scripts/preinstall.sh +++ b/packaging/scripts/preinstall.sh @@ -71,7 +71,7 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then adduser --quiet "$EVCC_USER" dialout else adduser --quiet "$EVCC_USER" dialout - homedir=$(getent passwd "$EVCC_USER" | cut -d: -f4) + homedir=$(getent passwd "$EVCC_USER" | cut -d: -f6) if [ "$homedir" != "$EVCC_HOME" ]; then mkdir -p "$EVCC_HOME" chown "$EVCC_USER:$EVCC_GROUP" "$EVCC_HOME" @@ -84,8 +84,9 @@ if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then else echo "--------------------------------------------------------------------------------" echo "Warning: evcc's home directory is incorrect ($homedir)" - echo "but can't be changed because another process ($process) is using it." - echo "Stop offending process(es), then restart installation" + echo "but can't be changed because at least one other process is using it." + echo "Stop offending process(es), then restart installation." + echo "Hint: You can list the offending processes using 'pgrep -u $EVCC_USER -a'" echo "Note that you should NOT use the evcc user as login user, since that will" echo "inevitably lead to this error." echo "in that case, please create a different user as login user."