Results 1 to 3 of 3

Thread: Problem with running a startup script

  1. #1
    Join Date
    Sep 2009
    Beans
    11

    Problem with running a startup script

    Hi


    Is there a way I can run myProgram when ubuntu's desktop appears no matter if root , administrator, desktop user or an unprivileged user logged in?



    I actually developed a script which I set to run at startup via System > Preferences > Startup Application i.e. when the Desktop appears. In the script I mounted a partition using
    Code:
    sudo mount /dev/sda1 /mnt &> result.txt
    After executing script a file named result.txt was created which contained
    Code:
    sudo: no tty present and no askpass program specified
    In other words the mounting failed. If I run the script myself from the terminal using sudo ./myProgram i don't face this problem and the drive gets mounted successfully.
    Any suggestions please....

  2. #2
    Join Date
    Jan 2009
    Location
    Buenos Aires, Argentina
    Beans
    669

    Re: Problem with running a startup script

    Do you know about /etc/fstab ?

  3. #3
    Join Date
    Sep 2009
    Beans
    11

    Re: Problem with running a startup script

    Yes I know about /etc/fstab.

    Okay I have added an entry for mounting /dev/sda1 in /etc/fstab. The problem is still there i.e. when my desktop appears my startup program says

    Code:
    sudo: no tty present and no askpass program specified
    I get this message when I use 'sudo' before 'dd'. If I use the dd without 'sudo' as:

    Code:
    dd if=/dev/sda2 of=/dev/sda5 ?> result.txt
    Then, the result.txt contains

    Code:
    dd: opening '/dev/sda2': Permission denied
    How can I copy a partition at startup no matter if root, admin, desktop or an unprivileged user logs in?

    I thought it will really be easy but seems like I was wrong. Am I not explaining the question clearly?

Tags for this Thread

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
  •