Bug 499442

Summary: Kdesktop_lock does not work on multiuser systems and for single user with multiple login
Product: Red Hat Enterprise Linux 5 Reporter: Aron Parsons <aron.parsons>
Component: kdebaseAssignee: Lukáš Tinkl <ltinkl>
Status: CLOSED ERRATA QA Contact: desktop-bugs <desktop-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 5.3CC: brsmith, fnadge, james.brown, jgrulich, jreznik, jwest, jwilleford, llim, ltinkl, pknirsch, rkhadgar, sh, tao, than, xwang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kdebase-3.5.4-22.el5 Doc Type: Bug Fix
Doc Text:
Previously, the 'kdesktop_lock' process did not run on multi-user systems when another user had already ran an instance of 'kdesktop_lock'. This update allows 'kdesktop_lock' to work on multi-user systems when multiple single users are logged in.
Story Points: ---
Clone Of: 493268 Environment:
Last Closed: 2010-10-27 16:50:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 499522    
Attachments:
Description Flags
patch none

Description Aron Parsons 2009-05-06 17:00:11 UTC
Description of problem:
kdesktop_lock does not run on multi-user systems when another user already has an instance of kdesktop_lock running.  

Version-Release number of selected component (if applicable):
RHEL 5.3

How reproducible:
Always

Steps to Reproduce:
Start a KDE session and lock the desktop.  Start another KDE session and select "Lock session" in the menu or run /usr/bin/kdesktop_lock.

Actual results:
kdesktop_lock does not start

Expected results:
Desktop should lock

Additional info:
This is probably related to the following changelog entry in kdebase:
- Resolves: #251968, kdesktop_lock issue

How to fix it:
sed -i 's|ps ax|ps x|' /usr/bin/kdesktop_lock

Comment 1 Issue Tracker 2009-08-04 14:58:14 UTC
Event posted on 04-08-2009 08:28pm IST by rkhadgar

my fix for kdesktop_lock

$ cat /usr/bin/kdesktop_lock

#!/bin/sh
function check_run
{
        echo "display check for " $LIST | logger -t "kdesktop_lock"
        PLIST=
        for P in $LIST; do
                D=`grep -z DISPLAY /proc/$P/environ|cut -f2 -d:|cut -f1
-d.`
                RD=`echo $DISPLAY|cut -f2 -d:|cut -f1 -d.`
                echo $@ $f $D $RD 
                test $D -eq $RD && PLIST="$PLIST $P" && $1
        done

        echo "killing $PLIST "| logger -t "kdesktop_lock"
        test -z $PLIST || kill -KILL $PLIST
}

#!/bin/sh
LIST=`ps ax --format "%p:%a" | grep "$0.bin" | grep -v grep | cut -d :
-f 1 | tail -n +1`
echo $LIST | logger -t "kdesktop_lock"

# check if kdesktop is already running on this display, if yes, exit
echo $LIST 
check_run exit

# run lock
$0.bin "$@"

# kill the kdesktop_lock process running on our display only
LIST=`ps ax --format "%p:%a" | grep "$0" | grep -v grep | cut -d : -f
1 | tail -n +1`
check_run continue




This event sent from IssueTracker by rkhadgar 
 issue 323523

Comment 2 ritz 2009-08-06 16:36:21 UTC
*** Bug 498990 has been marked as a duplicate of this bug. ***

Comment 3 ritz 2009-08-06 16:37:49 UTC
added note:

  the above fix will allow kdesktop_lock to work on multiuser systems, and with single user having multiple login.

Comment 6 ritz 2009-09-07 16:05:01 UTC
Created attachment 360004 [details]
patch

re-write of kdesktop_lock.wrapper to allow for a single user to run multiple desktop, and kdesktop_lock on each open display.

Comment 21 Florian Nadge 2010-10-12 13:13:23 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, the 'kdesktop_lock' process did not run on multi-user systems when another user had already ran an instance of 'kdesktop_lock'. This update allows 'kdesktop_lock' to work on multi-user systems when multiple single users are logged in.

Comment 23 errata-xmlrpc 2010-10-27 16:50:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0806.html