Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-03-2005, 01:29 PM   #1
LQ Newbie
Registered: Dec 2004
Posts: 18

Rep: Reputation: 0
Open a bash-shell with kde!

Hello to everybody!
I have Mandrake 10.1 for more than a year and am very happy with them! I would like to make a few changes:
1. When I start the computer no to enter the x-windows, or how else they are called. I want this to be done only after giving startx.
2. When I open KDE I wish that a bash-shell opens immediately, because now I have to open it every time myself(I use the shell almost always- even if I can do something from the window-based applications, I prefer to try it first by command line- to learn something).

Now the question: How do I do these changes? Which files do I have to change, what changes should I do to them, and finally where do I find them.

Old 11-03-2005, 02:12 PM   #2
Randall Slack
Registered: Feb 2005
Location: Rotterdam, The Netherlands
Distribution: Debian - Ubuntu
Posts: 219

Rep: Reputation: 30
don't know if it works like this in mandriva, but in slackware you need to change the default run-level in a file called "/etc/inittab"

in slack the default run level is 3 which boots to the command line, when you simply change this in an editor to 4 it will boot to X.
so the other way around as mandriva, but it should work nevertheless. CHECK if a desription is given about what each runlevel does, it might differ from what i have.

Last edited by Randall Slack; 11-03-2005 at 02:21 PM.
Old 11-03-2005, 02:27 PM   #3
LQ Newbie
Registered: Dec 2004
Posts: 18

Original Poster
Rep: Reputation: 0
# Default runlevel. The runlevels used by Mandrakelinux are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)

The beggining of the file looks like this! I shuld use 1 or 3? Or maybe something else?

Where should I change the number?

# System initialization.

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# When our UPS tells us power has failed, assume we have a few minutes
# of power left. Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf:owerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345owerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"

# Run gettys in standard runlevels
1:2345:respawn:/sbin/mingetty 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

Last edited by plutonas; 11-03-2005 at 02:28 PM.
Old 11-03-2005, 02:48 PM   #4
Randall Slack
Registered: Feb 2005
Location: Rotterdam, The Netherlands
Distribution: Debian - Ubuntu
Posts: 219

Rep: Reputation: 30
that is exactly the file you need.

0 ; will shut down the system SO DON"T USE THIS
1 : is for system administration, this will close almost all things running except the most essential and i root only SO DON"T USE THIS
2: would be safe, but guess you will like your networking options
3: IS WHAT YOU WANT, this will boot the shell and give you a full working environment. you can always go bach to your desktop with simply typing "startx"
4: simply not used
5: is what you have right now and is the same as runlevel 3 but then it boots to your desktop
6: do i need to explain?

so change "id:5:initdefault:" into "id:3:initdefault:" and enjoy
Old 11-03-2005, 03:20 PM   #5
LQ Newbie
Registered: Dec 2004
Posts: 18

Original Poster
Rep: Reputation: 0
It's just what I wanted, I just have a little PROBLEM!
When I want to shutdown in X mode the logout button just gives: end session-YES_NO? and then with yes it gets me to the command line.
But to shutdown the computer I have then to log in as a root because the shutdown is only available as a root.
Old 11-03-2005, 03:46 PM   #6
Randall Slack
Registered: Feb 2005
Location: Rotterdam, The Netherlands
Distribution: Debian - Ubuntu
Posts: 219

Rep: Reputation: 30
that is normal behaviour as the default should be.
meaning that X is simply a program running on the shell, when you close the app. X you return to the shell.
also by default in a unix environment a normal user is not allowed to shutdown the computer.

but i understand that you would like to perform the "shutdown -h now" as a user.
what you need to do is give all users or only the user plutonas permission to shutdown, this can be done in the file "/etc/sudoers" its been a while since i did this but you need add or uncomment something in the like this
%users localhost=/sbin/shutdown -h now

you might give this a try
Old 11-03-2005, 03:59 PM   #7
LQ Newbie
Registered: Dec 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks, I like finding out about those files that manage the behaivour of the computer. BUT, here what I have done (uncommented):

# sudoers file.
# This file MUST be edited with the 'visudo' command as root.
# See the sudoers man page for the details on how to write a sudoers file.

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults specification

# Runas alias specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

# Same thing without a password

# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
%users localhost=/sbin/shutdown -h now

It still doesn't work. Why maybe it will work after I restart?
If it works is there somewhere something like alias but for all users so that they can write turnoff or something except shutdown -h now????

Last edited by plutonas; 11-03-2005 at 04:01 PM.
Old 11-03-2005, 04:18 PM   #8
Registered: Feb 2005
Location: Belgium
Distribution: Ubuntu 10.04
Posts: 120

Rep: Reputation: 15
Normally you can do all this stuff through the KDE Configuration screen.

Command-shell: You can make it appear every time you start a session by opening it, then make KDE save that session and reload it each time you login to KDE.

Logout-thing-with-root: That can also be done with the KDE Configuration screen. At the bottom you can find a section called "Boot Loader" or something like that. There you can choose who is allowed to shutdown the computer.
Old 11-03-2005, 04:22 PM   #9
Randall Slack
Registered: Feb 2005
Location: Rotterdam, The Netherlands
Distribution: Debian - Ubuntu
Posts: 219

Rep: Reputation: 30
no a restart will not be needed!!!!
and yes you can change the commands, for example you can set it up so that you can type "good night" instead of "/sbin/shutdown -h now" to shutdown the computer.

i'm sorry, but i can't help you much further at this moment (time to go to bed) but you're in the right direction.

in case you would like to figure it out by yourself you can always RTFM!!! (read the fucking manual) no offense, its just a typical bsd and linux expression!

don't know if you're aware of the linux man pages, but there you can find pretty much everything what you will ever want to need on your linux box, you don't need to memorize them, but least now where you can find things

how to read the man pages? i think you can get there from KDE when you click the help icon.
but much cooler would be to do it from the command line.
from the shell type "man 8 sudo" and "man 5 sudoers" this will give you all the gory details!

p.s. when you open a man page on the command line typing "q" will let you go back to the shell (this had me stuck for a long time in the past)

good luck!!!

Last edited by Randall Slack; 11-03-2005 at 04:24 PM.
Old 11-03-2005, 04:38 PM   #10
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Um, as to your other question: To automatically start a console window when KDE starts, create a <name>.desktop for your shell command and put it in ~/.kde/Autostart/ with any other processes you want KDE to automatically start.

Oh, to create the .desktop file, the easiest thing to do is to make a desktop icon for the command (i.e., right-click, Create New -> Link to Application on the KDE desktop) and then use konqueror to move it from "Desktop" to .kde/Autostart.
Old 11-04-2005, 11:13 AM   #11
LQ Newbie
Registered: Dec 2004
Posts: 18

Original Poster
Rep: Reputation: 0
thanks a lot! As the thing is not urgent, I experimented a bit it didn't work and I let it as it was! But I will try again soon if I find the time. Thank you again!


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
Cannot run the KDE GUI from the BASH shell onaeem Mandriva 5 07-05-2004 07:51 AM
hotkey to open new shell tab in KDE? Yohhan Linux - Software 2 05-01-2004 03:45 PM
bash shell dawood shaheen Programming 9 08-01-2003 06:07 AM
Bash Shell triplem Linux - Software 4 04-17-2003 06:11 PM
cannot get to gnome or kde *bash shell is gone Nasser Linux - Newbie 5 02-11-2003 08:48 AM

All times are GMT -5. The time now is 04:39 PM.

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