Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: how can i get a command to execute after X but before GDM?

  1. #11
    Join Date
    Nov 2006
    Beans
    184

    Re: how can i get a command to execute after X but before GDM?

    nope.

    removing sudo didn't work.

  2. #12
    Join Date
    Oct 2005
    Beans
    142
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: how can i get a command to execute after X but before GDM?

    When you run the command from the terminal, is there any additional output or input. Is it simply that command?

    The only other thing that I can think of is that the user that is running the command from GDM does not have sufficient privileges.

    I'm going to check what user it's running as and I'll post my results here.


    Xan
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  3. #13
    Join Date
    Oct 2005
    Beans
    142
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: how can i get a command to execute after X but before GDM?

    OK, just checked. It runs as root.

    All I did was put this:
    Code:
    whoami >> /home/user/xandrex
    it displayed root.

    I'll try to think about this a little more and see if I have any epiphanies.


    Xan
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  4. #14
    Join Date
    Nov 2006
    Beans
    184

    Re: how can i get a command to execute after X but before GDM?

    I currently don't have access to the machine (it was moved to its remote site), but i can tell you that when i ran the command with the -q (quiet) flag the only output was one line that looked a lot like this:

    PORT=5900

    -- i don't think that specific output would cause any problems... it would be the last command in the file before 'exit'.

    When my connection to the machine gets restored, i will VNC back into the machine (when i left it, the VNC server was running) and make sure that the login window properties are as they should be. I had to modify them temporarily to solve a different login issue, but i believe i restored them to defaults after the other issue had been fixed.



    -- thanks for sticking w/ me on this issue.

  5. #15
    Join Date
    Dec 2006
    Beans
    810

    Re: how can i get a command to execute after X but before GDM?

    Code:
    sudo /usr/bin/x11vnc -display :0 -bg -usepw -auth /var/lib/gdm/:0.Xauth -o /var/log/x11vnc.log -q   
    exit 0
    When running from /etc/gdm/Init/Default:

    You don't need the "sudo"

    You don't need "-display :0"

    You don't need "-auth /var/lib/gdm/:0.Xauth"

    You shouldn't use "-q" because you want info to be printed to the logfile /var/log/x11vnc.log.

    I suggest getting rid of them. See the link I posted for you a few days ago. It shows how to do it.

  6. #16
    Join Date
    Nov 2006
    Beans
    184

    Re: how can i get a command to execute after X but before GDM?

    Quote Originally Posted by krunge View Post
    When running from /etc/gdm/Init/Default:

    You don't need the "sudo"

    You don't need "-display :0"

    You don't need "-auth /var/lib/gdm/:0.Xauth"

    You shouldn't use "-q" because you want info to be printed to the logfile /var/log/x11vnc.log.

    I suggest getting rid of them. See the link I posted for you a few days ago. It shows how to do it.

    the link you posted specifically states that i DO need the -auth /var/lib... argument.

    as soon as the ISP providing service to the remote machine can get the connection restored, i will SSH in and try your recommendations out.

  7. #17
    Join Date
    Dec 2006
    Beans
    810

    Re: how can i get a command to execute after X but before GDM?

    Quote Originally Posted by Darth_tater View Post
    the link you posted specifically states that i DO need the -auth /var/lib... argument.
    No, I said use the section marked "Continously" in that FAQ (I think you are referring to the section marked "One time only").

    Also, I am pretty sure you will need to do the KillInitClients=false described in that FAQ (http://www.karlrunge.com/x11vnc/faq....isplay-manager)
    otherwise all xapps (x11vnc included) are killed right after you log in via GDM. Maybe you have done this already.

    This /etc/gdm/Init/Default method is really quite simple (except for the KillInitClients gotcha, but that is only for the GDM case). You just add one line to one file.

    I suggest you undo everything else you may have done (e.g. no PreSession, no sudo, no init.d, no inetd, etc.)
    Last edited by krunge; January 28th, 2009 at 01:54 AM.

  8. #18
    Join Date
    Nov 2006
    Beans
    184

    Re: how can i get a command to execute after X but before GDM?

    you right. my mistake. i didn't fully understand what the FAQ was saying.

    As soon as i get my connection restored, i will SSH and double check to make sure that i have reversed everything.

    -- thanks for all your help so far.

    edit: yes, i have modified the gdm.conf file to reflect this change: KillInitClients=false

  9. #19
    Join Date
    Dec 2006
    Beans
    810

    Re: how can i get a command to execute after X but before GDM?

    Quote Originally Posted by Darth_tater View Post
    you right. my mistake. i didn't fully understand what the FAQ was saying.

    As soon as i get my connection restored, i will SSH and double check to make sure that i have reversed everything.
    That sounds good. Let us know how it goes.

    BTW, I see in your config you use the x11vnc "-usepw" option. You better make sure the password file has already been created (I'm guessing since gdm runs as root the file will be /root/.vnc/passwd), otherwise your x11vnc will block prompting for the user to set an initial VNC passwd.

    I think it is safer to create the password file manually, e.g.
    Code:
    x11vnc -storepasswd /etc/x11vnc-pw
    (x11vnc will prompt for the password. The above would need to be done as root/sudo to write to /etc, otherwise use a different path).

    And then explicitly point to the file in your x11vnc line in gdm Default script:
    Code:
    /usr/bin/x11vnc -rfbauth /etc/x11vnc-pw -o /var/log/x11vnc.log -bg -rfbport 5900 -forever
    Then I think the above line in /etc/gdm/Init/Default will be all you need.
    Last edited by krunge; July 16th, 2008 at 02:54 PM. Reason: add full path

  10. #20
    Join Date
    Nov 2006
    Beans
    184

    Re: how can i get a command to execute after X but before GDM?

    Quote Originally Posted by krunge View Post
    That sounds good. Let us know how it goes.

    BTW, I see in your config you use the x11vnc "-usepw" option. You better make sure the password file has already been created (I'm guessing since gdm runs as root the file will be /root/.vnc/passwd), otherwise your x11vnc will block prompting for the user to set an initial VNC passwd.

    I think it is safer to create the password file manually, e.g.
    Code:
    x11vnc -storepasswd /etc/x11vnc-pw
    (x11vnc will prompt for the password. The above would need to be done as root/sudo to write to /etc, otherwise use a different path).

    And then explicitly point to the file in your x11vnc line in gdm Default:
    Code:
    /usr/bin/x11vnc -rfbauth /etc/x11vnc-pw -o /var/log/x11vnc.log -bg -rfbport 5900 -forever
    Then I think the above line in gdm Default will be all you need.

    you know what... i think it was the -usepw line.

    the first time i ran that, i was logged in as my user account. not root.

    that might have been screwing me up.

    i don't yet have my connection restored, so ill let you know what happens when i get it up and running

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

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