Shutter signals in Multi User Env

Bug #453210 reported by Rui Lapa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Shutter
Fix Released
Low
Mario Kemper (Romario)

Bug Description

When running in a multi-user environment, shutter doesn't work correctly.

This is due to lines 6037-6080 "pidof" returning pids of all the other users processes and "probably" signalling the other user process and dying before actually reaching the respective user shutter process.

These are the probable solutions, with a little comment:

1 - signaling all processes and "die"ing after the "foreach" cycle
     Fast patch!
     Doesn't avoid multiple shutter processes signalling, causing multiple "shots".

2 - replacing "pidof ..." with "pgrep -d ' ' -u $< -f /usr/bin/shutter" and maintaing the rest of the code
    Limits to user shutter processes, but allows multiple shutter processes, only signalling one!
    Depends on "procps" package, not a problem!

3 - directly calling "pkill -SIGNAL -u $< -f /usr/bin/shutter"
    Fast patch!
    Signals all users shutters process... causing multiple "shots".
    Depends on "procps" package, not a problem!

4 - creating a pid file in .shutter dir
     Requires checking for "stalled" pid file on start, caused by "FS failures"
     Avoids multiple shutter instances

In my opinion I prefer solution 2 for the short time solution, but I think that number 4 would be the "preferred" method.

There maybe other solutions like using Unix::PID, File::PID, ...

Revision history for this message
Rui Lapa (rui-lapa) wrote :

A little more explanation:

 I'm not running any shutter process.
 I'm calling it via gnome gconf "shortcuts" with "shutter --window" and "shutter --full", like so:

gconftool-2 --direct --set /apps/metacity/keybinding_commands/command_window_screenshot '/usr/bin/shutter --window'
gconftool-2 --direct --set /apps/metacity/keybinding_commands/command_screenshot '/usr/bin/shutter --full'

Changed in shutter:
status: New → In Progress
assignee: nobody → Mario Kemper (Romario) (mario-kemper)
importance: Undecided → Low
milestone: none → 0.85
Revision history for this message
Mario Kemper (Romario) (mario-kemper) wrote :

Thank you very much for your detailed explanations, Rui Lapa.

I've implemented solution 2 as you recommended. In the long run I am planning to substitute the current signal mechanism with a D-BUS solution, but this solution will do the job until I've time to start with that.

Regards
Mario

Changed in shutter:
status: In Progress → Fix Committed
Changed in shutter:
status: Fix Committed → Fix Released
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.