I found an unpleasant side effect of this method. autostartx writes to /root/.bash_profile commands that run after start of terminal:
case \`tty\` in
/dev/tty[1])
# place here any command that should auto start at terminal 1
# remove the # on the line below the see the text
# echo hello, this is terminal 1
startx
;;
esac
after several savings of /root directory these commands accumulate in .bash_profile and lead to the immediate relogin after logout in gnome. so it's require either delete unnecessary lines manually or (I prefer this) remove adding these lines from autostartx.