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

Jonathan Billings billings at negate.org
Wed Apr 17 10:09:09 EDT 2013


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>


More information about the mdlug mailing list