--- nxsetup~ 2007-10-15 00:25:14.000000000 +0200 +++ nxsetup 2007-10-19 18:36:45.000000000 +0200 @@ -164,11 +164,15 @@ # adduser needs a valid group to add the user to ! nx_group_exists && addgroup --system --quiet $GROUPADD_OPTIONS nx - [ -f /etc/nscd.conf ] && { nscd --invalidate group; } + if [ -f /var/run/nscd/nscd.pid ]; then + [ -f /etc/nscd.conf ] && { nscd --invalidate group; } + fi adduser $USERADD_OPTIONS nx - [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; } - + if [ -f /var/run/nscd/nscd.pid ]; then + [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; } + fi + # no, its a "normal" useradd else USERADD_OPTIONS="-g nx -d $NX_HOME_DIR -s $PATH_BIN/nxserver" @@ -187,17 +191,25 @@ if [ "$SETUP_LOCAL_USER" = "yes" ] then - ! nx_group_exists && lgroupadd $GROUPADD_OPTIONS nx - [ -f /etc/nscd.conf ] && { nscd --invalidate group; } + ! nx_group_exists && lgroupadd $GROUPADD_OPTIONS nx + if [ -f /var/run/nscd/nscd.pid ]; then + [ -f /etc/nscd.conf ] && { nscd --invalidate group; } + fi luseradd $USERADD_OPTIONS nx - [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; } + if [ -f /var/run/nscd/nscd.pid ]; then + [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; } + fi else ! nx_group_exists && groupadd $GROUPADD_OPTIONS nx - [ -f /etc/nscd.conf ] && { nscd --invalidate group; } + if [ -f /var/run/nscd/nscd.pid ]; then + [ -f /etc/nscd.conf ] && { nscd --invalidate group; } + fi useradd $USERADD_OPTIONS nx - [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; } + if [ -f /var/run/nscd/nscd.pid ]; then + [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; } + fi fi @@ -457,7 +469,9 @@ #Perform cleanup? [ "$CLEAN" = "yes" ] && uninstall_nx - [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; nscd --invalidate group; } + if [ -f /var/run/nscd/nscd.pid ]; then + [ -f /etc/nscd.conf ] && { nscd --invalidate passwd; nscd --invalidate group; } + fi install_nx [ "$AUTOMATIC" = "no" ] && test_nx