Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
There are several old questions about the same argument. Have you given a look? –  enzotib Jun 4 '11 at 19:48
    
@enzotib, didn't find em in a quick search. –  Oxwivi Jun 4 '11 at 19:53
    
This is one: askubuntu.com/questions/45631/… –  enzotib Jun 4 '11 at 19:58
    
@enzotib, that doesn't say anything about commands with admin privileges for commands executed with log in. –  Oxwivi Jun 4 '11 at 20:09
    
If it's command at GDM, it's beyond users and naturally under root. –  Oxwivi Jun 4 '11 at 20:10
show 2 more comments

1 Answer

up vote 3 down vote accepted

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
share|improve this answer
    
No issues with admin privileges? And won't it effect all the users on the system? –  Oxwivi Jun 5 '11 at 9:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.