Results 1 to 3 of 3

Thread: Force script execution on startup

  1. #1
    Join Date
    Jun 2012
    Beans
    2

    Exclamation Force script execution on startup

    Hi, I'm on Ubuntu 11.10 and due to the fact that my computer does not recognize the Brightness comands on my keyboard, I am forced to use the following command:
    Code:
    sudo setpci -s 00:02.0 F4.B=20
    If I don't execute this, looking at my screen feels like staring at the sun.

    So, my question is: how can I force Ubuntu to execute this line on startup?

    Thanks!
    Last edited by phi19; October 3rd, 2012 at 04:34 AM.

  2. #2
    Join Date
    Jul 2011
    Beans
    3,037
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Force script execution on startup

    You could put the command in the file /etc/rc.local, so that it will be executed as part of the boot process. Using this method, the script will be executed independent from a user login.

  3. #3
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Force script execution on startup

    Yes , rc.local is the best file to include this command. And no need of sudo.

    Code:
    gksudo gedit /etc/rc.local
    and add the command before exit 0

    Code:
    setpci -s 00:02.0 F4.B=20
    save and reboot.

    If command not executed , then add a little delay

    Code:
    (sleep 2 ; setpci -s 00:02.0 F4.B=20) &
    Thanks

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
  •