Re: [OpenWrt-Devel] Resend: [PATCH] start selected services after block mount

2011-03-15 Thread Daniel Dickinson
On Fri, 11 Mar 2011 11:44:27 +
Lee Essen  wrote:

> Is there any interest in this?

Jow and I talked about this and we thought that it would be better to
have a hotplug handler than arbitrary script execution within the
block-mount.  Here's the part of the conversation I captured on how to
implement:

01:26:51 PM) xMff: env -i ACTION=mount DEVICE=/dev/foo
DIRECTORY=/foo/bar /sbin/hotplug-call mount 
(01:27:12 PM) xMff: env -i
ACTION=umount DEVICE=/dev/foo DIRECTORY=/foo/bar /sbin/hotplug-call
mount 
(01:27:21 PM) cshore: ah, ok 
(01:27:23 PM) xMff: etc. in the appropraite palces within the mount
scripts 
(01:27:32 PM) xMff: right
before mount ... and umount ... 
(01:27:57 PM) xMff: hotplug-call will
block while the scripts run (unless scripts decide to detach themselves)
(01:29:36 PM) cshore: yeah, that makes sense 
(01:29:45 PM)
xMff: one could then still ship a standard hotplug handler which
implements the uci options proposed on the ml 
(01:30:06 PM) xMff: like /etc/hotplug.d/mount/01-run-services 
(01:30:55 PM) xMff: I don't know whether there maybe already are
standard uevents for mount and umount 
(01:31:08 PM) xMff: so that you do not even have to call hotplug-call
http://alinux.tv/Kernel-2.6.34/filesystems/gfs2-uevents.txt I suppose
other filesystems provide those as well
(01:36:52 PM) xMff: hm nope, just checked 
(01:37:13 PM) xMff: there are uevents for appearing and disappearing
blockdevs or partitions, but none for actual mount and umount 
(01:37:27 PM) cshore: ok, good to know 
(01:37:34 PM) xMff: at least not with ext2/3/4

-- 
 hm. I've lost a machine.. literally _lost_. it responds to ping, 
it works completely, I just can't figure out where in my apartment it
is. GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C  http://gnupg.org



signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Resend: [PATCH] start selected services after block mount

2011-03-11 Thread Lee Essen
Is there any interest in this?Is it better packaged separately?Also, as a side note, it does present another challenge ... all packages included in the image are enabled by default, this means these things would startup automatically the first time around  could be enhanced to include a config string containing those packages not to auto-enable. I'm happy to implement, but if nobody is interested then I'll just keep it to my local repository.Thanks,Lee.Begin forwarded message:From: Lee Essen Date: 18 February 2011 08:48:00 GMTTo: openwrt-devel@lists.openwrt.orgSubject: [PATCH] start selected services after block mountThis patch adds /etc/hotplug.d/block/60-services that will look for "service" entries in /etc/config/fstab against a given mount and start them once the mount has been completed by the hotplug system. This is to solve the problem of usb devices being mounted after most of the rc system has completed, therefore any services that are intended to write to a mounted filesystem either fail or end up writing to the mount point prior to the mount.An example config:config 'mount'	option 'enabled' '1'	option 'device' '/dev/sda1'	option 'target' '/site'	option 'fstype' 'ext4'	option 'options' 'rw,noatime'	list 'service' 'syslog-ng'	list 'service' 'collectd'Signed-off-by: Lee Essen 

block_mount_svcs.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel