#! /bin/sh ### BEGIN INIT INFO # Provides: tmpfs # Required-Start: $local_fs # Required-Stop: $local_fs # X-Start-Before: nginx # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Initialise tmpfs file systems ### END INIT INFO PATH=/sbin:/usr/sbin:/bin:/usr/bin . /lib/init/vars.sh . /lib/lsb/init-functions do_start() { if [ -x /etc/rc.local ] then [ "$VERBOSE" != no ] && log_begin_msg "Initialising tmpfs file systems" ! mountpoint -q /run || sudo install -d -m 770 -o www-data -g www-data \ /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 ES=$? [ "$VERBOSE" != no ] && log_end_msg $ES return $ES fi } case "$1" in (start|restart) do_start ;; (reload|force-reload) echo "Error: argument '$1' not supported" >&2 exit 3 ;; (stop) ;; (*) echo "Usage: $0 start|restart|stop" >&2 exit 3 ;; esac