Results 1 to 3 of 3

Thread: Run script as root at boot

  1. #1
    Join Date
    Jun 2008
    Location
    Canada
    Beans
    186
    Distro
    Lubuntu

    Run script as root at boot

    Hi. I'm wondering where to put a script that I want to run at boot. When I google it, there are several options, but many are to run script automatically at LOGIN. I want this script to run no matter who logs in.

    Is the right place /etc/rc.local?

    Thanks.

  2. #2
    Join Date
    Sep 2006
    Beans
    7,019
    Distro
    Lubuntu Development Release

    Re: Run script as root at boot

    /etc/rc.local will run at boot after all other startup scripts are run. It will run regardless of who logs in or even if anyone logs in at all.

  3. #3
    Join Date
    Jul 2007
    Location
    Mississauga, ON
    Beans
    123
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Run script as root at boot

    rc.local will work. Alternatively you can:

    Code:
    sudo crontab -e
    This opens vi to edit the root's scheduled tasks. Append the following line:

    Code:
    @reboot /path/to/command
    Save and exit.
    Windows by necessity, Linux by choice
    Lubuntu and loving it!

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
  •