wok-4.x rev 12395

nginx: add www user,/var/spool/nginx (thanks mojo)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Jul 02 23:08:15 2013 +0200 (2013-07-02)
parents 66108539473c
children f8760003d124
files nginx/receipt
line diff
     1.1 --- a/nginx/receipt	Thu Jun 13 23:20:43 2013 +0200
     1.2 +++ b/nginx/receipt	Tue Jul 02 23:08:15 2013 +0200
     1.3 @@ -56,36 +56,38 @@
     1.4  # On SliTaz Lighttpd runs as user/group : www/www or 80/80.
     1.5  genpkg_rules()
     1.6  {
     1.7 -	cp -a $_pkg/* $fs/
     1.8 -	rm -rf $fs/usr/html
     1.9 -	cp -a stuff/* $fs
    1.10 +        cp -a $_pkg/* $fs/
    1.11 +        rm -rf $fs/usr/html
    1.12 +        cp -a stuff/* $fs
    1.13 +        sed -i 's/#user  nobody;/user  www;/' $fs/etc/nginx/nginx.conf
    1.14  }
    1.15  
    1.16  # Pre and post install commands for Tazpkg.
    1.17  # We stop the server by default in case of upgarde.
    1.18  pre_install()
    1.19  {
    1.20 -	echo "Processing pre-install commands..."
    1.21 -	[ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
    1.22 -	# Backup config file.
    1.23 -	if [ -d $1/$CONFIG_FILES ]; then
    1.24 +        echo "Processing pre-install commands..."
    1.25 +        [ -f /etc/init.d/$PACKAGE ] && /etc/init.d/$PACKAGE stop
    1.26 +        # Backup config file.
    1.27 +        if [ -d $1/$CONFIG_FILES ]; then
    1.28  		cp -a $1/$CONFIG_FILES $1/$CONFIG_FILES.bak
    1.29 -	fi
    1.30 +        fi
    1.31  }
    1.32  post_install()
    1.33  {
    1.34 -	echo "Processing post-install commands..."
    1.35 -	# Restore original config.
    1.36 -	if [ -d $1/$CONFIG_FILES.bak ]; then
    1.37 +        echo "Processing post-install commands..."
    1.38 +        mkdir -p /var/spool/nginx
    1.39 +        # Restore original config.
    1.40 +        if [ -d $1/$CONFIG_FILES.bak ]; then
    1.41  		rm -rf $1/$CONFIG_FILES
    1.42  		mv $1/$CONFIG_FILES.bak $1/$CONFIG_FILES
    1.43 -	fi
    1.44 -	# Just in case.
    1.45 -	chown www.www $1/var/log/$PACKAGE
    1.46 -	if [ -z "$1" ]; then
    1.47 +        fi
    1.48 +        # Just in case.
    1.49 +        chown www.www $1/var/log/$PACKAGE
    1.50 +        if [ -z "$1" ]; then
    1.51  		for i in apache lighttpd ; do
    1.52  			[ -f /etc/init.d/$i ] && /etc/init.d/$i stop
    1.53  		done
    1.54  		/etc/init.d/$PACKAGE start
    1.55 -	fi
    1.56 +        fi
    1.57  }