Commit 49b54c15 authored by Vitaly Lipatov's avatar Vitaly Lipatov

small fixes

parent f16bd60b
......@@ -7,12 +7,16 @@ if [ -z "$1" ] || [ -z "$2" ]; then
exit;
fi
FROM=/var/lib/vz/private/$1/
TO=/var/lib/vz/private/$2/
. ./config
FROM=/var/lib/vz/private/$1
TO=/var/lib/vz/private/$2
CFGDIR=/etc/vz/conf
rsync -avPH --exclude "/home/" $FROM $TO
mkdir $(TO)home
rsync -avPH --exclude "/home/" $FROM/ $TO/
# FIXME: it is better to hold /home out of container
mkdir -p $TO/home
mkdir -p /var/lib/vz/root/$VEID/
cp $CFGDIR/$1.conf $CFGDIR/$2.conf
......@@ -21,7 +25,8 @@ cat <<EOF >$CFGDIR/$2.mount
# Mount script to bind-mount /var/something into a VPS
export VEID=\$(basename \$0 .mount)
. /etc/vz/vz.conf
mount --bind /var/lib/vz/root/$1/home /var/lib/vz/root/\$VEID/home
mount --bind /var/lib/vz/private/$1/home /var/lib/vz/root/\$VEID/home
EOF
chmod u+x $CFGDIR/$2.mount
#добавить замену ИП в конфиге
\ No newline at end of file
#!/bin/sh
# sites -> 341
#./clone_vz.sh 390 341
# Копируем конфиги
ROOTSYS=/var/lib/vz/private
FROM=$ROOTSYS/390
TCONT=341
TO=$ROOTSYS/$TCONT
rsync -av --progress --delete-after $FROM/etc/httpd2/conf/sites-enabled/ $TO/etc/httpd2/conf/sites-enabled/
rsync -av --progress --delete-after $FROM/etc/monitrc.d/ $TO/etc/monitrc.d/
rsync -av --progress --delete-after $FROM/etc/tcb/ $TO/etc/tcb/
for i in passwd shadow group ; do
rsync -av --progress --delete-after $FROM/etc/$i $TO/etc/$i
done
#rsync -av --progress --delete-after $FROM/etc/hosts $TO/etc/hosts
sed -e "s|192.168.3.90 sites.host03.eterhost.ru sites|192.168.3.41 sites41.host03.eterhost.ru sites41|g" < $FROM/etc/hosts >$TO/etc/hosts
vzctl exec $TCONT update_chrooted conf
vzctl exec $TCONT serv httpd2 restart
vzctl exec $TCONT serv monit restart
#!/bin/sh
tail -q -f /var/log/nginx/*access.log | while true ; do timeout --kill-after=1 1 tee /tmp/t.file >/dev/null ; wc -l </tmp/t.file ; [ -s /tmp/t.file ] || exit ; done
#!/bin/sh
FILE=/var/log/nginx/access.log
FILE=/var/log/nginx/*access.log
test -z "$1" || FILE="$1"
echo "=== Requests which took most of the time (from $FILE) ===" > url_report.txt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment