Sponsored Content
Full Discussion: Linux Changing Run Levels
Operating Systems Linux Debian Linux Changing Run Levels Post 302985771 by hicksd8 on Tuesday 15th of November 2016 04:41:17 AM
Old 11-15-2016
The bug in your system is that you don't have a /etc/inittab file. As far as I'm aware this file is always created at installation and the most you might do is edit it. Creating one from scratch is laborious and needs in-depth knowledge of exactly how you want the system to behave.

A typical Debian (Squeeze) inittab file looks like this:

Code:
 
 # /etc/inittab: init(8) configuration.
# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $

# The default runlevel.
id:2:initdefault:

# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS

# What to do in single-user mode.
~~:S:wait:/sbin/sulogin

# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.

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
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin

# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

# Action on special keypress (ALT-UpArrow).
#kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."

# What to do when the power fails/returns.
pf:powerwait:/etc/init.d/powerfail start
pn:powerfailnow:/etc/init.d/powerfail now
po:powerokwait:/etc/init.d/powerfail stop

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
# <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
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

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3

I suggest you try injecting the above into your inittab at least down to the comment line "# Normally not reached" even if you don't copy the rest. That might restore some resemblance of normality.

Obviously, this whole mechanism is surrounded by security. You couldn't allow an ordinary user to use 'init' to change run levels; only root can do that. Also, why would an ordinary user want to know the runlevel of the system? If they are allowed to read inittab they certainly wouldn't be allowed to write to it. So there may be a simple explanation why 'who -r' doesn't work properly for a non-root user.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Too many levels of symbolic links

Hi, Is there a limit to the number of symbolic links you can have? I tried to vi the symbolic link relating to a file and got the following error: "filename" Too many levels of symbolic links There is only one symbolic link to one file in this case, but there are >2000 other links to... (2 Replies)
Discussion started by: Bab00shka
2 Replies

2. Solaris

RAID Levels

hi, what are the RAID Levels followed for various File systems ? thanks (3 Replies)
Discussion started by: sol8admin
3 Replies

3. Solaris

Init levels

I have a problem, i dont know if its a normal behaviour or not, i can go to a lower init level, but i cant go to a higher one again, for instance i can run the command init 2 while im at init 3 and when i do who -r i find myself go down to 2 but if i type init 3 and wait im still finding myself in... (1 Reply)
Discussion started by: XP_2600
1 Replies

4. UNIX for Advanced & Expert Users

Unix Run Levels confusion

Hi, Could somebody throw some light on the below queries: - For a run-level X, the S* scripts are executed when coming here from X-n run-level. The K* scripts are executed when coming to X runlevel from X+n runlevel. - Does reaching to runlevel X from X-3 executes K* scritps from X-2 & X-1... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies

5. UNIX for Dummies Questions & Answers

Search through 2 levels of zip

Hi guys, I know I'm missing something simple here. We have about 500 zipped files in a directory which contain more zip files and within those I need to find a file without unzipping everything. I know I can use zipinfo which I'm trying to create a for loop to go through the files and... (4 Replies)
Discussion started by: petef
4 Replies

6. Solaris

Levels of support

Hello, I have a simple question because I can not find the information at oracle.com I want to buy support for OS Solaris and Servers hardware. I need information what are the levels of support and how much they cost? I need a help. Have a nice day (3 Replies)
Discussion started by: bieszczaders
3 Replies

7. Cybersecurity

Unable to run 'su' and 'sudo' after changing permissions on /etc

Hello, I'm running rhel6 64bit. Accidentally I ran % chmod -R 777 /etc and after that I have a problem to do 'su' or 'sudo'. When I did sudo it complained that /etc/sudoers has 777 while it should be 0440. I changed that and also restored right permission for: -rw-r--r-- 1 root root 1966 May 19... (2 Replies)
Discussion started by: susja
2 Replies

8. AIX

AIX How to run a Shell Script by changing the User

Hi All, Currently our application is running on the server having AIX 5.3 OS. What we intend to do is to run a shell script owned by another user and needs to be run as that particular user. I was trying to create a shell script using the su command before running the actual script (which... (4 Replies)
Discussion started by: acoomer
4 Replies

9. Solaris

Run levels in Solaris 11

Hi Guys, I need to change the following script ( which is good for Linux) for Solris 11 #start oracle start on runlevel stop on runlevel What it should be for Solrais 11. Thanks for your help. Regards Terry (2 Replies)
Discussion started by: terrykhatri531
2 Replies
vboxgetty(8)						    Linux System Administration 					      vboxgetty(8)

NAME
vboxgetty - isdn voice box (getty) SYNOPSIS
vboxgetty [OPTION] [OPTION] [...] DESCRIPTION
Vboxgetty is the heart of vbox: it watches the isdn system and waits for incoming voice calls, OPTIONS
-f, --file FILE Config file to use. Default is the file '/etc/isdn/vboxgetty.conf'. -d, --device TTY ISDNdevice to use. You must use this option! -h, --help Show summary of options. -v, --version Show version of program. CONFIGURING VBOX
vboxgetty should be started from the init process. To do this you need one line per vboxgetty in /etc/inittab like this one: I5:2345:respawn:'/usr/sbin'/vboxgetty -d /dev/ttyI5 The next step is to set up a working configuration for all ports in /etc/isdn/vboxgetty.conf: read vboxgetty.conf(5) how to do this and look at the example config file in /usr/share/doc/isdnvboxserver/examples. You should then create the spool directories for each user: /var/spool/vbox/<user>, /var/spool/vbox/<user>/incoming and /var/spool/vbox/<user>/messages. Copy the example config files vbox.conf and standard.tcl from /usr/share/isdnvboxserver/default/ to /var/spool/vbox/<user>, read the man pages vbox.conf(5) and vboxtcl(5) and edit these config files. Change the owner of all files in /var/spool/vbox/<user> with "chown <user>.<group> /var/spool/vbox/<user> -Rv" and correct the permissions with "chmod o-rwx,g-rwx /var/spool/vbox/<user> -Rv". The last step: run "init q" to force init to reread /etc/inittab HOW IT WORKS
For each line in /etc/inittab one vboxgetty is started by init. Make sure the first field (ID) and the device file are different. Each vboxgetty does this: First /etc/isdn/vbox.conf is read, the global settings are loaded and then the port specific settings. Then vboxgetty waits for an incoming call. On an incoming call vboxgetty reads /var/spool/vbox/<user>/vbox.conf (unless you change that name), and vboxgetty determines if it should take that call or how many RINGs it should wait. It also gets the name of the standard message, beep message, timeout message, if these should be played and an alias for the current caller, if there is one. If vbox has waited enough RINGs and the caller is still ringing, it takes the call and starts the tcl script /var/spool/vbox/<user>/stan- dard.tcl (unless you change that name), and this script will do the rest (normally: play standard and beep message, record and then play timeout message). FILES
/etc/isdn/vboxgetty.conf default config file /etc/inittab init starts vboxgetty via this file. /etc/isdn/vboxgetty.conf the global vbox config file /var/spool/vbox/<user>/vbox.conf the per user configuration file for this port /var/spool/vbox/<user>/standard.tcl the tcl script used to communicate with the caller /var/run/vboxgetty-<device>.pid process id of the vboxgetty /var/log/vbox/vboxgetty-<device>.log logfile of the vboxgetty SEE ALSO
vboxgetty.conf(5), vbox.conf(5), vboxtcl(5), isdntime(5) AUTHOR
This manual page was written by Andreas Jellinghaus <aj@dungeon.inka.de>, for Debian GNU/Linux and isdn4linux. ISDN 4 Linux 3.25 2000/09/15 vboxgetty(8)
All times are GMT -4. The time now is 01:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy