create-user: create fastcgi wrapper script
authorClinton Ebadi <clinton@unknownlamer.org>
Sat, 28 Jan 2017 22:26:10 +0000 (17:26 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Sat, 28 Jan 2017 22:26:10 +0000 (17:26 -0500)
mod_fcgid is annoying and has no way to integrate with
mod_waklog. Generate wrapper scripts that grab tokens as a workaround.

create-user-new
lib/create-user-lib.sh

index 56de1fc..20f647d 100755 (executable)
@@ -44,7 +44,8 @@ ensure_afs_servers_synced
 seed_user_hcoop_directories
 setup_user_databases
 create_dav_locks
+create_fcgi_wrapper
 
 enable_domtool
 
-subscribe_to_lists
\ No newline at end of file
+subscribe_to_lists
index 4583b45..a65b490 100644 (file)
@@ -289,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
+}