Ticket #48 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

/usr/bin/guake is selectable as "default interpreter". Doesn't work....

Reported by: selinux Owned by: somebody
Priority: minor Milestone:
Component: guake Version:
Keywords: Cc:

Description

Should /usr/bin/guake be one of the allowed "interpreters" that you can select from Preferences->General->Default Interpreter?

It doesn't seem to do anything useful.

This is a copy of a Fedora BZ filed here:  https://bugzilla.redhat.com/show_bug.cgi?id=455140

Change History

  Changed 5 years ago by lincoln

Weird, it doesn't happen with me. That combo just list the contents of /etc/shells file, can you send us that file to make sure it's ok?

  Changed 5 years ago by selinux

Sure. Here it is:

[root@localhost ~]# cat /etc/shells /bin/sh /bin/bash /sbin/nologin /bin/tcsh /bin/csh /bin/ksh [root@localhost ~]#

  Changed 5 years ago by selinux

Sorry.... Try this formatting:

[root@localhost ~]# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/ksh
[root@localhost ~]# 

  Changed 5 years ago by lincoln

The part of code that handles the shells file is so simple and I didn't find any error there.

Does fedora packager apply any patch in guake?

This is the code that populates the combo:

    def populate_shell_combo(self):
        cb = self.get_widget('shells-combobox')
        if os.path.exists(SHELLS_FILE):
            lines = open(SHELLS_FILE).readlines()
            for i in lines:
                possible = i.strip()
                if possible and not possible.startswith('#') and \
                   os.path.exists(possible):
                    cb.append_text(possible)
        cb.append_text(sys.executable)

  Changed 5 years ago by selinux

I'm not sure what the last 'cb.append_text(sys.executable)' does?

  Changed 5 years ago by lincoln

Hmm,

I'm starting to guess what is happening. sys.executable brings pathname of the Python interpreter, but in the guake executable (a bash script) we change the executable name from python to guake to help users identify guake in some tools like ps.

In Debian system it seems to be ok, but maybe Fedora and in any other OS it may have a different behavior.

Can you test again but without calling the guake bash script? By running the following command:

$ python guake.py

The guake.py file should be installed in /usr/lib/guake directory (I'm not sure on Fedora =)

I'll install Fedora here to make it easy to debug.

Thanks for helping!

  Changed 5 years ago by selinux

If I run via: "cd /usr/lib/guake; python guake.py", then instead of /usr/bin/guake in the list, I get /usr/bin/python.

  Changed 5 years ago by lincoln

As I suspected, so now we know the root of the problem. The line that changes the name of guake's process is the following:

exec -a guake $PYTHON -OO $GUAKEPATH/guake.py $@

$PYTHON evalutes to "/usr/bin/python" and $GUAKEPATH to @LIBDIR@/guake. Can you see any error when running that line in Fedora?

follow-up: ↓ 11   Changed 5 years ago by selinux

I did this:

[tbl@localhost guake]$ sh -x guake
+ GUAKEPATH=/usr/lib/guake
+ PYTHONPATH=:/usr/lib/guake
+ PYTHON=/usr/bin/python
+ exec -a guake /usr/bin/python -OO /usr/lib/guake/guake.py

guake starts up OK. I get a notification popup saying "guake is already running, press F12 to ...".

That what you want me to do?

  Changed 5 years ago by selinux

More info:

running 'ps agx' says:

<<<<SNIP>>>>>
 3750 pts/1    S      0:46 compiz --replace --sm-disable --ignore-desktop-hints
 3763 ?        Ss     1:27 gtk-window-decorator --replace
 3804 ?        S      0:00 /bin/sh /usr/lib/firefox-3.0/run-mozilla.sh /usr/lib/
 3822 ?        Sl     7:37 /usr/lib/firefox-3.0/firefox
 5665 pts/1    Sl+    0:00 guake -OO /usr/lib/guake/guake.py
 5666 pts/1    S+     0:00 gnome-pty-helper
 5667 pts/2    Ss+    0:00 /bin/bash
 5811 pts/0    R+     0:00 ps agx
[root@localhost ~]# 

in reply to: ↑ 9   Changed 5 years ago by lincoln

Replying to selinux:

I did this: [tbl@localhost guake]$ sh -x guake + GUAKEPATH=/usr/lib/guake + PYTHONPATH=:/usr/lib/guake + PYTHON=/usr/bin/python + exec -a guake /usr/bin/python -OO /usr/lib/guake/guake.py guake starts up OK. I get a notification popup saying "guake is already running, press F12 to ...".

It happened because guake was intented to open only one instance, it's controlled by a dbus service. To make this test, you'll need to close the already running guake instance.

That what you want me to do?

Actually you did every thing I need to discover the bug, so now is time to code =)

If you find some other way to change the process name without using exec, you're welcome to post here. (actually I know another way, but I don't like the idea of using dl module =)

  Changed 5 years ago by lincoln

  • status changed from new to closed
  • resolution set to fixed

I fixed this bug in the last commit, now instead of using sys.executable, I looked into the whole PATH for python interpreters.

Thanks for finding this bug and helping we add a new feature =)

Note: See TracTickets for help on using tickets.