wok-next rev 1905
apache,lighttpd*: ensure only one web server is running
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Dec 21 10:51:14 2008 +0000 (2008-12-21) |
parents | 5bc6c4ca792e |
children | b42847caa337 |
files | apache/receipt lighttpd-ssl/receipt lighttpd/receipt |
line diff
1.1 --- a/apache/receipt Sat Dec 20 23:37:11 2008 +0100 1.2 +++ b/apache/receipt Sun Dec 21 10:51:14 2008 +0000 1.3 @@ -80,7 +80,12 @@ 1.4 1.5 1.6 EOT 1.7 - [ -z "$1" ] && /etc/init.d/$PACKAGE start 1.8 + if [ -z "$1" ]; then 1.9 + for i in lighttpd ; do 1.10 + [ -f /etc/init.d/$i ] && /etc/init.d/$i stop 1.11 + done 1.12 + /etc/init.d/$PACKAGE start 1.13 + fi 1.14 } 1.15 1.16 # Rules to clean extras dirs or files
2.1 --- a/lighttpd-ssl/receipt Sat Dec 20 23:37:11 2008 +0100 2.2 +++ b/lighttpd-ssl/receipt Sun Dec 21 10:51:14 2008 +0000 2.3 @@ -97,8 +97,6 @@ 2.4 } 2.5 post_install() 2.6 { 2.7 - local root 2.8 - root=$1 2.9 echo "Processing post-install commands..." 2.10 if [ ! -f $1/etc/ssl/lighttpd/lighttpd.pem ]; then 2.11 openssl req -new -x509 \ 2.12 @@ -115,6 +113,11 @@ 2.13 EOT 2.14 fi 2.15 # Just in case. 2.16 - chown www.www $root/var/log/lighttpd 2.17 - /etc/init.d/lighttpd start 2.18 + chown www.www $1/var/log/lighttpd 2.19 + if [ -z "$1" ]; then 2.20 + for i in apache ; do 2.21 + [ -f /etc/init.d/$i ] && /etc/init.d/$i stop 2.22 + done 2.23 + /etc/init.d/$PACKAGE start 2.24 + fi 2.25 }
3.1 --- a/lighttpd/receipt Sat Dec 20 23:37:11 2008 +0100 3.2 +++ b/lighttpd/receipt Sun Dec 21 10:51:14 2008 +0000 3.3 @@ -83,10 +83,13 @@ 3.4 } 3.5 post_install() 3.6 { 3.7 - local root 3.8 - root=$1 3.9 echo "Processing post-install commands..." 3.10 # Just in case. 3.11 - chown www.www $root/var/log/$PACKAGE 3.12 - /etc/init.d/$PACKAGE start 3.13 + chown www.www $1/var/log/$PACKAGE 3.14 + if [ -z "$1" ]; then 3.15 + for i in apache ; do 3.16 + [ -f /etc/init.d/$i ] && /etc/init.d/$i stop 3.17 + done 3.18 + /etc/init.d/$PACKAGE start 3.19 + fi 3.20 }