RFC: Autostart spec, first draft

David Collier-Brown David.Collier-Brown at Sun.COM
Thu Jul 7 19:09:44 EEST 2005


Mike Hearn wrote:
> I don't think there's anything wrong with Windows style auto-start. It's 
> convenient for the user and requires minimal knowledge and interaction. 
> We just need to get it right.

 The samba team did this well: for a given "share"
(mounted filesystem) they define eight options that go in a 
administer-only config file.
  The first four are commands to be run before and after the
share is made available.

	root preexec = command & options
 	preexec = command & options
	postexec  = command & options
	postexec close = boolean, and
	root postexec = command & options
and
	root preexec close = boolean
	preexec close = boolean
	root postexec close = boolean
	root postexec close = boolean

The latter turn on/off return code checking, 

If I say
	[share for a cd]
		root preexec = mount /mnt/cdrom0
		root preexec close = True
then on being asked to provide the share, the server
will run the command "mount /mnt/cdrom0" as root, and
if and only if it succeeds, will continue to 
making the share available to the user.

The non-root pre and postexecs are for commands that
should run as the user who's requested the share,
so as to allow for actions which require specific user
permissions as well as root permissions.

  This is somewhat similar to what you're describing,
just generalized to handle all media, not just CDs.

--dave
-- 
David Collier-Brown,      | Always do right. This will gratify
Sun Microsystems, Toronto | some people and astonish the rest
davecb at canada.sun.com     |                      -- Mark Twain
(416) 263-5733 (x65733)   |



More information about the xdg mailing list