diff options
author | Stefaan De Roeck <stefaan@gentoo.org> | 2008-02-05 12:37:17 +0000 |
---|---|---|
committer | Stefaan De Roeck <stefaan@gentoo.org> | 2008-02-05 12:37:17 +0000 |
commit | c606348ca48476715bdb21721498022626d106a3 (patch) | |
tree | 21d17f243779ec12fc290a39137c1901584bc531 /net-fs/autofs | |
parent | Rename file in the tree, specify name in metadata (diff) | |
download | historical-c606348ca48476715bdb21721498022626d106a3.tar.gz historical-c606348ca48476715bdb21721498022626d106a3.tar.bz2 historical-c606348ca48476715bdb21721498022626d106a3.zip |
Fix bug #91104
Package-Manager: portage-2.1.4.1
Diffstat (limited to 'net-fs/autofs')
-rw-r--r-- | net-fs/autofs/ChangeLog | 8 | ||||
-rw-r--r-- | net-fs/autofs/Manifest | 4 | ||||
-rw-r--r-- | net-fs/autofs/autofs-4.1.3-r9.ebuild | 92 | ||||
-rw-r--r-- | net-fs/autofs/files/autofs.rc14 | 289 |
4 files changed, 391 insertions, 2 deletions
diff --git a/net-fs/autofs/ChangeLog b/net-fs/autofs/ChangeLog index 30d05ba64e9b..603c6dc15cab 100644 --- a/net-fs/autofs/ChangeLog +++ b/net-fs/autofs/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-fs/autofs # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.67 2008/02/05 12:32:19 stefaan Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/ChangeLog,v 1.68 2008/02/05 12:37:17 stefaan Exp $ + +*autofs-4.1.3-r9 (05 Feb 2008) + + 05 Feb 2008; Stefaan De Roeck <stefaan@gentoo.org> +files/autofs.rc14, + +autofs-4.1.3-r9.ebuild: + Fix bug #91104 05 Feb 2008; Stefaan De Roeck <stefaan@gentoo.org> +files/autofs5.rc1, -files/autofs.rc14, metadata.xml, autofs-5.0.3.ebuild, diff --git a/net-fs/autofs/Manifest b/net-fs/autofs/Manifest index 874567030dc4..5a9ccd66b1c4 100644 --- a/net-fs/autofs/Manifest +++ b/net-fs/autofs/Manifest @@ -8,6 +8,7 @@ AUX autofs.rc10 6373 RMD160 bbff8d48111f33a36afd4bf1628d7366a87478fd SHA1 957f37 AUX autofs.rc11 7469 RMD160 e8472a75e3804a83cdb31fb1a9e293a87492ba0b SHA1 be29dc822d5216bd40edf1067df04eb5b56455a1 SHA256 a050aff19d249598d789859fbfd01ac72d73a68f83d9edb96661aae76a5f5481 AUX autofs.rc12 7807 RMD160 bdd91c47ee5c223ca6eb7b395a4f82f36abd26f6 SHA1 a5efe6948c9674c4d2019db5e81de9d0a64ffaca SHA256 dc08949c2d47614be7fcea8be9988de52715b8072753ee3df77a87c19962975c AUX autofs.rc13 7876 RMD160 feb761b16f10e90ca55fc25a75b1ada9e79a83e2 SHA1 dadfdea84cf741ede50f5131433f88b09dd05f40 SHA256 d477a63305db5d0cc78e9f538cea745f733ae46305f71986c8a5abce1d2f0c56 +AUX autofs.rc14 7881 RMD160 f801010b880dca90ea76926880af928889b2fe38 SHA1 3d1cb7d1bd9b34035932452ea47dcd291ff7b0b4 SHA256 6d233d75882e93f2139b706df58eb4172dbac1ffe55dd1b4792492db97ab457d AUX autofs.rc6 3717 RMD160 9124279f8c70b0f4f9c4729a71469b178bd2395a SHA1 b17efbf35768395ea25c9ea4037d49c3eb61d4a2 SHA256 96ecff3e66a4364aaea5bdce7a33454b3315a04745cc5897208c33e749692016 AUX autofs.rc7 3624 RMD160 898c771eedbf52cbf856449370640873db7c4fd2 SHA1 f72e598317ba58fe6c9598547876e8dd60b9e007 SHA256 406a9025829c8485ef73400a76f678a6c1c87694241936db1dfae5241e751e5e AUX autofs.rc8 5186 RMD160 7a97786ecbca979a1b3aa754b6a638b580a9836d SHA1 f1f5b9837d176085c5e81bfe2321bdec15f90e74 SHA256 e9c094b03fec0a184800f750d79bf73ee6daf614c312b5c927110d8f2b0d1511 @@ -45,8 +46,9 @@ EBUILD autofs-4.1.3-r3.ebuild 2943 RMD160 bc1fc1e6c7cfc9ab082a43a95b3cf4339131f8 EBUILD autofs-4.1.3-r4.ebuild 2973 RMD160 146a44b68bd42a8309518c8fef23d2c40c3600bf SHA1 c1ad210418c282a8bb4d85df2329e123b16d8890 SHA256 9982a084f4083e5e484895c1852e38757a8eb47046f3e0e6efa8a09088fdd232 EBUILD autofs-4.1.3-r7.ebuild 3003 RMD160 159090b532fc72917d101f0fea4c02409663ba97 SHA1 6c77e3143816d1234cb884a03cda22b92cd0d266 SHA256 22870b6945cbc8fe00d80986c9b6a96f0c14e79bbb41381009d791676f8f61fc EBUILD autofs-4.1.3-r8.ebuild 3116 RMD160 abd6391c3eaa8145db089e1d6b9ade45d0717fc7 SHA1 a43fcb2534f7424fc4c8fd291076a25a335234f3 SHA256 23bf695145bf8570d6296cb5788e6a6ac05721507bfd80ba54c987e521508bea +EBUILD autofs-4.1.3-r9.ebuild 3116 RMD160 17db10c7bfb0b148416703824ce944aa2901f7cd SHA1 31e766a73bf684002b49988aafd390c78d4727a8 SHA256 f74fd79aae054c8eb759370d0e3ac0a41675784f46cabc1db425429a66851461 EBUILD autofs-4.1.3.ebuild 1923 RMD160 eaab58530b774637b8b3ae8600a99e17eb31c0ca SHA1 cace6b8fae4c228c99b278a84e0889ce51c23a13 SHA256 655ab0f95d4d71fb37788ef6bd35c1cca0abd8b2714d67cbb26837c8477d95f7 EBUILD autofs-5.0.3-r1.ebuild 2252 RMD160 769805c5ff06c8acc6dde7e60d9c365058271a82 SHA1 da7f063ee957643b8e0d91a7432d64160c6cbddd SHA256 727d68be090f5eb1646798e45b897f0e951ea2699118838e7d4140a24d00821e EBUILD autofs-5.0.3.ebuild 1635 RMD160 3b0d5e7c5100f60e7d6da903000142e676dce338 SHA1 e4d85cdbbbc89daec1e536fda5f9b6faf4ddf95f SHA256 a5839d8964101cec67d5ec3e70870122acab999906db3d65c40a0ea9ab77604c -MISC ChangeLog 9922 RMD160 a0095608de41d8cb5c6b60188b3a8e443f5bb619 SHA1 a1dc6f04a7ed3a099971ee7d6691fa75ab692e95 SHA256 e22de49f8e4f7b2e405784c0fccd9c4489d8c8990cf302c50f29c7e8baa4fb88 +MISC ChangeLog 10072 RMD160 dd822c94d1e7bd4fc59ca8ce3e527ea7999bff59 SHA1 b977f3a9570cd303b81369665d36caae17e31371 SHA256 1e949686f3cd28e95c30fed11c36607c5ebb011e646683e16d823971231790f6 MISC metadata.xml 258 RMD160 3e5f58364805d3e42d35bb18afabc84771edc6e3 SHA1 f889879c2dfdef80624ebebd791c1b944ff859ae SHA256 3a3251d51801f0288687f235aed354e0f68cb6f90775941ba03b83bfd71e5dae diff --git a/net-fs/autofs/autofs-4.1.3-r9.ebuild b/net-fs/autofs/autofs-4.1.3-r9.ebuild new file mode 100644 index 000000000000..a4d823670acc --- /dev/null +++ b/net-fs/autofs/autofs-4.1.3-r9.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/autofs-4.1.3-r9.ebuild,v 1.1 2008/02/05 12:37:17 stefaan Exp $ + +inherit eutils multilib + +IUSE="ldap" +DESCRIPTION="Kernel based automounter" +HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html" +SRC_URI_BASE="mirror://kernel/linux/daemons/${PN}/v4" +SRC_URI="${SRC_URI_BASE}/${P}.tar.bz2 + ${SRC_URI_BASE}/${P}-strict.patch + ${SRC_URI_BASE}/${P}-mtab_lock.patch + ${SRC_URI_BASE}/${P}-bad_chdir.patch + ${SRC_URI_BASE}/${P}-non_block_ping.patch + ${SRC_URI_BASE}/${P}-sock-leak-fix.patch + ${SRC_URI_BASE}/${P}-replicated_server_select.patch + mirror://gentoo/${P}-miscfixes.patch.gz" +DEPEND="virtual/libc + ldap? ( >=net-nds/openldap-2.0 )" +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" + +src_unpack() { + unpack ${P}.tar.bz2 + PATCH_LIST="${P}-strict.patch ${P}-mtab_lock.patch ${P}-bad_chdir.patch ${P}-non_block_ping.patch ${P}-sock-leak-fix.patch ${P}-replicated_server_select.patch ${P}-miscfixes.patch.gz" + for i in ${PATCH_LIST}; do + EPATCH_OPTS="-p1 -d ${S}" epatch ${DISTDIR}/${i} + done + + # Upstream version of this patch is incorrect + epatch "${FILESDIR}"/${P}-signal-race-fix.patch + + cd "${S}" + autoconf || die "Autoconf failed" + + cd "${S}"/daemon + sed -i 's/LIBS \= \-ldl/LIBS \= \-ldl \-lnsl \$\{LIBLDAP\}/' Makefile \ + || die "LIBLDAP change failed" + + cd "${S}"/lib + sed -i '/^listmount.o:/s,$, mount.h,g' Makefile \ + || die "Failed to fix dependancies" +} + +src_compile() { + local myconf + use ldap || myconf="--without-openldap" + + econf ${myconf} || die + sed -i -e '/^\(CFLAGS\|CXXFLAGS\|LDFLAGS\)[[:space:]]*=/d' Makefile.rules || die "Failed to remove (C|CXX|LD)FLAGS" + # fixes segfaults on startup on amd64 + use amd64 && CFLAGS="${CFLAGS} -DLDAP_DEPRECATED" + emake || die "make failed" +} + +src_install() { + into /usr + dosbin daemon/automount + exeinto /usr/$(get_libdir)/autofs + doexe modules/*.so + + dodoc COPYRIGHT NEWS README* TODO CHANGELOG CREDITS + cd "${S}"/samples + docinto samples ; dodoc auto.misc auto.master + cd "${S}"/man + sed -i 's:\/etc\/:\/etc\/autofs\/:g' *.8 *.5 *.in || die "Failed to update path in manpages" + doman auto.master.5 autofs.5 autofs.8 automount.8 + + insinto /etc/autofs ; doins "${FILESDIR}"/auto.master + insinto /etc/autofs ; doins "${FILESDIR}"/auto.misc + exeinto /etc/autofs ; doexe "${FILESDIR}"/auto.net # chmod 755 is important! + + newinitd "${FILESDIR}"/autofs.rc14 autofs + newconfd "${FILESDIR}"/autofs.confd9 autofs + if use ldap; then + cd "${S}"/samples + docinto samples ; dodoc ldap* auto.master.ldap + insinto /etc/openldap/schema ; doins autofs.schema + exeinto /usr/$(get_libdir)/autofs ; doexe autofs-ldap-auto-master + fi +} + +pkg_postinst() { + elog "Note: If you plan on using autofs for automounting" + elog "remote NFS mounts without having the NFS daemon running" + elog "please add portmap to your default run-level." + elog + elog "Also the normal autofs status has been renamed stats" + elog "as there is already a predefined Gentoo status" +} diff --git a/net-fs/autofs/files/autofs.rc14 b/net-fs/autofs/files/autofs.rc14 new file mode 100644 index 000000000000..37942c2710d2 --- /dev/null +++ b/net-fs/autofs/files/autofs.rc14 @@ -0,0 +1,289 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/autofs/files/autofs.rc14,v 1.3 2008/02/05 12:37:17 stefaan Exp $ + +# rc file for automount using a Sun-style "master map". +# We first look for a local /etc/autofs/auto.master, then a YP +# map with that name + +DAEMON=/usr/sbin/automount +SYSCONFDIR=/etc/autofs + +depend() { + need localmount + use ypbind nfs slapd portmap net +} + +opts="start stop status stats reload restart" + +# this file is used to avoid the subshell-die problem +TMPSRC=/var/run/autofs.tmp + +# +# Check for all maps that are to be loaded +# +function getschemes() { + schemes="$(awk '/^automount:/{ $1="" ; gsub("\\[.*\\]","") ; print $0 }' /etc/nsswitch.conf)" + # have a default entry + [ -z "$schemes" ] && echo 'files' || echo $schemes +} + +function getfilemounts() { + if [ -f /etc/autofs/auto.master ] ; then + sed -e '/^#/d' -e '/^$/d' < /etc/autofs/auto.master + fi +} + +function catnismap() { + [ -z "$1" ] && map="auto_master" || map="$1" + /usr/bin/ypcat -k ${map} 2> /dev/null | sed -e '/^#/d' -e '/^$/d' +} + +function getnismounts() { + YPMAP="$(catnismap auto.master)" + if [ -z "$YPMAP" ]; then + catnismap + else + catnismap auto.master + fi +} + +function getldapmounts() { + autofs_lam=/usr/lib/autofs/autofs-ldap-auto-master + if [ -f $autofs_lam -a -x $autofs_lam ]; then + ${autofs_lam} \ + -m ${ldap_map_oc} -e ${ldap_entry_oc} \ + -n ${ldap_map_key} -k ${ldap_entry_key} \ + -v ${ldap_value} 2> /dev/null + fi +} + +function getrawmounts() +{ + for scheme in `getschemes` ; do + case "$scheme" in + files) + getfilemounts + ;; + nis*) + getnismounts + ;; + ldap*) + getldapmounts + ;; + esac + done +} + + +# +# This function will build a list of automount commands to execute in +# order to activate all the mount points. It is used to figure out +# the difference of automount points in case of a reload +# +function getmounts() +{ + knownmaps=" " + # seperate storage variable to avoid clobbering the other $TMPSRC + TMPSRC_mounts="$TMPSRC.mounts" + getrawmounts >$TMPSRC_mounts + while read dir map options + do + # These checks screen out duplicates and skip over directories + # where the map is '-'. + if [ ! -z "$dir" -a ! -z "$map" \ + -a "x${map:0:1}" != "x-" \ + -a "`echo "$knownmaps" | grep -w $dir/`" = "" ]; then + # If the options include a -t or --timeout parameter, then + # pull those particular options out. + # echo DAEMONOPTIONS OPTIONS $daemonoptions $options + startupoptions="" + opt_timeout="" + opt_pidfile="" + opt_verbose="" + opt_debug="" + opt_ghost="" + + # use getopt to parse all of it + #getopteval="$(getopt -q -o -t:p:vdg --long timeout:,pid-file:,verbose,debug,ghost -- "$daemonoptions $options") " + getopt_input="$daemonoptions ${options/-/}" + getopt_eval="$(getopt -q -o -t:vdg --long timeout:,verbose,debug,ghost -- $getopt_input) " + eval set -- "${getopt_eval}" + while [ -n "$1" ]; do + #-p|--pid-file) opt_pidfile="$2" ; shift 2 ;; + case $1 in + -t|--timeout) opt_timeout="$2" ; shift 2 ;; + -v|--verbose) opt_verbose="--verbose" ; shift ;; + -d|--debug) opt_debug="--debug" ; shift ;; + -g|--ghost) opt_ghost="--ghost" ; shift ;; + --) shift ; break ;; + *) shift ;; # just ignore other params for now + esac + done + # build the parameters + [ -n "${opt_timeout}" ] && startupoptions="${startupoptions} --timeout ${opt_timeout}" + #[ -n "${opt_pidfile}" ] && startupoptions="${startupoptions} --pid-file ${opt_pidfile}" + startupoptions="${startupoptions} ${opt_ghost} ${opt_verbose} ${opt_debug}" + + # Other option flags are intended for maps. + # unfortuntely this can't be integrated with the above getopt(1) + mapoptions="$(echo $daemonoptions $options | sed \ + -e '/-t/{s/--*t\(imeout\)*[[:space:]=]*\([0-9][0-9]*\)//g }' \ + -e '/-v/{s/--*v\(erbose\)*//g }' \ + -e '/-d/{s/--*d\(ebug\)*//g }' \ + -e '/-g/{s/--*g\(host\)*//g }' \ + -e 's/^[[:space:]]*//g' \ + -e 's/[[:space:]]*$//g')" + #-e '/-p/{s/--*p\(id-file\)*[[:space:]=]*\([^[:space:]]*\)//g }' \ + + # Break up the maptype and map, if the map type is specified + maptype="${map/:*}" + # Handle degenerate map specifiers + if [ "$maptype" = "$map" ] ; then + if [ -x "$map" ]; then + maptype="program" + elif [ -x "/etc/$map" ]; then + maptype="program" + map="/etc/$map" + map="${map//\/\//\/}" # strip doubles + elif [ -f "$map" ]; then + maptype="file" + elif [ -f "/etc/$map" ]; then + maptype="file" + map="/etc/$map" + map="${map//\/\//\/}" # strip doubles + elif [ "$map" = "hesiod" -o "$map" = "userhome" ] ; then + maptype="$map" + map= + elif [ "$map" = "multi" ] ; then + maptype="$map" + map= + else + maptype=yp + map="${map/*\/}" # same as "basename $map" + map="${map/#auto_/auto.}" # echo $map | sed -e 's/^auto_home/auto.home/' -e 's/^auto_mnt/auto.mnt/' + fi + fi + map="${map#*:}" + + #echo >>/tmp/debug + #date >>/tmp/debug + #echo STARTUPOPTIONS $startupoptions >> /tmp/debug + #echo DIR $dir >> /tmp/debug + #echo MAPTYPE $maptype >> /tmp/debug + #echo MAP $map >> /tmp/debug + #echo MAPOPTIONS $mapoptions >> /tmp/debug + #echo LOCALOPTIONS $localoptions >> /tmp/debug + #echo OPTIONS $options >>/tmp/debug + #echo GETOPT_INPUT $getopt_input >>/tmp/debug + + [ -z "${startupoptions}" ] && startupoptions=" " # to make life easier later + # protect startupoptions with _X_ to use it later + cmdline="$DAEMON ${startupoptions// /_X_} $dir $maptype $map ${mapoptions} ${localoptions}" + # leave out the " so that white space gets compressed + echo ${cmdline} + + # echo ------------------------ + fi + knownmaps=" $dir/ $knownmaps" + done <$TMPSRC_mounts + rm -f $TMPSRC_mounts +} + + +start() { + ebegin "Starting automounter" + # ensure autofs support is loaded + grep -q autofs /proc/filesystems || modprobe -q autofs4 || modprobe -q autofs + if [ $? -ne 0 ]; then + eend 1 "No autofs support available" + return 1 + fi + + getmounts >$TMPSRC + + # Check that maps exist + if [ ! -s $TMPSRC ]; then + eend 1 "No automount maps defined" + return 1 + fi + + while read cmd startupopts mnt rest ; do + pidfile=/var/run/autofs${mnt//\//.}.pid + startupopts="$(echo ${startupopts//_X_/ } --pid-file ${pidfile} )" + bin="/usr/sbin/automount" + params="$(echo $startupopts $mnt $rest)" + + echo -n " $mnt" + #echo " $mnt ($params)" + + start-stop-daemon --start --pidfile $pidfile --quiet \ + --exec ${bin} -- ${params} + #ps ax | grep "[0-9]:[0-9][0-9] ${bin} ${params}" | ( + # read pid rest + # echo $pid > $pidfile + # echo "$mnt $rest" >> $pidfile + #) + # Omitted these five lines, see http://bugs.gentoo.org/110887 + #if [ $? -ne 0 ]; then + # eerror "Failure on $mnt" + #else + # echo "${params}" >> $pidfile + #fi + done < $TMPSRC + # clean up + rm -f $TMPSRC + + echo + + eend $? +} + +stop() { + ebegin "Stopping automounter" + start-stop-daemon --stop --quiet --signal USR2 --exec /usr/sbin/automount + eend $? +} + +stats() { + echo "Configured Mount Points:" + echo "------------------------" + getmounts >$TMPSRC + while read cmd startupopts mnt rest ; do + pidfile=/var/run/autofs${mnt//\//.}.pid + startupopts="$(echo ${startupopts//_X_/ } --pid-file ${pidfile} )" + params="$(echo $startupopts $mnt $rest)" + echo $cmd $params + done <$TMPSRC + rm -f $TMPSRC + echo "" + echo "Active Mount Points:" + echo "--------------------" + ps ax|grep "[0-9]:[0-9][0-9] /usr/sbin/automount " | ( + while read pid tt stat time command; do echo $command; done + ) +} + +reload() { + echo "Reloading automounter: checking for changes ... " + getmounts >$TMPSRC + for i in /var/run/autofs.*.pid + do + pid=`head -n 1 $i 2>/dev/null` + [ -z "$pid" ] && continue + command=`tail -n +2 $i` + if ! grep -q "^$command" $TMPSRC + then + echo "Stopping automounter: $command" + kill -USR2 $pid + fi + done + rm -f $TMPSRC + svc_start +} + +restart() { + svc_stop + svc_start +} |