LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Open a bash-shell with kde! (https://www.linuxquestions.org/questions/linux-newbie-8/open-a-bash-shell-with-kde-379638/)

plutonas 11-03-2005 12:29 PM

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.

Thanks
AA

Randall Slack 11-03-2005 01:12 PM

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.

plutonas 11-03-2005 01:27 PM

# 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?
#
id:5:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

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

# Trap CTRL-ALT-DELETE
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::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"

# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/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


Randall Slack 11-03-2005 01:48 PM

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

plutonas 11-03-2005 02:20 PM

OK!
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.

Randall Slack 11-03-2005 02:46 PM

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

plutonas 11-03-2005 02:59 PM

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
# %wheel ALL=(ALL) NOPASSWD: ALL

# 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????

Carroarmato0 11-03-2005 03:18 PM

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.

Randall Slack 11-03-2005 03:22 PM

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!!!

PTrenholme 11-03-2005 03:38 PM

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.

plutonas 11-04-2005 10:13 AM

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!


All times are GMT -5. The time now is 07:58 PM.