Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Have to log out of a virtual terminal twice in order to exit virtual terminals Post 302397101 by Narnie on Saturday 20th of February 2010 11:08:02 PM
Old 02-21-2010
Have to log out of a virtual terminal twice in order to exit virtual terminals

Not really a newbie, but I have a strange problem and I'm not sure how to further troubleshoot it.

I have to log out of a virtual terminal by typing exit, then exit again as in:

Code:
woodnt@toshiba-laptop ~ $ exit
logout
woodnt@toshiba-laptop ~ $ exit
logout

I DON'T have to do this when I'm using gnome-terminal or xterm. It just exits.

I do notice that if I have done this in xterm for example:

Code:
woodnt@toshiba-laptop ~ $ bash
woodnt@toshiba-laptop ~ $ bash
woodnt@toshiba-laptop ~ $ exit
exit
woodnt@toshiba-laptop ~ $ exit
exit
woodnt@toshiba-laptop ~ $

It lists exit instead of logout after typing exit.

Now lest one thinks it is that I have typed bash in the vtty, that is not the case. Also, echoing $SHLVL gives:

Code:
woodnt@toshiba-laptop ~ $ echo $SHLVL 
1

so I'm not in subshells.

I have mv ~/.profile ~/.profile.bak and mv ~/.bashrc ~/.bashrc.bak to make sure that it is nothing that I have done.

Other users can log in a vtty and completely exit with one command.

I'm not sure how the vtty's work nor how to begin to toubleshoot this further.

Any ideas?

With thanks,
Narnie

PS

btw, I have also renamed my .bash_logout script as well so it isn't in that. However, one wouldn't think it would be there anyway as I'd never be able to log out.

It is something that is different about a vtty (via getty) vs windowed terminal.

A check of getty process shows:

Code:
woodnt@toshiba-laptop ~ $ ps auxf|grep -v grep|grep tty
root      1245  8.1  3.1 243252 126236 tty7    Ss+  Feb19  11:38      \_ /usr/bin/X :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-QfOGCe/database -nolisten tcp vt7
root      1395  0.0  0.0   5988   492 tty4     Ss+  Feb19   0:00 /sbin/getty -8 38400 tty4
root      1411  0.0  0.0   5988   492 tty5     Ss+  Feb19   0:00 /sbin/getty -8 38400 tty5
root      1441  0.0  0.0   5988   492 tty2     Ss+  Feb19   0:00 /sbin/getty -8 38400 tty2
root      1442  0.0  0.0   5988   492 tty3     Ss+  Feb19   0:00 /sbin/getty -8 38400 tty3
root      1444  0.0  0.0   5988   492 tty6     Ss+  Feb19   0:00 /sbin/getty -8 38400 tty6
root      3968  0.0  0.0   5988   492 tty1     Ss+  Feb19   0:00 /sbin/getty -8 38400 tty1

 

9 More Discussions You Might Find Interesting

1. AIX

how to create virtual terminals

Hello All! I want to know how to create virtual terminals in aix. As in Linux, simply by using Ctl-Alt-F1-F6 keys, i can switch to any of the 6 corresponding virtual terminals. But i dont know how to do that in AIX. Also if I access an AIX server through remote desktop, will the method to create... (0 Replies)
Discussion started by: Anubhuti
0 Replies

2. UNIX for Advanced & Expert Users

Differentiating between Virtual and non Virtual IP addresses

Hello, I would like to know if there is a command or any configuration file to find and differentiate the Virtual IP Addresses (of the Cluster Resource Group) and the IP Address of the Cluster Node. I observe that the ifconfig -a command returns all the IP addresses configured on the ... (1 Reply)
Discussion started by: vineetd
1 Replies

3. UNIX for Dummies Questions & Answers

Need to check all virtual hostnames/virtual IP's

Hi Folks, I want to check all the virtual hostname's/IP's of a host/ip. Currently we are using HP-UX and open SuSe. Please tell me the command to list out all virtual names of a particular host. many thanks in advance. (2 Replies)
Discussion started by: sai21
2 Replies

4. Solaris

Is there any Virtual data center as we have Virtual Machine?

Do we have any Virtual Data Center software as we have Virtual Machine? I want to practice everything of Solaris practically but i don't have resources like data center which includes Servers, Data storages, switches, and other things. (2 Replies)
Discussion started by: karman0931
2 Replies

5. AIX

How to open multiple virtual terminals to a single LPAR

I just wondering if there are ways to open multiple virtual terminal to a single LPAR. After I have use putty to login to the VIOS. I will use mkvt -id <LPAR id> to open console but if my friend want to open 2 second one, it will say, VT already connected. IS there a way to work this around ? ... (1 Reply)
Discussion started by: wingcross
1 Replies

6. Solaris

Change hostID of Solaris 10 virtual/guest machine installed by Virtual Box 4.1.12 on Windows-XP host

Trying to set or modify the randomly set hostID of a Solaris 10 virtual/guest machine that I installed on a Windows-XP host machine (using Virtual Box 4.1.12). I was able to set/modify the hostname of the Solaris 10 virtual/guest machine during installation as well as via the Virtual Box... (4 Replies)
Discussion started by: Matt_VB
4 Replies

7. Shell Programming and Scripting

Displaying Formatted Text on Virtual Terminal

Hi, I'm working on a project that requires formatted text to be displayed on the screen plugged into a Linux machine. I want to be able to control this text via a bash script and format it in a particular font and size. Changing the background colour would also be beneficial. Does anyone know... (3 Replies)
Discussion started by: lcoor65
3 Replies

8. UNIX for Beginners Questions & Answers

Providing virtual machine priority in kvm based virtual machines

Hi All, Is there any way I can prioritize my VMs when there is resource crunch in host machine so that some VMs will be allocated more vcpu, more memory than other VMs in kvm/qemu hypervisor based virtual machines? Lets say in my cloud environment my Ubuntu 16 compute hosts are running some... (0 Replies)
Discussion started by: SanjayK
0 Replies

9. Solaris

Virtual Terminal (Console) showing non-global zone?

Hope that everyone is doing well today. Happy Friday. I am running an illumos (opensolaris) based system which is like SmartOS, OmniOS, and OpenIndiana I have been searching all over the Internet into various documents and forms that have to do with Solaris, Opensolaris, Illumos, and SmartOS... (3 Replies)
Discussion started by: LonnieTC
3 Replies
INITTAB(5)						Linux System Administrator's Manual						INITTAB(5)

NAME
inittab - format of the inittab file used by the sysv-compatible init process DESCRIPTION
The inittab file describes which processes are started at bootup and during normal operation (e.g. /etc/init.d/boot, /etc/init.d/rc, get- tys...). Init(8) distinguishes multiple runlevels, each of which can have its own set of processes that are started. Valid runlevels are 0-6 plus A, B, and C for ondemand entries. An entry in the inittab file has the following format: id:runlevels:action:process Lines beginning with `#' are ignored. id is a unique sequence of 1-4 characters which identifies an entry in inittab (for versions of sysvinit compiled with the old libc5 (< 5.2.18) or a.out libraries the limit is 2 characters). Note: traditionally, for getty and other login processes, the value of the id field is kept the same as the suffix of the corre- sponding tty, e.g. 1 for tty1. Some ancient login accounting programs might expect this, though I can't think of any. runlevels lists the runlevels for which the specified action should be taken. action describes which action should be taken. process specifies the process to be executed. If the process field starts with a `+' character, init will not do utmp and wtmp accounting for that process. This is needed for gettys that insist on doing their own utmp/wtmp housekeeping. This is also a historic bug. The runlevels field may contain multiple characters for different runlevels. For example, 123 specifies that the process should be started in runlevels 1, 2, and 3. The runlevels for ondemand entries may contain an A, B, or C. The runlevels field of sysinit, boot, and boot- wait entries are ignored. When the system runlevel is changed, any running processes that are not specified for the new runlevel are killed, first with SIGTERM, then with SIGKILL. Valid actions for the action field are: respawn The process will be restarted whenever it terminates (e.g. getty). wait The process will be started once when the specified runlevel is entered and init will wait for its termination. once The process will be executed once when the specified runlevel is entered. boot The process will be executed during system boot. The runlevels field is ignored. bootwait The process will be executed during system boot, while init waits for its termination (e.g. /etc/rc). The runlevels field is ignored. off This does nothing. ondemand A process marked with an ondemand runlevel will be executed whenever the specified ondemand runlevel is called. However, no run- level change will occur (ondemand runlevels are `a', `b', and `c'). initdefault An initdefault entry specifies the runlevel which should be entered after system boot. If none exists, init will ask for a runlevel on the console. The process field is ignored. sysinit The process will be executed during system boot. It will be executed before any boot or bootwait entries. The runlevels field is ignored. powerwait The process will be executed when the power goes down. Init is usually informed about this by a process talking to a UPS connected to the computer. Init will wait for the process to finish before continuing. powerfail As for powerwait, except that init does not wait for the process's completion. powerokwait This process will be executed as soon as init is informed that the power has been restored. powerfailnow This process will be executed when init is told that the battery of the external UPS is almost empty and the power is failing (pro- vided that the external UPS and the monitoring process are able to detect this condition). ctrlaltdel The process will be executed when init receives the SIGINT signal. This means that someone on the system console has pressed the CTRL-ALT-DEL key combination. Typically one wants to execute some sort of shutdown either to get into single-user level or to reboot the machine. kbrequest The process will be executed when init receives a signal from the keyboard handler that a special key combination was pressed on the console keyboard. The documentation for this function is not complete yet; more documentation can be found in the kbd-x.xx packages (most recent was kbd-0.94 at the time of this writing). Basically you want to map some keyboard combination to the "KeyboardSignal" action. For exam- ple, to map Alt-Uparrow for this purpose use the following in your keymaps file: alt keycode 103 = KeyboardSignal EXAMPLES
This is an example of a inittab which resembles the old Linux inittab: # inittab for linux id:1:initdefault: rc::bootwait:/etc/rc 1:1:respawn:/etc/getty 9600 tty1 2:1:respawn:/etc/getty 9600 tty2 3:1:respawn:/etc/getty 9600 tty3 4:1:respawn:/etc/getty 9600 tty4 This inittab file executes /etc/rc during boot and starts mingettys on tty1-tty4. A more elaborate inittab with different runlevels (see the comments inside): # Level to run in id:2:initdefault: # Boot-time system configuration/initialization script. si:I:bootwait:/etc/init.d/boot # Runlevel 0 is System halt (Never use this as initdefault!) # Runlevel 1 is Single user mode # Runlevel 2 is Local multiuser without remote network (e.g. NFS) # Runlevel 3 is Full multiuser with network # Runlevel 4 is Not used # Runlevel 5 is Full multiuser with network and xdm # Runlevel 6 is System reboot (Never use this as initdefault!) 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 # What to do in single-user mode ls:S:wait:/etc/init.d/rc S ~~:S:respawn:/sbin/sulogin # What to do at the "3 finger salute". ca::ctrlaltdel:/sbin/shutdown -t5 -h now # Runlevel 2 upto 5: mingetty on console. # level 2, 3, and 5 also getty on serial port S0. 1:2345:respawn:/sbin/mingetty --noclear tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 S0:235:respawn:/sbin/agetty -L 9600 ttyS0 vt102 # modem getty(s), # /dev/modem is a link to the modem device. #mo:235:respawn:/usr/sbin/mgetty -s 38400 modem mo:235:respawn:/sbin/uugetty modem M19200 FILES
/etc/inittab AUTHOR
Init was written by Miquel van Smoorenburg (miquels@cistron.nl). This manual page was written by Sebastian Lederer (lederer@fran- cium.informatik.uni-bonn.de) and modified by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de). SEE ALSO
init(8), telinit(8), init.d(7), agetty(8), mgetty(8) Dec 4, 2001 INITTAB(5)
All times are GMT -4. The time now is 05:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy