[mdlug] Adding a shell script to run after boot.

Jeff Hanson jhansonxi at gmail.com
Wed Apr 17 12:18:40 EDT 2013


If it's a timing problem then just repeatedly check the mountpoint via
while/do/done loop.  Add a sleep command and a counter with a "break" to
escape the loop if it doesn't mount after a set number of cycles.


On Wed, Apr 17, 2013 at 10:38 AM, Adam Behnke <abehnke at gmail.com> wrote:

> i am trying to trying to determine if the usb is mounted and create an
> alternate method of playing the menuboard it the usb drive didn't mount.
>
> thank you for the suggestions, i'll trying grepping and mounting somewhere
> other than /media if it doesn't see the usb drive and googling dbus
> signals.
>
>
>
>
>
>
> On Wed, Apr 17, 2013 at 10:09 AM, Jonathan Billings <billings at negate.org
> >wrote:
>
> > On Wed, Apr 17, 2013 at 09:26:24AM -0400, Adam Behnke wrote:
> > >
> > > the script currently, works in terminal, fails on startup
> > >
> > > #!/bin/bash -l
> > > echo "initializing"
> > > if [ "$(ls -A /media/videowall9)" ]; then
> >
> > What are you trying to do here?  Determine if the mountpoint exists?
> > You might be better off replacing the "$(..)" with a grep of
> > /proc/mounts.
> >
> > > umount /media/videowall9
> > > rmdir /media/videowall9
> >
> > I bet /media is an automount directory (or something gvfs monitors?)
> > so you can't willy-nilly create and delete mountpoints in /media.
> > Also, this is running in your user's context, and I doubt it has the
> > ability to create and remove mountpoints in /media.  This is why the
> > automount systems exist.
> >
> > If you really want to have your external storage always mounted
> > somewhere, put it in /etc/fstab and mount it someplace other than
> > /media.  There are options you can set to have the user have the
> > ability to mount/unmount it on demand, although not automatically.
> >
> > If you want some command to run on graphical login, you need to have
> > it either listen for an event from the DBus system about the
> > mountpoint, or (less complex) just have it sit around and wait until
> > the mountpoints exist.
> >
> > --
> > Jonathan Billings <billings at negate.org>
> > _______________________________________________
> > mdlug mailing list
> > mdlug at mdlug.org
> > http://mdlug.org/mailman/listinfo/mdlug
> >
> _______________________________________________
> mdlug mailing list
> mdlug at mdlug.org
> http://mdlug.org/mailman/listinfo/mdlug
>


More information about the mdlug mailing list