Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

According to Gnome's Desktop Application Autostart Specification, I should be able to have a program execute simply by naming it any of ".autorun", "autorun", or "autorun.sh". None of these seem to work: I get a prompt from nautilus-autorun-software asking if I want to let it run, I say "Run", and it results in a dialog that says "Error autorunning software: Cannot find the autorun program". Is it a bug or am I not doing something correctly?

The autorun file contains the following:

#! /bin/sh
gnome-terminal -x sh -c '~/bin/podcatcher/copypodcasts.sh; echo Done!; read pause'

It works if I manually run the autorun file.

The filesystem is fat, here's the mtab entry:

/dev/sdd1 /media/disk vfat rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush 0 0
share|improve this question
    
What type of filesystem is on the volume, and what mount options are used? What are the effective permissions on the autorun file? –  Gilles Nov 30 '10 at 19:28
    
@Gilles: details added –  Shawn J. Goff Dec 2 '10 at 1:47
1  
I think there should not be a space between #! and /, eg. #!/bin/sh –  Martin Jun 30 '11 at 14:12
    
@Martin It doesn't matter. in-ulm.de/~mascheck/various/shebang/#details –  Shawn J. Goff Jun 30 '11 at 18:31
add comment

2 Answers

It makes no sense.

An USB drive is automatically mounted and owned by desktop user. But she must umount it and mount it again as root? I can not see a practical use for this behaviour.

Anyway, I tested this root-mount and nothing showed up on the user desktop.

If you take a look on nautilus code 1 the _check_file function has no default for "must_be_executable", and calls to this function do not set that parameter.

The only way I got it working was this:

  • format the USB drive in ext2 or ext3
  • put an autoexec file on it
  • change permissions to make this file executable by a desktop user (file can be owned by anybody)
  • plug the USB drive and let gnome to automount it
share|improve this answer
add comment

The cd is probably mounted with the noexec option.

Login as root on a terminal umount it and mount it again as root. This time as a user in the gui autorunning the cd should work. (It does for me with VirtualBox)

share|improve this answer
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.