Pb for loading /etc/oblogout.conf

Bug #628096 reported by drfazor
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OBLogout
New
Undecided
Unassigned

Bug Description

My config:
Gentoo Linux
Python 2.6.5 (release26-maint, Aug 24 2010, 17:47:38)

Version of oblogout: 0.2

No problem found with the Installation.

=======================================

Oblogout running well, but when I click on icon, nothing appends

I've tried to launch it in a terminal :

click on reboot:
sh : reboot: command not found

click on halt:
sh: shutdown : command not found

click on lock:
sh: gnome-screensaver-command : command not found

It seems that the conf file is not readed, because I've changed those values.

=================================================
My /etc/oblogout.conf file:

[settings]
usehal = false

[looks]
opacity = 70
bgcolor = black
buttontheme = foom
buttons = cancel, logout, restart, shutdown, suspend, lock

[shortcuts]
cancel = Escape
shutdown = S
restart = R
suspend = U
logout = L
lock = K
hibernate = H

[commands]
shutdown = /sbin/halt
restart = /sbin/reboot
suspend = pmi action suspend
hibernate = pmi action hibernate
safesuspend = safesuspend
lock = xlock -mode blank
switchuser = gdm-control --switch-user
logout = openbox --exit

=======================================
info: my halt is suid'ed.

Thank you ;)

Revision history for this message
drfazor (drfazor2) wrote :

Hi everybody,

First of all, English is not my native language, and I'm not a python developper.

But in my investigation for resolve my bug, I think I've found something interresting ...
In the script __init__.py:

221 # Parse in commands section of the configuration file. Check for valid keys and set the attribs on self
222 if self.parser.has_section("commands"):
223 for key in self.parser.items("commands"):
224 self.logger.debug("Setting cmd_%s as %s" % (key[0], key[1]))
225 if key[1] in ['logout', 'restart', 'shutdown', 'suspend', 'hibernate', 'safesuspend', 'lock', 'switch']:
226 if key[1]: setattr(self, "cmd_" + key[0], key[1])

in line 225, 'if key[1] ...' browse the Rvalue of the commands section with value of the Lvalue ...
So it didn't work, and the attribs are not set to the /etc/oblogout.conf value instead of default value attributed lines [57..64]
It' will certainly work better if you change this line to:

225 if key[0] in ['logout', 'restart', 'shutdown', 'suspend', 'hibernate', 'safesuspend', 'lock', 'switch']:

I'm not python developper, and I don't know how it works, and how and where I can resolve this bug, so please, can you do it for me?

With all my gratitude

drfazor

Revision history for this message
CarlosJC (cervus) wrote :

Yes, I saw the date. However, I recently compiled oblogout on Debian SID and found the same strange bug.

My setup:
---------------------
Debian SID
Openbox 3.5.0
Python 2.7.3rc2

My oblogout.conf (relevant section only):
----------------------------------------------
[settings]
usehal = true

[commands]
shutdown = sudo shutdown -h now
restart = sudo shutdown -r now
suspend = sudo pm-suspend
hibernate = sudo pm-hibernate
safesuspend = sudo pm-suspend-hybrid
lock = xscreensaver-command -lock
switchuser = dm-tool switch-to-greeter
logout = openbox --exit

The issue:
-----------
When I click on, for example "Lock", I get the message "sh: 1: gnome-screensaver-command: not found". However, it should execute "xscreensaver -lock".

Therefore, oblogout is loading the default configuration and not loading the file in /etc/oblogout.conf

Thanks.

Revision history for this message
CarlosJC (cervus) wrote :

An obvious momentary workaround until this is fixed, is to modify the source code, in:

oblogout/__init__.py

Between lines 56-65, I changed the values of the variables "cmd_shutdown", "cmd_restart", "cmd_lock", etc and then installed. In this way works fine for me.

Thanks.

Revision history for this message
andres999 (handres999) wrote :

Hey.

 I do not speak English but I'll try. How was that solved the problem? because I have the same problem.

 regards

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.