diff options
author | Christian Zoffoli <xmerlin@gentoo.org> | 2005-03-25 15:56:05 +0000 |
---|---|---|
committer | Christian Zoffoli <xmerlin@gentoo.org> | 2005-03-25 15:56:05 +0000 |
commit | 780da2ddcc5476a96af9f71784eb6011b3b90d04 (patch) | |
tree | 85da6eb1518076aa120ee262a5d58ea6d95dfdbb /sys-fs | |
parent | added pgadmin3-1.2.0 mask (diff) | |
download | gentoo-2-780da2ddcc5476a96af9f71784eb6011b3b90d04.tar.gz gentoo-2-780da2ddcc5476a96af9f71784eb6011b3b90d04.tar.bz2 gentoo-2-780da2ddcc5476a96af9f71784eb6011b3b90d04.zip |
added dynamic need in init script
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/gfs/ChangeLog | 6 | ||||
-rwxr-xr-x | sys-fs/gfs/files/gfs.rc | 42 | ||||
-rw-r--r-- | sys-fs/gfs/gfs-6.1_pre21.ebuild | 16 |
3 files changed, 32 insertions, 32 deletions
diff --git a/sys-fs/gfs/ChangeLog b/sys-fs/gfs/ChangeLog index 70cc1ccf11bd..8b8249227a8b 100644 --- a/sys-fs/gfs/ChangeLog +++ b/sys-fs/gfs/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-fs/gfs # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/ChangeLog,v 1.7 2005/03/25 02:19:14 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/ChangeLog,v 1.8 2005/03/25 15:56:05 xmerlin Exp $ + + 25 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/gfs.rc, + gfs-6.1_pre21.ebuild: + added dynamic need in init script 25 Mar 2005; Christian Zoffoli <xmerlin@gentoo.org> files/gfs.rc: improved init script diff --git a/sys-fs/gfs/files/gfs.rc b/sys-fs/gfs/files/gfs.rc index 07130d2b3531..d1045193ee5f 100755 --- a/sys-fs/gfs/files/gfs.rc +++ b/sys-fs/gfs/files/gfs.rc @@ -1,21 +1,35 @@ #!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/files/gfs.rc,v 1.4 2005/03/25 02:19:14 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/files/gfs.rc,v 1.5 2005/03/25 15:56:05 xmerlin Exp $ opts="${opts} mountall" depend() { - use dns logger - use net - after gnbd-client clvmd - need cluster-manager cluster-locking-manager fenced + local myneed="cluster-manager cluster-locking-manager fenced" + local devices="$(awk '!/^#/ && $3 == "gfs" && $4 !~ /noauto/ {print $1 }' /etc/fstab)" + + if [ -n "${devices}" ]; then + local device="" + for device in ${devices}; do + if [ -n "$(echo "${device}" | awk '$1 ~ /\/dev\/gnbd')" ]; then + myneed="${myneed} gnbd-client" + else + if [ -n "$(echo "${device}" | awk '$1 ~ /\/dev\/vg')" ]; then + myneed="${myneed} clvmd" + fi + fi + done + fi + + use dns logger net + need ${myneed} provide cluster } mount_gfs_filesystems() { local remaining="" - remaining="$(awk '!/^#/ && $3 ~ /gfs/ { if ($4 !~ "noauto") print $1 }' /etc/fstab)" + remaining="$(awk '!/^#/ && $3 == "gfs" { if ($4 !~ "noauto") print $1 }' /etc/fstab)" if [ -n "${remaining}" ]; then @@ -26,13 +40,7 @@ mount_gfs_filesystems() { if [ -b ${device} ]; then remaining_verified="${remaining_verified} ${device}" else - if [ $(echo "${device}" | awk '$1 ~ /\/dev\/gnbd/') ]; then - ewarn "Please start /etc/init.d/gnbd-client before trying to mount GNBDs devices" - else - if [ $(echo "${device}" | awk '$1 ~ /\/dev\/vg/') ]; then - ewarn "Please start /etc/init.d/clvmd before trying to mount LVM volumes" - fi - fi + ewarn "Block device ${device} not found!!" fi done @@ -40,8 +48,8 @@ mount_gfs_filesystems() { einfo "Mounting GFS filesystems" device="" for device in ${remaining_verified}; do - local target="$(awk '!/^#/ && $3 ~ /gfs/ { if ("$1" -eq "${device}" ) print $2 }' /etc/fstab)" - local mounted="$(awk '$3 ~ /gfs/ { if ("$1" -eq "${device}" ) print $2 }' /proc/mounts)" + local target="$(awk '!/^#/ && $3 == "gfs" { if ("$1" -eq "${device}" ) print $2 }' /etc/fstab)" + local mounted="$(awk '$3 == "gfs" { if ("$1" -eq "${device}" ) print $2 }' /proc/mounts)" # mount only filesystems not already mounted if [ -z "${mounted}" ]; then @@ -62,7 +70,7 @@ mount_gfs_filesystems() { umount_gfs_filesystems() { local sig retry - local remaining="$(awk '$3 ~ /gfs/ { print $2 }' /proc/mounts | sort -r)" + local remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)" if [ -n "${remaining}" ] then @@ -80,7 +88,7 @@ umount_gfs_filesystems() { umount ${remaining} &>/dev/null eend $? "Failed to unmount GFS filesystems" fi - remaining="$(awk '$3 ~ /gfs/ { if ($2 != "/") print $2 }' /proc/mounts | sort -r)" + remaining="$(awk '$3 == "gfs" { if ($2 != "/") print $2 }' /proc/mounts | sort -r)" [ -z "${remaining}" ] && break /bin/fuser -k -m ${sig} ${remaining} &>/dev/null sleep 5 diff --git a/sys-fs/gfs/gfs-6.1_pre21.ebuild b/sys-fs/gfs/gfs-6.1_pre21.ebuild index 032ff564a194..2a3996c8d813 100644 --- a/sys-fs/gfs/gfs-6.1_pre21.ebuild +++ b/sys-fs/gfs/gfs-6.1_pre21.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/gfs-6.1_pre21.ebuild,v 1.3 2005/03/22 13:59:10 xmerlin Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/gfs/gfs-6.1_pre21.ebuild,v 1.4 2005/03/25 15:56:05 xmerlin Exp $ inherit linux-mod @@ -46,18 +46,6 @@ src_compile() { src_install() { make DESTDIR=${D} install || die - exeinto /etc/init.d ; newexe ${FILESDIR}/gfs.rc gfs || die + newinitd ${FILESDIR}/${PN}.rc ${PN} || die } -pkg_postinst() { - einfo "This package is a container package for all the GFS related utils/libs." - einfo "For more info see the following URLs:" - einfo "http://sources.redhat.com/cluster/doc/usage.txt" - einfo "" - einfo "Run the following commands on cluster nodes to get everything going:" - einfo "hint: you need to actually set things up before you do this, see the first URL above" - einfo "# ccsd" - einfo "# cman_tool join" - einfo "# fence_tool join" - einfo "# mount -t gfs /dev/sdd1 /mnt/gfs ...." -} |