Ajout : vm_hosted : rule_tmpfs_configure .
[lhc/ateliers.git] / etc / init.d / tmpfs
index adf6c72..3a9915c 100755 (executable)
@@ -24,14 +24,23 @@ do_start() {
                 /run/nginx \
                 /run/nginx/fastcgi
                
-               ! mountpoint -q /run/shm ||
-               ! test -f /run/shm/.tmpfs ||
-               sudo install -d -m 1777 -o root -g root \
-                /run/shm/cache &&
-               sudo install -d -m 660 -o www-data -g www-data \
-                /run/shm/cache/nginx \
-                /run/shm/cache/nginx/fastcgi \
-                /run/shm/cache/nginx/client_body
+               if mountpoint -q /run/shm &&
+                       test -f /run/shm/.tmpfs
+                then
+                       sudo install -d -m 1777 -o root -g root \
+                        /run/shm/cache
+                       
+                       ! getent passwd www-data ||
+                       sudo install -d -m 660 -o www-data -g www-data \
+                        /run/shm/cache/nginx \
+                        /run/shm/cache/nginx/fastcgi \
+                        /run/shm/cache/nginx/client_body
+                       
+                       ! getent passwd php5 ||
+                       sudo install -d -m 1667 -o php5 -g php5 \
+                        /run/shm/cache/php5 \
+                        /run/shm/cache/php5/fpm
+                fi
                
                ES=$?
                [ "$VERBOSE" != no ] && log_end_msg $ES