Find the answer to your Linux question:
Results 1 to 2 of 2
Not getting anything in the RHEL forums, so I figured I would try in here. Here's the issue. I need to create a login agreement where the user must accept ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    12

    Angry RHEL 6 - GDM login, zenity windows, and script to log out user


    Not getting anything in the RHEL forums, so I figured I would try in here.

    Here's the issue. I need to create a login agreement where the user must accept in order to log in to the system. If they select cancel to the agreement, they need to be immediately logged off. I am using a zenity question window for this purpose. I have the zenity window info in the /etc/gdm/PostLogin/Default file, which also creates a file in temp if they select cancel. In the /etc/gdm/PreSession/Default file, I have an if statement that looks for that file in temp, and if it sees it, issues a command to log the user account off immediately. Problem is, the command to kill the login session will not work. I have tried kill -9 with variables to get the PID and stop it. I have tried executing an exit 1 and an exit 9, as well as a return 0. I have also tried a pkill -u $LOGNAME. Nothing works. However, I can run other commands without issue. Things like reboot, touch, echo > filename all work. It's like the user session isn't started yet. Here's what I have in the files:

    ----------------------------------------------------
    /etc/gdm/PostLogin/Default

    # Show User Agreement notification box with Cancel or Accept buttons.
    zenity --question --title=ATTENTION --text="This will be the text area for the User Agreement.\n\nSelect Cancel to Logoff. Select Accept if you accept the agreement."

    if ( test 1 -eq $? ); then

    touch /tmp/logon.cancel

    fi


    /etc/gdm/PreSession/Default

    if [ -e "/tmp/logon.cancel" ]; then

    rm -rf "/tmp/logon.cancel"

    exit 1

    fi

    ----------------------------------------------------

    Anyone have any ideas on why this won't work? Everthing I can find is older than RHEL6, and doesn't work. Any help is MUCH appreciated.

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Hello

    Sorry, but duplicate threads are not allowed on the forums:

    http://www.linuxforums.org/forum/lin...ums-rules.html

    Please feel free to continue any discussion on this topic in your other thread.

    There is no problem with bumping your original thread each day or so if needed, or if you need to add additional details.

    Locking duplicate thread...
    oz

Posting Permissions

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