X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=vm_hosted;h=8a6c8d2b5213b0a8069a1ed1a6174eff09cbd534;hb=dae8fe647e7f10f8578a9bd6b64122df1b3f4e88;hp=8fc26411ea64dc5ebb6204ee8847da9cec119cec;hpb=09436582477e790bb70a0fc2904595b0530fe0f1;p=lhc%2Fateliers.git diff --git a/vm_hosted b/vm_hosted index 8fc2641..8a6c8d2 100755 --- a/vm_hosted +++ b/vm_hosted @@ -35,6 +35,16 @@ rule_git_configure () { tool=$(cd "$tool"; cd -) sudo ln -fns "$tool"/vm_hosted /usr/local/sbin/ sudo ln -fns "$tool"/vm_hosted /usr/local/sbin/vm + sudo install -m 770 /dev/stdin .git/hooks/post-update <<-EOF + #!/bin/sh -efux + case \$1 in + (refs/remotes/master) + cd .. + git --git-dir=\$PWD/.git checkout -f -B master remotes/master + git --git-dir=\$PWD/.git clean -f -d -x + ;; + esac + EOF ) } rule_git_reset () { @@ -208,7 +218,7 @@ rule_apache2_configure () { /etc/apache2/site.d/"$site" \ /home/www/etc/apache2/"$site" test -e /home/www/pub/"$site" || - sudo install -d -m 770 -o www."$site" -g www."$site" \ + sudo install -d -m 2770 -o www."$site" -g www."$site" \ /home/www/pub/"$site" getent passwd www."$site" >/dev/null || sudo adduser \ @@ -589,7 +599,7 @@ rule_gitolite_configure () { rmdir "$home"/etc/gitolite/"$d" done rule apt_get_install gitweb highlight - #sudo sv restart spawn-fcgi.git.80.git.heureux-cyclage.org + #sudo sv restart fcgi.git.80.git.heureux-cyclage.org #sudo sv restart git-daemon.git.9418 } rule_locales_configure () { @@ -708,7 +718,14 @@ rule_mail_configure () { } rule_mysql_configure () { rule apt_get_install mysql-server-5.5 - sudo service mysql restart + sudo install -m 644 -o root -g root \ + "$tool"/etc/mysql/my.cnf \ + /etc/mysql/my.cnf + if test ! -d /home/mysql; then + sudo install -d -m 750 -o mysql -g mysql \ + /home/mysql + sudo -u mysql mysql_install_db --no-defaults --datadir=/home/mysql/ + fi } rule_network_configure () { sudo install -m 644 -o root -g root /dev/stdin /etc/hostname <<-EOF @@ -778,7 +795,7 @@ rule_www_configure () { sudo install -d -m 750 -o www -g www \ /home/www/etc sudo install -d -m 1771 -o www-data -g www-data \ - /home/www/pub \ + /home/www/pub sudo install -d -m 1771 -o log.www -g log.www \ /home/www/log } @@ -1019,6 +1036,7 @@ rule_postfix_configure () { abuse: root admin: root contact: root + mailer-daemon: root postmaster: root root: $(getent group sudo | cut -f 4 -d : | tr , ' ') EOF @@ -1120,6 +1138,7 @@ rule_runit_configure () { "$tool"/etc/sv/"$sv"/configure then ln -fns ../sv/"$sv" /etc/service/"$sv" + test ! -e /etc/sv/"$sv"/supervise/ok || sv restart "$sv" fi done