Execute script on expire.
Hello mailing list,
was looking everywhere and could find info on whether or not autofs 4 or 5 has a feature of executing designated script on expire, just before unmounting.
Signature · 2 lines
Sincerely, Alexandr N.
Quoted 5 lines · Alexander
Hello mailing list,
was looking everywhere and could find info on whether or not autofs 4 or 5 has a feature of executing designated script on expire, just before unmounting.
The short answer is no.
Cheers,
Jeff
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Alexander
2008/9/12 Jeff Moyer <[email protected]>:
Quoted 4 lines
Quoted 2 lines · Alexander
Hello mailing list,
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
was looking everywhere and could find info on whether or not autofs 4 or 5 has a feature of executing designated script on expire, just before unmounting.
The short answer is no.
Is it somewhere in the development plans or will never be implemented by design?
I believe there was one other requestor of this feature. The tricky part is defining the map syntax and not breaking compatibility. There is also the question of semantics with offset mounts.
If someone is motivated enough to come up with a proposal for the syntax and semantics, I'm sure Ian and I can find some time to review it.
Cheers,
Jeff
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thank you for response.
I simply forgot to CC the list. Now it should work.
This is a simplified situation of using automatic squashfs container generation with autofs.
---------------------------------------------------------------------------------------------------
User: john.
autofs path to make squashfs: /makesqfs
access mask: /makesqfs/<username>/<file name>
autofs path to access sqfs: /usercontainers access mask: /usercontainers/<username>/<file name>
John wants to put one of his folders (/home/john/foldertoprocess) in a secure storage as a squashfs container which can be accessed automatically anytime.
he could make it by isssuing regular command mksquashfs <source> <destination file name> -<options> and copy resulted file to secure storage.
be he wants to use something simpler and robust.
Instead, John issues the following command:
cp /home/john/foldertoprocess /makesqfs/john/marketanalyzis
after some time he (and may be other users in the system) can access his securely stored and read only files by following this symbolic link
/containers/john/marketanalyzis
what happens on backend?
======================
when he copies files to
/makesqfs/john/marketanalyzis
autofs executes a script that prepares temporary folder somewhere (/tmp/john/marketanalyzis)
and mounts it as /makesqfs/john/marketanalyzis
when copying finishes and timeout of 5 minutes of inactivity fires in autofs, it executes a designated script and passes /makesqfs/john/marketanalyzis as a parameter.
script makes a squashfs container marketanalyzis.sfs and puts it somewhere in secure location, and then makes a symbolic link at /containers/john/marketanalyzis
which points to
/usercontainers/john/marketanalyzis
after script is done, autofs successfully unmounts /makesqfs/john/marketanalyzis
Notes:
i think script can also remount /makesqfs/john/marketanalyzis as read only before making actual mksquashfs command.
with such approach squashfs container creation may be done on separate computer, while mounting part can also be done from different locations.
2008/9/16 Jeff Moyer <[email protected]>:
Quoted 37 lines
Quoted 9 lines · Alexander
truly speaking i don't know what is semantics with offset mounts, but can describe following situation.
client access the folder /tmpstorage/filestocompress
it mounts as/tmp/filestocompress(where /tmp is a tmpfs/shmfs or unionfs with different underlying mount points)
client then copies his files there and after time of inactivity autofs executes script/bin/compressand after it's completion unmounts all corresponding mount points.I'm not quite sure I follow. If you could list the steps, taking automount out of the picture, that would be helpful. So, what is the ordered list of steps to perform, using *exact* path names. Above, what's confusing me is that an access to /tmpstorage/filestocompress would mount anything on /tmp. Autofs simply doesn't work that way.
Quoted 8 lines
the
/bin/compressscript does following:
0. it gets parameter of what path is going to be unmounted, in our example it is/tmp/filestocompress
1. makes compressed tar, bzip, or squashfs container from/tmp/filestocompressin /users/username/filestocompress.tar
2. optionaly deletes all files in/tmp/filestocompressand exitssomething like that
Again, a specific example would be more helpful (with real commands and paths).
I'm curious to know why you didn't CC the list on your response. Is it okay if we continue discussions there?
Thanks!
Jeff
Signature · 2 lines
Sincerely, Alexandr N.