From 6f4ef88f99a9f9058ada8cf94efb33678b4ae8da Mon Sep 17 00:00:00 2001 From: frank Date: Mon, 16 Jan 2012 20:25:25 +0100 Subject: [PATCH] committing changes in /etc after emerge run Package changes: +net-fs/autofs-5.0.6-r3 --- .etckeeper | 9 +++ auto.master | 23 +++++++ auto.misc | 15 +++++ auto.net | 43 +++++++++++++ auto.smb | 34 +++++++++++ autofs/auto.master | 24 ++++++++ autofs_ldap_auth.conf | 11 ++++ conf.d/autofs | 136 ++++++++++++++++++++++++++++++++++++++++++ init.d/autofs | 70 ++++++++++++++++++++++ 9 files changed, 365 insertions(+) create mode 100644 auto.master create mode 100644 auto.misc create mode 100755 auto.net create mode 100755 auto.smb create mode 100644 autofs/auto.master create mode 100644 autofs_ldap_auth.conf create mode 100644 conf.d/autofs create mode 100755 init.d/autofs diff --git a/.etckeeper b/.etckeeper index 8cf093d0..f01ac260 100755 --- a/.etckeeper +++ b/.etckeeper @@ -122,6 +122,13 @@ maybe chmod 0640 './audit/audit.rules-2.1.3' maybe chmod 0640 './audit/audit.rules.stop.post' maybe chmod 0640 './audit/audit.rules.stop.pre' maybe chmod 0640 './audit/auditd.conf' +maybe chmod 0644 './auto.master' +maybe chmod 0644 './auto.misc' +maybe chmod 0755 './auto.net' +maybe chmod 0755 './auto.smb' +maybe chmod 0755 './autofs' +maybe chmod 0644 './autofs/auto.master' +maybe chmod 0600 './autofs_ldap_auth.conf' maybe chmod 0755 './avahi' maybe chmod 0755 './avahi/avahi-autoipd.action' maybe chmod 0644 './avahi/avahi-daemon.conf' @@ -154,6 +161,7 @@ maybe chmod 0644 './conf.d/acpid' maybe chmod 0644 './conf.d/alsasound' maybe chmod 0644 './conf.d/apache2' maybe chmod 0644 './conf.d/auditd' +maybe chmod 0644 './conf.d/autofs' maybe chmod 0644 './conf.d/bluetooth' maybe chmod 0644 './conf.d/bootmisc' maybe chmod 0644 './conf.d/consolefont' @@ -601,6 +609,7 @@ maybe chmod 0755 './init.d/aiccu' maybe chmod 0755 './init.d/alsasound' maybe chmod 0755 './init.d/apache2' maybe chmod 0755 './init.d/auditd' +maybe chmod 0755 './init.d/autofs' maybe chmod 0755 './init.d/avahi-daemon' maybe chmod 0755 './init.d/avahi-dnsconfd' maybe chmod 0755 './init.d/bluetooth' diff --git a/auto.master b/auto.master new file mode 100644 index 00000000..9fe5609b --- /dev/null +++ b/auto.master @@ -0,0 +1,23 @@ +# +# Sample auto.master file +# This is an automounter map and it has the following format +# key [ -mount-options-separated-by-comma ] location +# For details of the format look at autofs(5). +# +/misc /etc/auto.misc +# +# NOTE: mounts done from a hosts map will be mounted with the +# "nosuid" and "nodev" options unless the "suid" and "dev" +# options are explicitly given. +# +/net -hosts +# +# Include central master map if it can be found using +# nsswitch sources. +# +# Note that if there are entries for /net or /misc (as +# above) in the included master map any keys that are the +# same will not be seen as the first read key seen takes +# precedence. +# ++auto.master diff --git a/auto.misc b/auto.misc new file mode 100644 index 00000000..0ee5e75f --- /dev/null +++ b/auto.misc @@ -0,0 +1,15 @@ +# +# This is an automounter map and it has the following format +# key [ -mount-options-separated-by-comma ] location +# Details may be found in the autofs(5) manpage + +cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom + +# the following entries are samples to pique your imagination +#linux -ro,soft,intr ftp.example.org:/pub/linux +#boot -fstype=ext2 :/dev/hda1 +#floppy -fstype=auto :/dev/fd0 +#floppy -fstype=ext2 :/dev/fd0 +#e2floppy -fstype=ext2 :/dev/fd0 +#jaz -fstype=ext2 :/dev/sdc1 +#removable -fstype=ext2 :/dev/hdd diff --git a/auto.net b/auto.net new file mode 100755 index 00000000..ba03447a --- /dev/null +++ b/auto.net @@ -0,0 +1,43 @@ +#!/bin/bash + +# This file must be executable to work! chmod 755! + +# Look at what a host is exporting to determine what we can mount. +# This is very simple, but it appears to work surprisingly well + +key="$1" + +# add "nosymlink" here if you want to suppress symlinking local filesystems +# add "nonstrict" to make it OK for some filesystems to not mount +opts="-fstype=nfs,hard,intr,nodev,nosuid" + +# Showmount comes in a number of names and varieties. "showmount" is +# typically an older version which accepts the '--no-headers' flag +# but ignores it. "kshowmount" is the newer version installed with knfsd, +# which both accepts and acts on the '--no-headers' flag. +#SHOWMOUNT="kshowmount --no-headers -e $key" +#SHOWMOUNT="showmount -e $key | tail -n +2" + +for P in /bin /sbin /usr/bin /usr/sbin +do + for M in showmount kshowmount + do + if [ -x $P/$M ] + then + SMNT=$P/$M + break + fi + done +done + +[ -x $SMNT ] || exit 1 + +# Newer distributions get this right +SHOWMOUNT="$SMNT --no-headers -e $key" + +$SHOWMOUNT | LC_ALL=C sort -k 1 | \ + awk -v key="$key" -v opts="$opts" -- ' + BEGIN { ORS=""; first=1 } + { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } + END { if (!first) print "\n"; else exit 1 } + ' | sed 's/#/\\#/g' diff --git a/auto.smb b/auto.smb new file mode 100755 index 00000000..2dfb8f8a --- /dev/null +++ b/auto.smb @@ -0,0 +1,34 @@ +#!/bin/bash + +# This file must be executable to work! chmod 755! + +key="$1" +opts="-fstype=cifs" + +for P in /bin /sbin /usr/bin /usr/sbin +do + if [ -x $P/smbclient ] + then + SMBCLIENT=$P/smbclient + break + fi +done + +[ -x $SMBCLIENT ] || exit 1 + +$SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- ' + BEGIN { ORS=""; first=1 } + /Disk/ { + if (first) + print opts; first=0 + dir = $2 + loc = $2 + # Enclose mount dir and location in quotes + # Double quote "$" in location as it is special + gsub(/\$$/, "\\$", loc); + gsub(/\&/,"\\\\&",loc) + print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\"" + } + END { if (!first) print "\n"; else exit 1 } + ' + diff --git a/autofs/auto.master b/autofs/auto.master new file mode 100644 index 00000000..4b100012 --- /dev/null +++ b/autofs/auto.master @@ -0,0 +1,24 @@ +# $Id: autofs5-auto.master,v 1.1 2011/05/23 08:29:05 pva Exp $ +# Sample auto.master file +# This is an automounter map and it has the following format +# key [ -mount-options-separated-by-comma ] location +# For details of the format look at autofs(5). +# +#/misc /etc/autofs/auto.misc +#/net /etc/autofs/auto.net +# +# NOTE: mounts done from a hosts map will be mounted with the +# "nosuid" and "nodev" options unless the "suid" and "dev" +# options are explicitly given. +# +#/net -hosts +# +# Include central master map if it can be found using +# nsswitch sources. +# +# Note that if there are entries for /net or /misc (as +# above) in the included master map any keys that are the +# same will not be seen as the first read key seen takes +# precedence. +# +#+auto.master diff --git a/autofs_ldap_auth.conf b/autofs_ldap_auth.conf new file mode 100644 index 00000000..4033ba0d --- /dev/null +++ b/autofs_ldap_auth.conf @@ -0,0 +1,11 @@ + + + + diff --git a/conf.d/autofs b/conf.d/autofs new file mode 100644 index 00000000..491b3b0e --- /dev/null +++ b/conf.d/autofs @@ -0,0 +1,136 @@ +# +# Define default options for autofs. +# +# MASTER_MAP_NAME - default map name for the master map. +# +#MASTER_MAP_NAME="auto.master" +# +# TIMEOUT - set the default mount timeout (default 600). +# +TIMEOUT=300 +# +# NEGATIVE_TIMEOUT - set the default negative timeout for +# failed mount attempts (default 60). +# +#NEGATIVE_TIMEOUT=60 +# +# MOUNT_WAIT - time to wait for a response from umount(8). +# Setting this timeout can cause problems when +# mount would otherwise wait for a server that +# is temporarily unavailable, such as when it's +# restarting. The defailt of waiting for mount(8) +# usually results in a wait of around 3 minutes. +# +#MOUNT_WAIT=-1 +# +# UMOUNT_WAIT - time to wait for a response from umount(8). +# +#UMOUNT_WAIT=12 +# +# BROWSE_MODE - maps are browsable by default. +# +BROWSE_MODE="no" +# +# MOUNT_NFS_DEFAULT_PROTOCOL - specify the default protocol used by +# mount.nfs(8). Since we can't identify +# the default automatically we need to +# set it in our configuration. This will +# only make a difference for replicated +# map entries as availability probing isn't +# used for single host map entries. +# +#MOUNT_NFS_DEFAULT_PROTOCOL=3 +# +# APPEND_OPTIONS - append to global options instead of replace. +# +#APPEND_OPTIONS="yes" +# +# LOGGING - set default log level "none", "verbose" or "debug" +# +#LOGGING="none" +# +# Define server URIs +# +# LDAP_URI - space seperated list of server uris of the form +# ://[/] where can be ldap +# or ldaps. The option can be given multiple times. +# Map entries that include a server name override +# this option. +# +# This configuration option can also be used to +# request autofs lookup SRV RRs for a domain of +# the form :///[]. Note that a +# trailing "/" is not allowed when using this form. +# If the domain dn is not specified the dns domain +# name (if any) is used to construct the domain dn +# for the SRV RR lookup. The server list returned +# from an SRV RR lookup is refreshed according to +# the minimum ttl found in the SRV RR records or +# after one hour, whichever is less. +# +#LDAP_URI="" +# +# LDAP__TIMEOUT - timeout value for the synchronous API calls +# (default is LDAP library default). +# +#LDAP_TIMEOUT=-1 +# +# LDAP_NETWORK_TIMEOUT - set the network response timeout (default 8). +# +#LDAP_NETWORK_TIMEOUT=8 +# +# Define base dn for map dn lookup. +# +# SEARCH_BASE - base dn to use for searching for map search dn. +# Multiple entries can be given and they are checked +# in the order they occur here. +# +#SEARCH_BASE="" +# +# Define the LDAP schema to used for lookups +# +# If no schema is set autofs will check each of the schemas +# below in the order given to try and locate an appropriate +# basdn for lookups. If you want to minimize the number of +# queries to the server set the values here. +# +#MAP_OBJECT_CLASS="nisMap" +#ENTRY_OBJECT_CLASS="nisObject" +#MAP_ATTRIBUTE="nisMapName" +#ENTRY_ATTRIBUTE="cn" +#VALUE_ATTRIBUTE="nisMapEntry" +# +# Other common LDAP nameing +# +#MAP_OBJECT_CLASS="automountMap" +#ENTRY_OBJECT_CLASS="automount" +#MAP_ATTRIBUTE="ou" +#ENTRY_ATTRIBUTE="cn" +#VALUE_ATTRIBUTE="automountInformation" +# +#MAP_OBJECT_CLASS="automountMap" +#ENTRY_OBJECT_CLASS="automount" +#MAP_ATTRIBUTE="automountMapName" +#ENTRY_ATTRIBUTE="automountKey" +#VALUE_ATTRIBUTE="automountInformation" +# +# AUTH_CONF_FILE - set the default location for the SASL +# authentication configuration file. +# +#AUTH_CONF_FILE="/etc/autofs_ldap_auth.conf" +# +# MAP_HASH_TABLE_SIZE - set the map cache hash table size. +# Should be a power of 2 with a ratio roughly +# between 1:10 and 1:20 for each map. +# +#MAP_HASH_TABLE_SIZE=1024 +# +# General global options +# +# If the kernel supports using the autofs miscellanous device +# and you wish to use it you must set this configuration option +# to "yes" otherwise it will not be used. +USE_MISC_DEVICE="yes" +# +#OPTIONS="" +# diff --git a/init.d/autofs b/init.d/autofs new file mode 100755 index 00000000..bd3f14f0 --- /dev/null +++ b/init.d/autofs @@ -0,0 +1,70 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs5.initd,v 1.3 2011/10/05 14:27:26 pva Exp $ + +DAEMON=/usr/sbin/automount +PIDFILE=/var/run/autofs.pid +DEVICE=autofs + +depend() { + need localmount + use ypbind nfs slapd portmap net +} + +extra_started_commands="reload" + +start() { + ebegin "Starting automounter" + + # Ensure autofs support is loaded + grep -q autofs /proc/filesystems || modprobe -q autofs4 + if [ $? -ne 0 ]; then + eend 1 "No autofs support available in kernel" + return 1 + fi + + # Check misc device + if [ -n "${USE_MISC_DEVICE}" -a "${USE_MISC_DEVICE}" = "yes" ]; then + sleep 1 + if [ -e "/proc/misc" ]; then + MINOR=$(awk "/${DEVICE}/ {print \$1}" /proc/misc) + if [ -n "${MINOR}" -a ! -c "/dev/${DEVICE}" ]; then + mknod -m 0600 "/dev/${DEVICE}" c 10 ${MINOR} + if [ $? -ne 0 ]; then + eend 1 "Could not create '/dev/${DEVICE}'" + return 1 + fi + fi + fi + if [ -x /sbin/restorecon -a -c "/dev/${DEVICE}" ]; then + /sbin/restorecon "/dev/${DEVICE}" + if [ $? -ne 0 ]; then + eend 1 "Failed to execute '/sbin/restorecon \"/dev/${DEVICE}\"'" + return 1 + fi + fi + else + [ -c "/dev/${DEVICE}" ] && rm -rf "/dev/${DEVICE}" + fi + + start-stop-daemon --start --exec ${DAEMON} -- -p ${PIDFILE} ${OPTIONS} + + eend $? +} + +stop() { + ebegin "Stopping automounter" + start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} + eend $? +} + +reload() { + ebegin "Reloading automounter" + if [ ! -r "${PIDFILE}" ]; then + eend 1 "automount not running" + else + kill -HUP $(cat "${PIDFILE}") 2> /dev/null + eend $? + fi +} -- 2.39.5