Results 1 to 3 of 3

Thread: setting xhost rules at boot...

  1. #1
    Join Date
    Mar 2012
    Beans
    2

    setting xhost rules at boot...

    I am able to set xhost at boot in Fedora by editing /etc/gdm/Init/Default and for example add:

    /usr/bin/xhost +local:

    How can similar be done in Ubuntu? I want that the

    /usr/bin/xhost +local:

    command is executed when the system is sitting at login prompt.

  2. #2
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    5,342
    Distro
    Ubuntu

    Re: setting xhost rules at boot...

    Do you want it executed when the computer turns on (before showing the login screen) or after you have logged in?

    To execute a command after you have logged in, add the command to .profile in your home folder (this will apply only to you).

    To execute a command when you or anyone else logs in, add the command to /etc/profile.

    To execute a command before anyone logs in, add the command to either /etc/rc.local or /etc/gdm/Init/Default (I don't know the difference between the two, so I don't know which one is preferable).
    Always make regular backups of your data (and test them).
    Visit Full Circle Magazine for beginners and seasoned Linux enthusiasts.

  3. #3
    Join Date
    Mar 2012
    Beans
    2

    Re: setting xhost rules at boot...

    Quote Originally Posted by Paddy Landau View Post
    To execute a command before anyone logs in, add the command to either /etc/rc.local or /etc/gdm/Init/Default (I don't know the difference between the two, so I don't know which one is preferable).
    Thank you for the answer, This is the correct answer if ubuntu was using GDM (the Init/Default one). If I put it to /etc/rc.local, I believe it wont work since only the user who starts GDM would have right to change xhost setting.

    However, since Ubuntu is using Lightdm at this point. I was looking for something which would work with lightdm. For now, I could solve the issue by giving shell to lightdm, setting DISPLAY=:0 in shell rc file and running su - lightdm -c xhost +local: from the rc.local. This is not quote elegant...

Tags for this Thread

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
  •