LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-06-2011, 09:50 AM   #1
autogeek
LQ Newbie
 
Registered: Jan 2011
Location: Gothenburg
Distribution: Arch x86_64
Posts: 11

Rep: Reputation: 0
Cannot switch runlevel


I recently installed slackware and while I was in the process of installing video drivers, I noticed something odd.

"init 3" (or init anything) doesn't seem to work for me. While working in XFCE, when I do "init 3", nothing happens. But then, when I do "who -r" it says I am in runlevel 3 even though I am still in XFCE.

Further, "xdm stop" doesn't work and exits with the error:
Code:
xdm error (pid 2973): extra arguments on command line: "stop"
Now every time I have to shut down the X server, I have to restart my computer.

What am I doing wrong here?
 
Old 01-06-2011, 10:11 AM   #2
samac
Senior Member
 
Registered: Mar 2004
Location: Westray, Orkney
Distribution: Linux Mint 17.1
Posts: 1,424

Rep: Reputation: 138Reputation: 138
Hi

Welcome to the forum and to Slackware.

I just tried this and I suspect that you are trying to run these commands as a user rather than as root.
Quote:
samac@quad:~$ xdm stop
xdm error (pid 2788): extra arguments on command line: "stop"
Only root wants to run xdm
Quote:
samac@quad:~$ init 3
bash: init: command not found
All you need to do is su to root and it will work.

It has also been suggested on this forum that you do init 5 and then init 3 as it closes X down in a tidier manner.

You can also access tty6 by pressing [ctrl,alt,F6] together. [alt,F7] will get you back to X.

samac
 
Old 01-06-2011, 10:52 AM   #3
ROXR
Member
 
Registered: Jan 2009
Location: Spain
Posts: 114
Blog Entries: 1

Rep: Reputation: 20
Can also try telinit 3 command and telinit 4 for came back
 
Old 01-06-2011, 11:23 AM   #4
autogeek
LQ Newbie
 
Registered: Jan 2011
Location: Gothenburg
Distribution: Arch x86_64
Posts: 11

Original Poster
Rep: Reputation: 0
@samac
Nope. The problem happens even in root. Here are the results from the commands:

Code:
root@arikere:~>who -r
         run-level 5  Jan  6 18:20                   last=3
root@arikere:~>init 3
root@arikere:~>who -r
         run-level 3  Jan  6 18:20                   last=5
root@arikere:~>init 5
root@arikere:~>who -r
         run-level 5  Jan  6 18:20                   last=3
root@arikere:~>telinit 3
root@arikere:~>who -r
         run-level 3  Jan  6 18:20                   last=5
root@arikere:~>xdm stop
xdm error (pid 2663): extra arguments on command line: "stop"
root@arikere:~>exit
arikere@arikere:~>init 3
bash: init: command not found
arikere@arikere:~>xdm stop
xdm error (pid 2666): extra arguments on command line: "stop"
Only root wants to run xdm
arikere@arikere:~>
As you can see, according to "who -r" I switch runlevels after each "init" or "telinit". But I never left XFCE during that whole piece of code above. As for "xdm stop", the issue is only when I am root as I cannot even run it otherwise.

And if I am correct, ctrl+alt+F6 doesn't shut down the X server. I need to shut down the X server and go to runlevel 3 as I am trying to install video drivers.

@ROXR
telinit doesn't work either. See the code above.
 
Old 01-06-2011, 12:24 PM   #5
alekow
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 138

Rep: Reputation: 21
Did you try running "telinit 3" AFTER switching to tty6 (alt+ctrl+F6)? Try logging out of x before.

Last edited by alekow; 01-06-2011 at 12:26 PM.
 
Old 01-06-2011, 12:57 PM   #6
autogeek
LQ Newbie
 
Registered: Jan 2011
Location: Gothenburg
Distribution: Arch x86_64
Posts: 11

Original Poster
Rep: Reputation: 0
@alekow
How do I log out of X server? ctrl+alt+backspace? For me that just restarts xdm and leaves me at XFCE's login. I tried this, followed by ctrl+alt+F6 and then telinit 3. Still didn't work.
 
Old 01-06-2011, 01:13 PM   #7
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,841

Rep: Reputation: Disabled
have a look at "man telinit", there's lotta interesting stuff: you could have a problem with your /etc/inittab or /dev/initctl or whatever else...
 
Old 01-06-2011, 02:03 PM   #8
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 56
Quote:
Originally Posted by autogeek View Post
@alekow
How do I log out of X server? ctrl+alt+backspace? For me that just restarts xdm and leaves me at XFCE's login. I tried this, followed by ctrl+alt+F6 and then telinit 3. Still didn't work.
Log in to XFCE.

Start a konsole.
issue the command "su -" (the - means give me the environment, too).
issue the command "telinit 3"

This will shut down X, thus destroying your konsole. What you should see, then, is one of the other console login sessions. No xdm, no xfce. From there you can log in as either yourself and "su -" "telinit 4" to start up X again, or log in as root and "telinit 4" to start up X again.

The reason the - is required is that root's path and a normal user's path are different. The - sets up the environment of the su target user.

If you see the xdm/xfce login screen and ctrl-alt-f6 to get to vt 6 and log in as root and "telinit 3" then your login session won't be disturbed when X shuts down because vt6 runs in both runlevels 3 and 4. From there you can "telinit 4" again and X will restart.

If you switch to vt 1-5 during a runlevel 3 session, log in as root, and issue "telinit 4" you'll see your login session disappear as X gets started and vt 1-5 killed by standard init settings.

Edit: the ctrl-alt-backspace thing.
Somewhere in xdmrc or kdmrc (I'm pretty sure about kdmrc) there's a setting that allows shutting down X or not. So, ctrl-alt-backspace may do nothing.

However, if ctrl-alt-backspace is enabled and you use it to shutdown X then the normal init system takes over. If you're initted to runlevel 4 and you shutdown X then init will fire it right back up since X runs in runlevel 4. Heh.

Edit 2: A short history lesson.
IIRC, in the old days init could only be run by the startup process. So, root could not invoke init after the system had started. Thus, telinit ("tell init") was born. Still the slackware man pages list different options for init and telinit.

Last edited by jamesf; 01-06-2011 at 02:12 PM. Reason: history
 
Old 01-06-2011, 02:22 PM   #9
autogeek
LQ Newbie
 
Registered: Jan 2011
Location: Gothenburg
Distribution: Arch x86_64
Posts: 11

Original Poster
Rep: Reputation: 0
@jamesf
See my second post; I have posted the results of the "telinit 3" from root. Same thing occurs. "who -r" says that I have switched runlevels. Is it even possible to switch to runlevel 3 while keeping X running?
 
Old 01-06-2011, 02:23 PM   #10
alekow
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 138

Rep: Reputation: 21
Quote:
How do I log out of X server? ctrl+alt+backspace? For me that just restarts xdm and leaves me at XFCE's login. I tried this, followed by ctrl+alt+F6 and then telinit 3. Still didn't work.
I was thinking about logging of your user. Anyway - if it doesn't work, read the manual as ponce suggests - this may be helpful.
 
Old 01-06-2011, 02:24 PM   #11
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 56
Yes, I switch to runlevel 3 while X is running quite a bit. I start in runlevel 4, so I'll switch over to vt6, run slackpkg check-updates and if there are any then I telinit 3 and slackpkg update, install-new, upgrade-all, whatever and then telinit 4 again when it is done.

I'm puzzled. I'm re-reading the thread. ;v)
 
Old 01-06-2011, 02:27 PM   #12
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 56
Quote:
Originally Posted by autogeek View Post
@jamesf
See my second post; I have posted the results of the "telinit 3" from root. Same thing occurs. "who -r" says that I have switched runlevels. Is it even possible to switch to runlevel 3 while keeping X running?
You posted the result of "init 3", not "telinit 3", or am I mis-reading?

Edit: further, I didn't see any "ps -ef | grep X" commands to show whether or not X was running. Or, am I missing the point?

Last edited by jamesf; 01-06-2011 at 02:28 PM.
 
Old 01-06-2011, 02:43 PM   #13
autogeek
LQ Newbie
 
Registered: Jan 2011
Location: Gothenburg
Distribution: Arch x86_64
Posts: 11

Original Poster
Rep: Reputation: 0
@jamesf
There was one line in between where I had used "telinit". I have posted results of telinit and grep X below:
Code:
root@arikere:~>who -r
         run-level 5  Jan  6 21:37                   last=3
root@arikere:~>ps -e| grep X
 2781 tty8     00:08:27 X
root@arikere:~>telinit 3
root@arikere:~>who -r
         run-level 3  Jan  6 21:38                   last=5
root@arikere:~>ps -e| grep X
 2781 tty8     00:08:27 X
root@arikere:~>
@alekow, ponce:
I'm going through the man page, but as you said, its pretty big. It'll be a while before I'm through with it.
 
Old 01-06-2011, 02:59 PM   #14
jamesf
Member
 
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Blog Entries: 1

Rep: Reputation: 56
Weird. What does your /etc/inittab look like?

edit: I'm on my windows box. But, shouldn't that tty8 be tty7?
In other words, did init start your X session or did something else? If init _didn't_ start your X session then telinit 3 might not stop it.

Last edited by jamesf; 01-06-2011 at 03:01 PM. Reason: tty7 question
 
Old 01-06-2011, 03:10 PM   #15
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 229Reputation: 229Reputation: 229
Am I reading this wrong or are you expecting runlevel 5 to be differenet than runlevel 3?

X is started on runlevel 4 not 5

From /etc/inittab

Code:
# These are the default runlevels in Slackware:
#   0 = halt
#   1 = single user mode
#   2 = unused (but configured the same as runlevel 3)
#   3 = multiuser mode (default Slackware runlevel)
#   4 = X11 with KDM/GDM/XDM (session managers)
#   5 = unused (but configured the same as runlevel 3)
#   6 = reboot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Getting a text console runlevel in Kubuntu 10.04 (Changing runlevel won't work) gregorian Linux - Newbie 4 09-05-2010 10:50 AM
why runlevel switch message is not logged into /var/log/messages in RHEL5? mnatchad Red Hat 1 05-14-2008 07:11 PM
How do I switch which desktop runlevel 5 uses by default? gsgleason Fedora 7 01-19-2007 12:15 AM
Soun Mixer absent in Runlevel 3 but present in Runlevel 5 debloxie SUSE / openSUSE 1 01-18-2006 09:15 AM
can't switch to runlevel 3 wfischer Linux - Newbie 6 11-13-2004 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration