Running a script at startup as root?

Posted by Usman Ajmal on Super User See other posts from Super User or by Usman Ajmal
Published on 2010-04-14T09:17:24Z Indexed on 2010/04/14 9:24 UTC
Read the original article Hit count: 202

Filed under:

Hi

i developed a script which I set to run at startup i.e. when the Desktop appears. In the script I mounted a partition using

sudo mount /dev/sda1 /mnt &> result.txt

After executing script a file named result.txt was created which contained

sudo: no tty present and no askpass program specified

In other words the mounting failed. If I run the script using sudo ./myProgram i don't face this problem and the drive gets mounted successfully.

Any suggestions please....

© Super User or respective owner

Related posts about linux