Author Topic: "kwrite /etc/fstab" fails  (Read 1833 times)

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: "kwrite /etc/fstab" fails
« Reply #15 on: April 26, 2010, 11:35:16 AM »
Quote from: mab33
Never heard of that!  With Mandriva I can simply do:

Bet you read somewhere that PCLinuxOS was based on Mandriva. Eh? Well that was years ago. PCLinuxOS is built from PCLinuxOS RPMs from the PCLinuxOS repositories. You'll find that there are many differences between the 2 systems. If you expect PCLinuxOS to be exactly like Mandriva, you're going to be disappointed.

The command posted by Texstar, dbus-launch kwrite is the correct command for PCLinuxOS systems and must be used as root.

Quote
[neal@localhost ~]$ su
Password:
[root@localhost neal]# dbus-launch kwrite

Works every time.


Offline mab33

  • Jr. Member
  • **
  • Posts: 29
Re: "kwrite /etc/fstab" fails
« Reply #16 on: April 26, 2010, 11:57:18 AM »
More options to edit /etc/fstab.

ALT-F2 runs Krunner and type kdesu kwrite /etc/fstab (works here).
Konsole (non-superuser mode): type kdesu kwrite /etc/fstab .

JohnW

I don't want to use kdesu because when starting with a new installation there are several root files I need to change, and I would prefer not to have to keep entering the root password with each 'kdesu'.

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3998
Re: "kwrite /etc/fstab" fails
« Reply #17 on: April 26, 2010, 12:00:31 PM »
Even if "kdesu kwrite /etc/fstab" works, the problem I would have (if kdesu is going to ask for the root password each time) is that - when starting with a new installation - there are a number of root files I need to modify.
 

Once you have kwrite open as root (however you got there) you can just go on opening new files with the open button. There's no need to close and re-launch the application. If it starts as root it continues as root until you're finished.

Hope that helps.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: "kwrite /etc/fstab" fails
« Reply #18 on: April 26, 2010, 12:02:14 PM »
mab33,
you were advised to use "dbus-launch kwrite" from the terminal logged in as root to start applications as root. This is how we start programs as root here. You have not said anything about this.

have you tried this? did it work? didnt it work? why you do not want to use this if it works?
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline doctore

  • Sr. Member
  • ****
  • Posts: 376
Re: "kwrite /etc/fstab" fails
« Reply #19 on: April 26, 2010, 12:03:50 PM »
dbus-launch kwrite yields this:

[root@localhost ~]# dbus-launch kwrite
No protocol specified
No protocol specified
kwrite: cannot connect to X server :0.0

type kdesu kwrite /etc/fstab yields this:
kdesu is hashed (/usr/lib/kde4/libexec/kdesu)
kwrite is hashed (/usr/bin/kwrite)
-bash: type: /etc/fstab: not found



« Last Edit: April 26, 2010, 12:06:31 PM by doctore »

Offline mab33

  • Jr. Member
  • **
  • Posts: 29
Re: "kwrite /etc/fstab" fails
« Reply #20 on: April 26, 2010, 12:06:29 PM »


The command in a root terminal is dbus-launch kwrite



I've just made an interesting discovery.
The problem I reported occurred when using a 'Terminal - Super User Mode' session, and "dbus-launch..." also fails there!

On the other hand, if I use a normal user Konsole session, I can 'su - root' then 'kwrite /etc/fstab' with no problem.

So all I have to do is stop using 'Terminal - Super User Mode' (an icon I found in PC/More Applications/Terminals)...

Many thanks for everyone's help in here. Much appreciated!

Offline mab33

  • Jr. Member
  • **
  • Posts: 29
Re: "kwrite /etc/fstab" fails
« Reply #21 on: April 26, 2010, 12:49:40 PM »
Never heard of that!  With Mandriva I can simply do:

   [mab@laptop ~]$ su - root
   Password:
   [root@laptop ~]# kwrite /etc/fstab


exactly this command sequence also works in PCLinuxOS, just did it myself.

And you should even be able to simplify it:

   $ su -
   $ Password:
   # kwrite /etc/fstab

worked a minute ago on my box. The hyphen seems to be necessary though in this incarnation of PCLinuxOS. (It makes the root shell a login shell.)


Yes, indeed - as I have just said further up!

The original problem occurred when using a 'Terminal - Super User Mode'  (in which 'dbus-launch kwrite' also fails, I find)) rather than a normal user Konsole session. (See PC/Other Appliactions/Terminals'.)  Looks like the former might be broken.
  With the latter - no problem with 'su - root', 'kwrite ...'.

So I am even more puzzled about the 'dbus-launch' approach mentioned by others.

Online pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2848
    • other projects...
Re: "kwrite /etc/fstab" fails
« Reply #22 on: April 26, 2010, 01:04:12 PM »


The command in a root terminal is dbus-launch kwrite




I've just made an interesting discovery.
The problem I reported occurred when using a 'Terminal - Super User Mode' session, and "dbus-launch..." also fails there!

On the other hand, if I use a normal user Konsole session, I can 'su - root' then 'kwrite /etc/fstab' with no problem.

So all I have to do is stop using 'Terminal - Super User Mode' (an icon I found in PC/More Applications/Terminals)...

Many thanks for everyone's help in here. Much appreciated!


some remarks:

a) user terminal: 'su - ' and then 'kwrite /etc/fstab' works fine. You do not need to specify 'su - root' because 'su - ' without a user name specified defaults to user "root". However, it is good practice to use the hyphen after 'su' in order to start the users login shell. Some more info on this can be googled or is found in wikipedia.

b) The 'Terminal - Super User Mode' provides a root terminal without the server access control program for X. The xhost program is used to add and delete host (computer) names or user names to the list of machines and users that are allowed to make connections to the X server. If X-server access is not granted then the new user can not start any GUI-application. Finally, enabling X-server access (allow: + or prohibit: - (default)) must of course be done by the session-owner of the current session, which when you are logged into you user-account, is you, the user. For example, if you are logged into your user-account, then open the 'Terminal - Super User Mode', provide your root-pwd, and then enter in this root-terminal "kwrite", it will not work. Next, open a normal konsole and enter "xhost +", then go back to your root-konsole and enter again "kwrite" (or "dbus-launch kwrite") which will now work because you have now given X-server access to the user "root" and hence root can start any GUI-application on your (the user's) X-server.
Ok, that was a bit long-winded but hopefully nevertheless helpful ;)
regards,
-p.


Online Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6384
  • I'm going South
Re: "kwrite /etc/fstab" fails
« Reply #23 on: April 26, 2010, 03:23:29 PM »
type kdesu kwrite /etc/fstab yields this:
kdesu is hashed (/usr/lib/kde4/libexec/kdesu)
kwrite is hashed (/usr/bin/kwrite)
-bash: type: /etc/fstab: not found

It would. JohnW meant that you should type, i.e. enter, "kdesu kwrite /etc/fstab", not that you should enter "type kdesu kwrite /etc/fstab". "type" is a bash command that you certainly wouldn't need to start kwrite as root.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline mab33

  • Jr. Member
  • **
  • Posts: 29
Re: "kwrite /etc/fstab" fails
« Reply #24 on: April 27, 2010, 12:17:20 PM »




b) The 'Terminal - Super User Mode' provides a root terminal without the server access control program for X.


[/quote]

I obviously misunderstood the purpose of that function, by just assuming it avoided the need to enter "su - " etc.

But what is its intended use?