Commit b3878d1b authored by Vitaly Lipatov's avatar Vitaly Lipatov

createbytask.int: small improvements

parent 3f60d10a
......@@ -38,7 +38,12 @@ rewrite_if_changed()
tune_hosts()
{
cat <<EOF >>/etc/hosts.tmpCB
cat <<EOF >/etc/hosts.tmpCB
127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
$VEIP $AUSER.site.azbyka.ru $AUSER
# Azbyka's hosts
192.168.3.188 memcached.azbyka
192.168.3.185 sphinx.azbyka
......@@ -50,14 +55,13 @@ cat <<EOF >>/etc/hosts.tmpCB
192.168.3.190 mariadb
192.168.3.190 mariadb.$AUSER
EOF
rewrite_if_changed /etc/hosts.tmpCB /etc/hosts && update_chrooted_conf
rewrite_if_changed /etc/hosts.tmpCB /etc/hosts && update_chrooted conf
}
tune_logrotate()
{
cat <<EOF >>/etc/logrotate.d/apache-home-local
cat <<EOF >/etc/logrotate.d/apache-home-local.tmpCB
/home/*/log/*.log {
missingok
rotate 3
......@@ -72,7 +76,7 @@ cat <<EOF >>/etc/logrotate.d/apache-home-local
endscript
}
EOF
rewrite_if_changed /etc/logrotate.d/apache-home-local.tmpCB /etc/logrotate.d/apache-home-local
}
tune_monit()
......@@ -204,7 +208,7 @@ groupadd $AUSER -g $AGROUPID
useradd -M $AUSER -u $AUSERID -g $AGROUPID #|| fatal
# locales
echo "%_install_langs ru_RU en_US" >/etc/rpm/macros
echo "%_install_langs ru:en:C" >/etc/rpm/macros
epmi --auto --skip-installed glibc-locales
tune_hosts
......
......@@ -125,6 +125,7 @@ echo "AUSER=$AUSER" | st tee -a $ATASK
echo "ACONF=$ACONF" | st tee -a $ATASK
echo "ADOMAIN=$ADOMAIN" | st tee -a $ATASK
echo "PKGINSTALL='$PKGINSTALL'" | st tee -a $ATASK
echo "VEIP=$VEIP" | st tee -a $ATASK
auserid=$(hostserver vzctl exec $VEIDORIG id -u $AUSER)
[ -n "$auserid" ] || fatal "can't get user id"
......@@ -134,6 +135,7 @@ agroupid=$(hostserver vzctl exec $VEIDORIG id -g $AUSER)
[ -n "$agroupid" ] || fatal "can't get group id"
echo "AGROUPID=$agroupid" | st tee -a $ATASK
#echo "WEBMASTER=$(vzctl exec $VEIDORIG id -g $AUSER)" | st tee -a $ATASK
cat createbytask.int.sh | st tee /tmp/createbytask.int.sh >/dev/null
......
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