5

I want add commands to my startup list that needs admin privileges, how do I go about it? Obviously there's no chance of me typing in the password when the computer is starting up.

NOTE At this time, I won't be able to verify if any of the answers would actually work, so I'd appreciate if someone can provide a solution that has actually worked in practice.

Oxwivi
  • 18,499

1 Answers1

8

Short answer

Simply add your commands at the end of the file /etc/rc.local (but before the exit 0 line!)

Long answer

Of course there's also the Debian way of doing this - writing a script. Put it in the /etc/init.d/ directory.

Lets say you called it FOO. You then run % update-rc.d FOO defaults. You also have to make the file you created, FOO, executable, using $chmod +x FOO.

You can check out % man update-rc.d for more information. It is a Debian utility to install scripts. The option defaults puts a link to start FOO in run levels 2, 3, 4 and 5 (and puts a link to stop FOO into 0, 1 and 6.)

To make the script run as last:

update-rc.d -f my_script_name defaults 99
Oxwivi
  • 18,499