Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all. Having a little issue with creating a login message banner in RHEL6 that uses two buttons. One for Accept which logs the user in. The second for Cancel ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    12

    Question RHEL6 Login banner with cancel button not working

    Hi all. Having a little issue with creating a login message banner in RHEL6 that uses two buttons. One for Accept which logs the user in. The second for Cancel which immediately logs the user out. I've modified the /etc/gdm/PostLogin/Default file to have the script, posted below, and it worked perfectly fine in RHEL5. But in 6, when you click Cancel, the user is still able to log in. It even states in the system logs that the user cancelled the login. Here's the script:

    /usr/bin/xmessage -center -buttons "Accept":2," Cancel ":3 -file /etc/issue1 -nearmouse
    egxit="$?"
    if [ $egxit != 2 ]
    then
    # Immediately force logout by killing 'X' session process
    kill -9 `env | grep SESSION_MANAGER | tr -s ' ' | cut -d'/' -f9`
    fi


    As you can see, I have the script using the 9th field of the user's env to get the PID, and using the kill command to end the process, which should be logging the user out right away if they click the Cancel button. This works in 5 without issue (though I used -f5 in RHEL5, had to move it to -f9 for RHEL6).

    Anyone have any ideas?
    Last edited by xion824; 01-25-2011 at 06:20 PM. Reason: Clarification on what happens in RHEL6

  2. #2
    Just Joined!
    Join Date
    Jan 2011
    Posts
    12
    /bump

    Can anyone help out on this one? Still not able to get this to work. I get the xmessage box to show up, and both buttons are clickable. Though selecting either Accept or Cancel both allows the account to login. I need Cancel to immediately log that user account back out.

    I know the kill command line works. If you run that one line manually, it logs the account out right away.

    I feel like I'm in a hole, with this issue up top yelling at me to put the lotion on my skin, or else I get the hose again!

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Posts
    12
    scrapped this plan

  4. #4
    Just Joined!
    Join Date
    Jan 2011
    Posts
    12
    How do I close a thread?

  5. #5
    Just Joined!
    Join Date
    Jan 2011
    Posts
    12
    /bump
    Anyone?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...