|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Getting hotplugd to work
I'm trying to make OpenBSD automount USB and optical media, so that I don't have to bother with kern.usermount and associated insecurity. Because I'm trying to keep things simple and avoid using regexps, I just want to mount stuff by device name.
My /etc/hotplug/attach file looks like this: Code:
#!/bin/sh DEVCLASS=$1 DEVNAME=$2 case $DEVCLASS in 2) # disk devices case $DEVNAME in sd1) # USB drives mount -o nodev,nosuid /dev/sd1i /mnt/flash ;; cd0) # CD drives mount -o nodev,nosuid /dev/cd0a /mnt/optical ;; esac esac How can I get it to mount a CD or DVD? And what's the best way to apply sane permissions to the USB drive, without changing the permissions on the device node? Edit: okay, major "Duh" moment on the USB permissions problem. The solution is to make the mount directory writeable by whoever needs to write to it. Still haven't figured out the CD drive though. Last edited by GullibleJones; 8th January 2013 at 10:01 PM. Reason: One problem solved. |
|
|||
The easiest way to solve the permission problem is to create a "mount" partition, inside the home partition. I am lazy to type so I use a directory called "U"
Code:
$ sudo mount /dev/cd0a U Code:
#!/bin/sh DEVCLASS=$1 DEVNAME=$2 case $DEVCLASS in 2) # disk devices case $DEVNAME in *) echo $(date) : DEVCLASS: $DEVCLASS >>/tmp/debug.attach.txt 2>&1 echo $(date) : DEVNAME : $DEVNAME >>/tmp/debug.attach.txt 2>&1 esac esac Code:
[adriaan@hercules]~: cat /tmp/debug.attach.txt Wed Jan 9 02:41:21 CET 2013 : DEVCLASS: 2 Wed Jan 9 02:41:21 CET 2013 : DEVNAME : sd0 Even the following attach script does not produce anything on inserting a CD. Code:
#!/bin/sh cat <<END >>/tmp/debug.attach.txt $(date) -------------------------------- $(env) -------------------------------- $(set) -------------------------------- END
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
why won't my table work? | tomp | OpenBSD Security | 3 | 25th August 2011 12:23 PM |
nspluginwrapper not work... | marduk | NetBSD Installation and Upgrading | 4 | 3rd January 2011 10:23 PM |
ATI Catalyst.... Does it work? | echoblack | OpenBSD Installation and Upgrading | 10 | 17th June 2009 09:04 AM |
Crossplatform UI Work | Turophile | Programming | 9 | 21st October 2008 11:56 PM |
Getting Qt4 to work on FreeBSD | enpey | FreeBSD Ports and Packages | 6 | 6th May 2008 07:20 AM |