Specify postgres host instead of assuming we are running on the
postgres server.
Use printf instead of "tee -i" to double output when setting initial
password; newer sudo barfs with permission denied on /dev/stdout (and
printf makes it clearer anyway).
Gitweb symlink creation was cruft, a cron on the webserver manages the
symlinks automatically.
And don't check for volume sync from outpost, it is not running
openafs-fileserver (just the afs db servers).
mkdir -p $PGNEWDIR
chown postgres:postgres $PGNEWDIR
chmod 700 $PGNEWDIR
- sudo -u postgres psql --cluster 9.1/main -c "CREATE TABLESPACE \"user_$USER\" OWNER postgres LOCATION '$PGNEWDIR'" template1
+ sudo -u postgres psql --cluster 9.6/main -c "CREATE TABLESPACE \"user_$USER\" OWNER postgres LOCATION '$PGNEWDIR'" template1
fi
# Create mysql user and databases placeholder within volume
# ^^ work around sudo env_reset crap without having to
# actually figure out how to make it work cleanly -- clinton,
# 2011-11-30
-
- # Gitweb hosting
- test -L /var/cache/git/$NEWUSER || \
- sudo ln -s $HOMEPATH/.hcoop-git /var/cache/git/$NEWUSER
-
}
#
# technically this might not be necessary, but for good measure...
local srv
- for srv in gibran lovelace outpost; do
+ for srv in gibran lovelace; do
vos syncserv $srv
vos syncvldb $srv
done
exit 1
fi
-INITPW=$(sudo -u hcoop psql -p 5433 hcoop_portal3 -tc "select unix_passwd from MemberApp where name = '${USERNM}' order by id desc limit 1;")
+INITPW=$(sudo -u hcoop psql -h postgres -p 5433 hcoop_portal3 -tc "select unix_passwd from MemberApp where name = '${USERNM}' order by id desc limit 1;")
#
else
echo Setting password from database
actual_user=`whoami`
- sudo sh -c "echo $INITPW | tee -| /afs/hcoop.net/common/etc/scripts/change-user-password $USERNM" || \
+ sudo sh -c "printf '%s\n%s\n' $INITPW $INITPW | /afs/hcoop.net/common/etc/scripts/change-user-password $USERNM" || \
( echo "echo XXX | tee - | change-user-password $USERNM failed" && exit 5 )
fi