LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Errors with fwfstab (Python) (https://www.linuxquestions.org/questions/linux-software-2/errors-with-fwfstab-python-757344/)

AGazzaz 09-23-2009 04:19 PM

Errors with fwfstab (Python)
 
Hello,
I am trying to run a software called fwfstab and it is an editor of the /etc/fstab file

i get this error when running it:
Code:

# fwfstab
No protocol specified
/var/lib/python-support/python2.6/gtk-2.0/gtk/__init__.py:72: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
Traceback (most recent call last):
  File "fwfstab-runapp.py", line 28, in <module>
    import fwfstab
ImportError: No module named fwfstab

How can I solve this problem?

PS: I edited the fwfstab launching file in /usr/local/sbin because it was pointing to a wrong path.

GrapefruiTgirl 09-23-2009 04:24 PM

Please forgive me for asking, but why on earth does one need a GUI tool to edit an fstab file?

I'm very curious :)

BTW - it kinda looks like the $DISPLAY is not set, and things go downhill from there.

Sasha

AGazzaz 09-23-2009 05:03 PM

Quote:

Originally Posted by GrapefruiTgirl (Post 3694755)
Please forgive me for asking, but why on earth does one need a GUI tool to edit an fstab file?

I'm very curious :)

I started looking after this thread

beside if you search for all of my topics in this forum you will find that I ask a question about fstab with every distro I install and every time it is a different problem with a different way to solve it

the bottom line is: If there is one thing I really hate about linux is the fstab file, and I was very happy to find a GUI tool to solve this problem for me.

Quote:

BTW - it kinda looks like the $DISPLAY is not set, and things go downhill from there.

Sasha
Thank you, but, What is $DISPLAY? and how can I solve this problem?

GrapefruiTgirl 09-23-2009 05:46 PM

Quote:

Originally Posted by AGazzaz (Post 3694798)
If there is one thing I really hate about linux is the fstab file, and I was very happy to find a GUI tool to solve this problem for me.

Thank you, but, What is $DISPLAY? and how can I solve this problem?

OK, thanks for that explanation :)

It was more a guess on my part about the $DISPLAY variable, based on my experience trying to start or run applications for which I want/need root priveleges. It also may be another environment variable *related* to the display, preventing the application from making a connection with the X server.

As you see below is an example of what I get if I try to start konqueror as root, from the wrong environment:
Quote:

bash-4.0# konqueror
No protocol specified
konqueror: cannot connect to X server :0.0
bash-4.0#
As the error message is similar (in bold there) it makes me suspect an environment variable.

The $DISPLAY variable itself, is the :0.0 and this describes the screen you are looking at. It means "device zero, screen zero" (or vice versa).

I suspect you have one of the `su` tools, like kdesu, or gtksu, or one of those, on your system. Perhaps trying to execute the fwfstab via one of those means, will set the proper variable? Something like:

shell$ gtksu /path/to/fwfstab

and see if that works?

I do not know exactly which "protocol" is used between applications and X itself, but if I can figure out exactly what's missing, I'll be sure to update here.


Sasha

GrapefruiTgirl 09-23-2009 06:06 PM

Try this:

user$ su - #don't forget that dash at the end
Password: ********

root# DISPLAY=:0.0
root# xhost +
access control disabled, clients can connect from any host
root# ./path/to/fwfstab

.. and it may now start.

NOTE: There are possibly security implications of using `xhost` like this; please research `xhost` before assuming that this is entirely safe!!

When you're done, you can do:

root# xhost -

..to restore access control.

Sasha

AGazzaz 09-23-2009 06:17 PM

Thank you for your help Sasha,

I found I have kdesudo not kdesu and here is the output:

Code:

$ kdesudo /usr/local/share/fwfstab/fwfstab-runapp.py
Traceback (most recent call last):
  File "/usr/local/share/fwfstab/fwfstab-runapp.py", line 28, in <module>
    import fwfstab
ImportError: No module named fwfstab

and when I tried the set of commands you gave me I got this output:
Code:

ahmad@ahmad-laptop:~$ su -
Password:
root@ahmad-laptop:~# DISPLAY=:0.0
root@ahmad-laptop:~# xhost +
xhost:  unable to open display ""

Judging from how things are going I thing you should know that I am using xfce on Kubuntu, I found KDE 4.x is unusable for the time being so I installed xfce in currently using it.

GrapefruiTgirl 09-23-2009 06:45 PM

Quote:

Originally Posted by AGazzaz (Post 3694847)
Thank you for your help Sasha,

No problem -- I only hope that the help actually helps in the end ;)

Quote:

I found I have kdesudo not kdesu and here is the output:

Code:

$ kdesudo /usr/local/share/fwfstab/fwfstab-runapp.py
Traceback (most recent call last):
  File "/usr/local/share/fwfstab/fwfstab-runapp.py", line 28, in <module>
    import fwfstab
ImportError: No module named fwfstab


OK, with or without the proper root privelege and/or environment variables, the above does look like a missing piece of your program, UNLESS that's happening because without root privelege, the program cannot read/access that module thing.
Quote:

and when I tried the set of commands you gave me I got this output:
Code:

ahmad@ahmad-laptop:~$ su -
Password:
root@ahmad-laptop:~# DISPLAY=:0.0
root@ahmad-laptop:~# xhost +
xhost:  unable to open display ""


Ok, the above I find weird; it worked perfectly on my system :scratch: because we set DISPLAY before running the `xhost` command. Maybe it would help if you EXPORT the display variable, like so:

shell# export DISPLAY=:0.0

.. and maybe not, but worth a try.
Quote:

Judging from how things are going I thing you should know that I am using xfce on Kubuntu, I found KDE 4.x is unusable for the time being so I installed xfce in currently using it.
Ok, thanks for clearing that up! I am in the same boat; I use Slackware, with KDE installed, but I am using Xfce desktop too. I still use some KDE apps, including `kdesu` to start things as root.

I will go over the sequence of the commands above again on my system, to make sure I gave you them in the right order, and update again shortly :)

Sasha

GrapefruiTgirl 09-23-2009 06:55 PM

My mistake -- I'm sorry, I gave the commands in the wrong order.

Here goes:

user$ xhost +
user$ su -
Password ********

root# DISPLAY=:0.0
root# ./path/to/fwfstab

..should go now ;)

Here's the exact quote from my console (note I'm testing with konqueror as the fwfstab program):

Code:

bash-4.0$ xhost +
access control disabled, clients can connect from any host
bash-4.0$ su -
Password: *************

The past always looks better than it was.
It's only pleasant because it isn't here.
                -- Finley Peter Dunne (Mr. Dooley)

root@reactor:~# DISPLAY=:0.0
root@reactor:~# konqueror

Sasha

AGazzaz 09-24-2009 04:43 AM

Unfortunately it did not work.
When I woke this morning I decided to end this situation, so I searched for another tool and I found one called:pysdm I configured fstab and also it did not work as there was problems with the links from my C:\ drive to /home/ahmad/.opera

so I removed the lines that the tool added and I guess I will keep writing my password 2 times every time I boot my computer
Quote:

No problem -- I only hope that the help actually helps in the end
Thank you very much for your help Sasha, and do not be disappointed it really did help me stop wasting my time, and I made a decision to change this distro to something more fun :)


All times are GMT -5. The time now is 04:58 AM.