Автологин в дебиан (странности с вирт. консолями)

Настройка графического интерфейса, Иксов, десктопов, оконных менеджеров и иксовых терминалов

Модератор: Модераторы разделов

Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Автологин в дебиан

Сообщение Stanislav Potapchik »

настроил по http://avreg.net/howto_icewm.html
всё работает, но Х запускается на 2-ой консоли и ни одной вирт.консоли больше не доступно. т.е. перехожу на 3-6 и там только курсор в углу мигает. первая тоже занята. kill X, логинюсь в первой, startx - всё нормально. ЧЯНТД ?
Спасибо сказали:
Аватара пользователя
drBatty
Сообщения: 8735
Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
ОС: Slackware-current

Re: Автологин в дебиан

Сообщение drBatty »

Stanislav Potapc... писал(а):
09.10.2009 16:00
но Х запускается на 2-ой консоли

что пишет

Код: Выделить всё

 sed -r '/^(\#.*)?$/d' /etc/inittab

?
http://emulek.blogspot.ru/ Windows Must Die
Учебник по sed зеркало в github

Скоро придёт
Осень
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

id:2:initdefault:
si::sysinit:/etc/init.d/rcS
~~:S:wait:/sbin/sulogin
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
z6:6:respawn:/sbin/sulogin
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
Спасибо сказали:
Аватара пользователя
drBatty
Сообщения: 8735
Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
ОС: Slackware-current

Re: Автологин в дебиан

Сообщение drBatty »

Stanislav Potapc... писал(а):
09.10.2009 23:45
id:2:initdefault:

у вас как-то всё сложно. но вот тут по другому почему-то сделано:
http://www.nestor.minsk.by/kg/1998/50/kg85009.htm
(там не сразу про деб, отмотайте про слаку).
вот ещё полезная ссылка: http://wiki.kryukov.biz/wiki/Init

Stanislav Potapc... писал(а):
09.10.2009 23:45
si::sysinit:/etc/init.d/rcS

сначала этот скрипт выполнится, потом этот:
Stanislav Potapc... писал(а):
09.10.2009 23:45
l2:2:wait:/etc/init.d/rc 2

пробел перед двойкой это опечатка?

а потом инициализируются одновременно сразу 6 консолей.
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6


может они просто не успевают инициализироваться?
http://emulek.blogspot.ru/ Windows Must Die
Учебник по sed зеркало в github

Скоро придёт
Осень
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

у вас как-то всё сложно. но вот тут по другому почему-то сделано:


ничего специально не настраивал, только снёс гдм и строку прописал.
конкретные предложения есть?
Спасибо сказали:
Аватара пользователя
drBatty
Сообщения: 8735
Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
ОС: Slackware-current

Re: Автологин в дебиан

Сообщение drBatty »

Stanislav Potapc... писал(а):
10.10.2009 03:10
ничего специально не настраивал, только снёс гдм и строку прописал.
конкретные предложения есть?

поставить GDM.
или попробовать паузу, respawn оно запускается без ожидания остановки
http://emulek.blogspot.ru/ Windows Must Die
Учебник по sed зеркало в github

Скоро придёт
Осень
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

drBatty писал(а):
10.10.2009 04:08
поставить GDM.
или попробовать паузу, respawn оно запускается без ожидания остановки

вариации с wait не принесли ни какого другого результата.
может что в строке запуска поменять, ведь я писал, что по startx всё проходит нормально?
Спасибо сказали:
Аватара пользователя
drBatty
Сообщения: 8735
Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
ОС: Slackware-current

Re: Автологин в дебиан

Сообщение drBatty »

Stanislav Potapc... вы найдите где у вас запускаются иксы, и перед этим поставьте sleep 1.
Stanislav Potapc... писал(а):
09.10.2009 23:45
l2:2:wait:/etc/init.d/rc 2

наверное этот скрипт, с параметром 2.
кстати, а что там? в /etc/init.d/rc
http://emulek.blogspot.ru/ Windows Must Die
Учебник по sed зеркало в github

Скоро придёт
Осень
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

Код:

#! /bin/sh # # rc # # Starts/stops services on runlevel changes. # # Optimization: A start script is not run when the service was already # configured to run in the previous runlevel. A stop script is not run # when the the service was already configured not to run in the previous # runlevel. # # Authors: # Miquel van Smoorenburg <miquels@cistron.nl> # Bruce Perens <Bruce@Pixar.com> PATH=/sbin:/usr/sbin:/bin:/usr/bin export PATH # Un-comment the following for interactive debugging. Do not un-comment # this for debugging a real boot process as no scripts will be executed. # debug=echo # Specify method used to enable concurrent init.d scripts. # Valid options are 'none', 'startpar' and 'makefile'. To enable # the concurrent boot option, the init.d script order must allow for # concurrency. This is not the case with the default boot sequence in # Debian as of 2008-01-20. Before enabling concurrency, one need to # check the sequence values of all boot scripts, and make sure only # scripts that can be started in parallel have the same sequence # number, and that a scripts dependencies have a earlier sequence # number. See the insserv package for a away to reorder the boot # automatically to allow this. CONCURRENCY=none # Make sure the name survive changing the argument list scriptname="$0" umask 022 on_exit() { echo "error: '$scriptname' exited outside the expected code flow." } trap on_exit EXIT # Enable emergency handler # Ignore CTRL-C only in this shell, so we can interrupt subprocesses. trap ":" INT QUIT TSTP # Set onlcr to avoid staircase effect. stty onlcr 0>&1 # Functions for splash progress bars if [ -e /lib/init/splash-functions-base ] ; then . /lib/init/splash-functions-base else # Quiet down script if old initscripts version without /lib/init/splash-functions-base is used. splash_progress() { return 1; } splash_stop() { return 1; } fi # Now find out what the current and what the previous runlevel are. runlevel=$RUNLEVEL # Get first argument. Set new runlevel to this argument. [ "$1" != "" ] && runlevel=$1 if [ "$runlevel" = "" ] then echo "Usage: $scriptname <runlevel>" >&2 exit 1 fi previous=$PREVLEVEL [ "$previous" = "" ] && previous=N export runlevel previous if [ -f /etc/default/rcS ] ; then . /etc/default/rcS fi export VERBOSE if [ -f /lib/lsb/init-functions ] ; then . /lib/lsb/init-functions else log_action_msg() { echo $@; } log_failure_msg() { echo $@; } log_warning_msg() { echo $@; } fi # # Stub to do progress bar ticks (for splash programs) on startup # startup_progress() { # Avoid divide by zero if anyone moved xdm/kdm/gdm first in a runlevel. if [ 0 -eq "$num_steps" ] ; then return; fi step=$(($step + $step_change)) progress=$(($step * $progress_size / $num_steps + $first_step)) $debug splash_progress "$progress" || true } # # Check if we are able to use make like booting. It require the # insserv package to be enabled. Boot concurrency also requires # startpar to be installed. # if [ "none" != "$CONCURRENCY" ] ; then test -s /etc/init.d/.depend.boot || CONCURRENCY="none" test -s /etc/init.d/.depend.start || CONCURRENCY="none" test -s /etc/init.d/.depend.stop || CONCURRENCY="none" startpar -v > /dev/null 2>&1 || CONCURRENCY="none" fi # # Start script or program. # case "$CONCURRENCY" in startpar|shell) # shell is obsolete log_action_msg "Using startpar-style concurrent boot in runlevel $runlevel" startup() { action=$1 shift scripts="$@" # Update progress bar counter and jump to the new position for script in $scripts ; do step=$(($step + $step_change)) done [ -n "$scripts" ] && $debug startpar -a $action $scripts # Jump back one step to compencate for stepping one # time too many in the for loop. step=$(($step - $step_change)) startup_progress } ;; makefile) log_action_msg "Using makefile-style concurrent boot in runlevel $runlevel" # The splash API is not handled with this CONCURRENCY mode startup() { eval "$(startpar -p 4 -t 20 -T 3 -M $1 -P $previous -R $runlevel)" if [ -n "$failed_service" ] then log_failure_msg "startpar: service(s) returned failure: $failed_service" fi if [ -n "$skipped_service" ] then log_warning_msg "startpar: service(s) skipped: $skipped_service" fi unset failed_service skipped_service } ;; none|*) startup() { action=$1 shift scripts="$@" for script in $scripts ; do $debug "$script" $action startup_progress done } ;; esac # Check if the splash screen should be stopped before the given # script. is_splash_stop_scripts() { scriptname=$1 case "$scriptname" in # killprocs is used in runlevel 1 gdm|xdm|kdm|ltsp-client|ltsp-client-core|reboot|halt|killprocs) return 0 ;; esac return 1 } # Is there an rc directory for this new runlevel? if [ -d /etc/rc$runlevel.d ] then # Find out where in the progress bar the initramfs got to. PROGRESS_STATE=0 if [ -f /dev/.initramfs/progress_state ]; then . /dev/.initramfs/progress_state fi # Split the remaining portion of the progress bar into thirds progress_size=$(((100 - $PROGRESS_STATE) / 3)) case "$runlevel" in 0|6) ACTION=stop # Count down from 0 to -100 and use the entire bar first_step=0 progress_size=100 step_change=-1 ;; S) ACTION=start # Begin where the initramfs left off and use 2/3 # of the remaining space first_step=$PROGRESS_STATE progress_size=$(($progress_size * 2)) step_change=1 ;; *) ACTION=start # Begin where rcS left off and use the final 1/3 of # the space (by leaving progress_size unchanged) first_step=$(($progress_size * 2 + $PROGRESS_STATE)) step_change=1 ;; esac # Count the number of scripts we need to run # (for progress bars) num_steps=0 for s in /etc/rc$runlevel.d/[SK]*; do if is_splash_stop_scripts "${s##/etc/rc$runlevel.d/S??}" ; then break fi num_steps=$(($num_steps + 1)) done step=0 if [ makefile = "$CONCURRENCY" ] then [ "$previous" != N ] && startup stop # First, run the KILL scripts. elif [ "$previous" != N ] then # Run all scripts with the same level in parallel CURLEVEL="" for s in /etc/rc$runlevel.d/K* do # Extract order value from symlink level=${s#/etc/rc$runlevel.d/K} level=${level%%[a-zA-Z]*} if [ "$level" = "$CURLEVEL" ] then continue fi CURLEVEL=$level SCRIPTS="" for i in /etc/rc$runlevel.d/K$level* do # Check if the script is there. [ ! -f $i ] && continue # # Find stop script in previous runlevel but # no start script there. # suffix=${i#/etc/rc$runlevel.d/K[0-9][0-9]} previous_stop=/etc/rc$previous.d/K[0-9][0-9]$suffix previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix # # If there is a stop script in the previous level # and _no_ start script there, we don't # have to re-stop the service. # [ -f $previous_stop ] && [ ! -f $previous_start ] && continue # Stop the service. SCRIPTS="$SCRIPTS $i" if is_splash_stop_scripts "$suffix" ; then $debug splash_stop || true fi done startup stop $SCRIPTS done fi if [ makefile = "$CONCURRENCY" ] then if [ S = "$runlevel" ] then startup boot else startup $ACTION fi else # Now run the START scripts for this runlevel. # Run all scripts with the same level in parallel CURLEVEL="" for s in /etc/rc$runlevel.d/S* do # Extract order value from symlink level=${s#/etc/rc$runlevel.d/S} level=${level%%[a-zA-Z]*} if [ "$level" = "$CURLEVEL" ] then continue fi CURLEVEL=$level SCRIPTS="" for i in /etc/rc$runlevel.d/S$level* do [ ! -f $i ] && continue suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]} if [ "$previous" != N ] then # # Find start script in previous runlevel and # stop script in this runlevel. # stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix # # If there is a start script in the previous level # and _no_ stop script in this level, we don't # have to re-start the service. # if [ start = "$ACTION" ] ; then [ -f $previous_start ] && [ ! -f $stop ] && continue else # Workaround for the special # handling of runlevels 0 and 6. previous_stop=/etc/rc$previous.d/K[0-9][0-9]$suffix # # If there is a stop script in the previous level # and _no_ start script there, we don't # have to re-stop the service. # [ -f $previous_stop ] && [ ! -f $previous_start ] && continue fi fi SCRIPTS="$SCRIPTS $i" if is_splash_stop_scripts "$suffix" ; then $debug splash_stop || true fi done startup $ACTION $SCRIPTS done fi fi trap - EXIT # Disable emergency handler exit 0
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

Stanislav Potapc... вы найдите где у вас запускаются иксы, и перед этим поставьте sleep 1.


z6:6:respawn:/sbin/sulogin


по идее должна эта строчка работать. но почему то операторов нет, уровень 6 и хелп пишет, что только от рута.
Спасибо сказали:
Аватара пользователя
drBatty
Сообщения: 8735
Статус: GPG ID: 4DFBD1D6 дом горит, козёл не видит...
ОС: Slackware-current

Re: Автологин в дебиан

Сообщение drBatty »

Stanislav Potapc... писал(а):
10.10.2009 23:56
по идее должна эта строчка работать. но почему то операторов нет, уровень 6 и хелп пишет, что только от рута.

эта строчка работает во время выключения компа - уровень 6. Операторы можете сами добавить, у меня например пишет: "Уходя гасите свет" :)

ЗЫЖ Честно говоря, тут уже дебиановские примочки - я в них к сожалению не разбираюсь, в Slackware всё намного проще...
http://emulek.blogspot.ru/ Windows Must Die
Учебник по sed зеркало в github

Скоро придёт
Осень
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

эксперименты показали, что суть проблемы в правильном заходе в систему.
то есть когда логинимся и вводим пароль - всё нормально.
если автологином без ввода пароля- проблема.
а где прописан startx или xinit `which startfluxbox` роли вообще не играет.
Спасибо сказали:
Gugloed
Сообщения: 50

Re: Автологин в дебиан

Сообщение Gugloed »

Я, к примеру, использую mingetty:

Код: Выделить всё

2:23:respawn:/sbin/mingetty --autologin anna tty2

ну и в ~/.bash_login прописала:

Код: Выделить всё

if [[ $(tty) = /dev/tty2 ]];then
    exec startxfce4
fi


На мой взгляд, наименее «велосипедное» решение. Всё работает, всем довольна.
Красная площадь — это не только точное время, но и культурная программа с цирком и зоопарком.
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

Gugloed писал(а):
13.10.2009 21:31
Я, к примеру, использую mingetty:

Код: Выделить всё

2:23:respawn:/sbin/mingetty --autologin anna tty2

ну и в ~/.bash_login прописала:

Код: Выделить всё

if [[ $(tty) = /dev/tty2 ]];then
    exec startxfce4
fi


На мой взгляд, наименее «велосипедное» решение. Всё работает, всем довольна.



у вас доступны все заявленные вирт. консоли?
Спасибо сказали:
Gugloed
Сообщения: 50

Re: Автологин в дебиан

Сообщение Gugloed »

Да, конечно, работают все шесть вируальных консолей. Даже если использовать upstart для загрузки системы — всё равно работает.

Лирическое отступление: если использовать GNU Screen, вирутальные консоли становтся практически не нужны.
Красная площадь — это не только точное время, но и культурная программа с цирком и зоопарком.
Спасибо сказали:
Аватара пользователя
Stanislav Potapchik
Сообщения: 271
ОС: Debian, Ubuntu, Mint

Re: Автологин в дебиан

Сообщение Stanislav Potapchik »

попробовал по вашему, Gugloed.
если запускать с tty2 - она и занята, держит команду startx. то есть можно на её зайти- ctl+c (завалить Х)
Спасибо сказали: