diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-08-09 20:11:26 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-08-09 20:11:26 +0200 |
commit | a37610d0f885ee301fd99757beb9fd7af729307f (patch) | |
tree | eeb6913ba7c6a95f591b9b3db4f84b5277d791cd /extras/run_directory/dev.d | |
parent | 34c00c915c6dd9d063551732169cb3c3126376ad (diff) |
remove example rules and put the dev.d stuff into the run_directory folder
The distro rules are the best example you can get and the use of
dev.d/ is no longer recommended.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'extras/run_directory/dev.d')
-rw-r--r-- | extras/run_directory/dev.d/default/pam_console.dev | 52 | ||||
-rw-r--r-- | extras/run_directory/dev.d/net/hotplug.dev | 21 | ||||
-rw-r--r-- | extras/run_directory/dev.d/snd/controlC0/alsa.dev | 2 |
3 files changed, 75 insertions, 0 deletions
diff --git a/extras/run_directory/dev.d/default/pam_console.dev b/extras/run_directory/dev.d/default/pam_console.dev new file mode 100644 index 0000000000..4c69ea3576 --- /dev/null +++ b/extras/run_directory/dev.d/default/pam_console.dev @@ -0,0 +1,52 @@ +#!/bin/sh + +# Fedora solution to set the ownership/permissions of s device to the local +# logged in user. Uses the program pam_console_setowner to match the names of +# the device node and the symlinks against a device list and applies the +# configured ownership and permission to the node. + +[ "$ACTION" != "add" ] && exit 0 + +# we do not have console users in rc.sysinit +[ -n "$IN_INITLOG" ] && exit 0 + +if [ -x /sbin/pam_console_setowner -a -f /var/run/console/console.lock \ + -a -e "$DEVNAME" ]; then + + if [ -x /usr/bin/logger ]; then + LOGGER=/usr/bin/logger + elif [ -x /bin/logger ]; then + LOGGER=/bin/logger + else + unset LOGGER + fi + # + # for diagnostics + # + if [ -t 1 -o -z "$LOGGER" ]; then + mesg () { + echo "$@" + } + else + mesg () { + $LOGGER -t $(basename $0)"[$$]" "$@" + } + fi + + debug_mesg () { + test "$udev_log" = "" -o "$udev_log" = "no" && return + mesg "$@" + } + + if [ -f /etc/udev/udev.conf ]; then + . /etc/udev/udev.conf + fi + + SYMLINKS="" + for i in $(/usr/bin/udevinfo -q symlink -p "$DEVPATH"); do + [ $? -gt 0 ] && break + SYMLINKS="$SYMLINKS ${udev_root%%/}/$i" + done + debug_mesg "Restoring console permissions for $DEVNAME $SYMLINKS" + /sbin/pam_console_setowner "$DEVNAME" $SYMLINKS +fi diff --git a/extras/run_directory/dev.d/net/hotplug.dev b/extras/run_directory/dev.d/net/hotplug.dev new file mode 100644 index 0000000000..e195b0f034 --- /dev/null +++ b/extras/run_directory/dev.d/net/hotplug.dev @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Script to ensure that any network device that udev renames +# still gets the hotplug script run with the proper name. +# +# Released under the GPL v2 +# +# Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> +# + +# Do nothing if udev handles hotplug.d. +if [ "$MANAGED_EVENT" == "1" ]; then + exit 0 +fi + +# ok, we have renamed this device, so let the network hotplug script +# know about it to setup the device properly... +if [ -f /etc/hotplug.d/default/default.hotplug ]; then + exec /etc/hotplug.d/default/default.hotplug net +fi + diff --git a/extras/run_directory/dev.d/snd/controlC0/alsa.dev b/extras/run_directory/dev.d/snd/controlC0/alsa.dev new file mode 100644 index 0000000000..642dde4f36 --- /dev/null +++ b/extras/run_directory/dev.d/snd/controlC0/alsa.dev @@ -0,0 +1,2 @@ +#!/bin/sh -e +exec /usr/sbin/alsactl restore 0 |