PDA

View Full Version : [ubuntu] Startup App with sudo



gurt
June 30th, 2009, 02:08 AM
I have an application that I want to Startup automatically every time. But the application requires sudo and a password. How can I automate starting up this app?

bam@mingus:/opt/dynamips$ sudo dynamips -H 7200
[sudo] password for bam:

Ta!

~sHyLoCk~
June 30th, 2009, 03:18 AM
sudo visudo

And add this:~

bam ALL = NOPASSWD: /opt/dynamips/dynamips

Create an entry in your Preferences->Startup Applications and put this:

dynamips -H 7200
Reboot and see if it works?

gurt
June 30th, 2009, 07:30 AM
Thanks for the reply!
It doesn't seem to be working. I see the dynamips process in the System Manager. But the app that uses Dynamips (cllaed Dynagen) just hangs. If I edn the dynamips process and relaunch it manually 'sudo dynamips -H 7200', then dynagen works OK.

Any ideas on how to troubleshoot this?

Thanks for turning me onto visudo! :cool:

Thingymebob
June 30th, 2009, 08:33 AM
edit /etc/rc.local
and add dynamips -H 7200
before the exit 0 statement

gurt
June 30th, 2009, 10:13 AM
That worked Thingymebob -- Thanks!

I noticed that the dynamips process isn't showing up in the System Monitor/Processes. How's that?

Thingymebob
June 30th, 2009, 06:44 PM
I think, but am happy to be corrected here, its because system monitor only shows processes owned by the user, and your dynamips process is owned by root. You can confirm this behaviour by creating a process as yourself, e.g just enter top in a terminal and the process will appear in system monitor. However if you enter sudo top, the process will not appear.