create-user: create fastcgi wrapper script
[hcoop/scripts.git] / lib / create-user-lib.sh
index 7497b59..a65b490 100644 (file)
@@ -237,7 +237,8 @@ function seed_user_hcoop_directories () {
     chown $NEWUSER:nogroup $HOMEPATH/.public/.domtool
     test -e $HOMEPATH/.domtool || \
        test -L $HOMEPATH/.domtool || \
-        execute_on_domtool_server sudo -u $NEWUSER ln -s $HOMEPATH/.public/.domtool $HOMEPATH/.domtool
+        execute_on_domtool_server ln -s $HOMEPATH/.public/.domtool $HOMEPATH/.domtool
+        execute_on_domtool_server chown $NEWUSER $HOMEPATH/.domtool 
         # ^^ work around sudo env_reset crap without having to
         # actually figure out how to make it work cleanly -- clinton,
         # 2011-11-30
@@ -288,4 +289,22 @@ function ensure_afs_servers_synced () {
     
     # refresh volume location cache (takes ~2hrs otherwise)
     execute_on_all_machines fs checkvolumes
-}
\ No newline at end of file
+}
+
+#
+# webserver
+#
+
+function create_fcgi_wrapper () {
+    # note: might want to move this to domtool-adduser
+    local wrapper="/afs/hcoop.net/common/httpd/fastcgi/${PATHBITS}/${NEWUSER}-wrapper-wrapper"
+    mkdir -p /afs/hcoop.net/common/httpd/fastcgi/${PATHBITS}
+    cat > $wrapper <<EOF
+#!/bin/bash
+
+exec k5start -qtUf /etc/keytabs/user.daemon/${NEWUSER} -- $@
+EOF
+
+    chmod +x $wrapper
+    chown $NEWUSER:nogroup $wrapper
+}