Página 1 de 1

Console not locking

MensagemEnviado: Dom Jul 27, 2008 6:57 pm
por bobbb
I found an occasion when the console does not lock on logout.

Login root
Highlight exit and hit ENTER. Now I get the message to type menu and type ENTER
menu and ENTER gives me the menu system.
Select Logout (now Select is highlighted on the menu)
Hitting ENTER does not give me the login prompt. If I type exit then I get the Login prompt.

Of course if I use PuTTY then it works correctly ( it exits PuTTY ).

Re: Console not locking

MensagemEnviado: Seg Jul 28, 2008 8:29 am
por Bender
Then logout of the menu only works the first time. If exit the menu and return does not work any longer.

Re: Console not locking

MensagemEnviado: Seg Jul 28, 2008 1:29 pm
por bobbb
I was wrong. I get the same results with PuTTY.
If exit the menu and return does not work any longer.
And I found that typing exit at the command line prompt does get you back to the login screen. So this is a work-around.

Is this a bug?

Re: Console not locking

MensagemEnviado: Qui Jul 31, 2008 9:02 am
por Claudio
Yes and no.

This behavior comes since Coyote 2.10, when i added the "logout" command to the menu. It's a bug, but it's not a new bug.

This logout works only when you get the menu for the first time, just after the login.

When you exit this "first" menu, the system opens a new shell instance and when you type menu it opens another instance over the first (it's like a stack). If you try to use the logout command from inside this second instance it just returns to the first.

Try this:
On the console type the command sh, the system will open a second shell
then type sh again, the sysem will open a third shell
then use the exit command, it returns to the second
exit again, returns to the first
exit again, now it logout.

I do not know a command which close all shell instances and force the logout from inside the third one. If that command exists then we could use it and fix this.

Re: Console not locking

MensagemEnviado: Qui Jul 31, 2008 4:49 pm
por bobbb
This behavior comes since Coyote 2.10, when i added the "logout"
And I had never noticed.

The experiment you describe with sh acts as in DOS, exit always gets back to the previous shell. Logical.

Then I guess we need to call this a feature. :)

Re: Console not locking

MensagemEnviado: Qui Ago 21, 2008 12:47 am
por eduardor
This a very ofuscated feature 8-)

Simply call a shell a Quit menu

1) Edit -usr-sbin-menu at Q

Código: Selecionar todos
      q | Q)   echo
         echo "Exiting menu. To return to the menu, simply type \"exit\" and"
         echo "press enter from the command prompt."
         echo
         /bin/sh
         #break

Note: EXIT from shell and return to MENU !

2) And a L
Código: Selecionar todos
      l | L )   exit 1;

Note: exit 1 o break :roll:

3) Edit ~/.profile

Código: Selecionar todos
# ~/.profile: executed for shells.

export HOSTNAME=`hostname`
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export PS1="$HOSTNAME# "

umask 022

#Comment next both lines to skip menu
/usr/sbin/menu
exit

Exit for break or leave at shell

Call a menu from shell, nest a new menu.
Avoid this, renaming menu to menu.sh (and .profile), and leave a old menu with an echo advise "Type exit, not menu ;-)" or better exit too.

I test it remotelly only :roll: