Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autorun in Linux?

Status
Not open for further replies.

LegoPiMaster

Programmer
Apr 25, 2004
24
0
0
US
Does linux have anything equivilant to autorun.inf from windows?


-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

echo `fortune fortunes`$'\b in bed.'
Your lover will never wish to leave you in bed.
 
what is 'autorun.inf' on windows? I rember foggy: a file on cd...

Well - we in linuxland don't think, that a sort of media should tell the os what to do. If the user is too stupid, to start a program from cd, he should stay away.

A cd normally has too few informations about the environment, in which it is used - doesn't it?
Ok - the autorun.sh - file could do some testing (test which shell to use to interpret a second script, in which a test is performed, whether X11 is running, which user performed the command, find out screen-resolution etc.

In raw linux-mode, a cd isn't even mounted into the filesystem by inserting.

Now we have some automounters, but I don't use them. Do they work fine?
If yes, you could modify it to look for a autorun.sh, but this will of course only affect your computer.

I suggest to put a README.html in the toplevel directory, where you tell what the program expects and needs (400 MB RAM, a multimedia-player), and how to invoke it 'click on autorun.sh'.

Put everything beside this README.html and the autorun.sh in subdirectorys.
When the user looks at the CD in a browser (or via 'ls') he will see that there is a README.html and if he ignores it, it's his fault.
 
Actually, i was not wondering for other users, but for my own convienience. It would be nice, for example, to be able to insert a game cd and have it pop up w/a nice little box asking you if you want to play (chances are you do if you put in the cd)

If not raw linux, then maybe some standard for the guis (gnome/kde/...). I think gnome is supposed to automount the cd for you (actually, mine appears constantly mounted but it think that's a bug)


-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

echo `fortune fortunes`$'\b in bed.'
Your lover will never wish to leave you in bed.
 
so you are going to burn the cd yourself?
Then you could modify the automounter, that it will search for a 'autorun.sh' when successfully mounted, and if it finds autorun.sh in /mnt/cdrom then execute it.

But I'm not sure how automount works.

dont't visit my homepage:
 
ok, but i don't really feel like modifying the automounter (no time)
i was just trying to find out if there was some standard
maybe there should be one (if not through core linux then though gnome or kde, etc...) the goal of graphical desktops, is after all to make life easier for the user


-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

echo `fortune fortunes`$'\b in bed.'
Your lover will never wish to leave you in bed.
 
Well - it would make life more complicated for me, because I had to turn it off then.

If a cd could run automatically, it would be very riscy to start kde/gnome as root.
Perhaps he forgot about the evil 'rm -rf /' - cd in his drive.

dont't visit my homepage:
 
you're not supposed to run gnome/kde as root anyway
it actually gives you a dialog box if you try to warning you not to


-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

echo `fortune fortunes`$'\b in bed.'
Your lover will never wish to leave you in bed.
 
See if this is what you need:

> Well - we in linuxland don't think, that a sort of media should tell the os what to do. If the user is too stupid, to start a program from cd, he should stay away.

I disagree.

I would say that the media should not be able to force the OS into doing something if the user has decided that it shouldn't.

But if the user has decided that a certain action should happen when he puts a CD in, and having that happen is physically possible, then it is very much in the spirit of Linux for there to be to accomodate the user.


It's not always a matter of users being too stupid to start a program manually; we're also lazy.

Probably 99% of the time I put a Megadeth CD into my drive, I want to listen to it. Sure, I could take five seconds to go to my terminal or through GNOME and start a CD player application. Doing that one time probably doesn't waste too much of my time. Doing that 100 times wastes over eight minutes of my time.

Depending on how many times I'm going to listen to music CDs, taking five minutes to figure out autorun and getting it to run the command for me may be the more profitable course of action when trying to achieve overall laziness. If I expect to listen to music CDs on this computer more than 100 times over the course of time I have this setup, then I take the time to configure something to do it for me.

It's the same principle as in compiling a program. Sure, I could figure out all the dependencies in a medium- to large-sized project and compile and link them all manually. It wouldn't be that hard. But someone expected people to have build medium- to large-sized programs a lot, so they were lazy enough to write Make to do it for them.

I call this principle "being lazy in advance," and it is very much a part of the Linux philosophy.


The three chief virtues of a programmer are: Laziness, Impatience and Hubris.
--Larry Wall
 
amen chipper! (and thanx for the link - i'll check it out)

'|' |-| /-\ |\| |< $


-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

echo `fortune fortunes`$'\b in bed.'
Your lover will never wish to leave you in bed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top