From 75065db5f9f18efbb94200d6040ef7d423e774b4 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 19 Jun 2006 20:14:17 +0000 Subject: [PATCH] Branch b1_5 b=8007 r=adilger remove cruft in utils --- lustre/utils/Makefile.am | 15 +++--- lustre/utils/lactive | 120 ----------------------------------------------- lustre/utils/lfind | 9 ---- lustre/utils/lstripe | 9 ---- 4 files changed, 7 insertions(+), 146 deletions(-) delete mode 100644 lustre/utils/lactive delete mode 100755 lustre/utils/lfind delete mode 100755 lustre/utils/lstripe diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am index 697780f..cb7be32 100644 --- a/lustre/utils/Makefile.am +++ b/lustre/utils/Makefile.am @@ -6,19 +6,18 @@ AM_LDFLAGS := -L$(top_builddir)/lnet/utils LIBPTLCTL := $(top_builddir)/lnet/utils/libptlctl.a -sbin_scripts = llanalyze llstat.pl llobdstat.pl lactive lrun -bin_scripts = lfind lstripe +sbin_scripts = llstat.pl llobdstat.pl lrun if UTILS +noinst_PROGRAMS = mount_lustre mkfs_lustre tunefs_lustre \ + llog_reader wirecheck wiretest lload obdio obdbarrier # mount only finds helpers in /sbin rootsbin_PROGRAMS = mount.lustre -sbin_PROGRAMS = lctl obdio obdbarrier lload wirecheck wiretest \ - mount_lustre mkfs_lustre mkfs.lustre \ - tunefs_lustre tunefs.lustre l_getgroups llverfs llverdev -bin_PROGRAMS = lfs llog_reader +sbin_PROGRAMS = mkfs.lustre tunefs.lustre lctl \ + l_getgroups llverfs llverdev +bin_PROGRAMS = lfs lib_LIBRARIES = liblustreapi.a sbin_SCRIPTS = $(sbin_scripts) -bin_SCRIPTS = $(bin_scripts) endif # UTILS lctl_SOURCES = parser.c obd.c lustre_cfg.c lctl.c parser.h obdctl.h platform.h @@ -79,7 +78,7 @@ tunefs_lustre_CPPFLAGS = -DTUNEFS $(AM_CPPFLAGS) tunefs_lustre_LDADD := $(mkfs_lustre_LDADD) tunefs_lustre_DEPENDENCIES := $(mkfs_lustre_DEPENDENCIES) -EXTRA_DIST = $(bin_scripts) $(sbin_scripts) +EXTRA_DIST = $(sbin_scripts) # NOTE: this should only be run on i386. newwiretest: wirehdr.c wirecheck diff --git a/lustre/utils/lactive b/lustre/utils/lactive deleted file mode 100644 index 04841eb..0000000 --- a/lustre/utils/lactive +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (C) 2002 Cluster File Systems, Inc. -# Author: Robert Read -# This file is part of Lustre, http://www.lustre.org. -# -# Lustre is free software; you can redistribute it and/or -# modify it under the terms of version 2 of the GNU General Public -# License as published by the Free Software Foundation. -# -# Lustre is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Lustre; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -# For all the OST/MDSs that are primary on the --primary node, set -# them to be active on --active if that OST is available on --active. -# -# Make the active node the active node for all devices it shares with the -# old. The bulk of this code is for figuring out which devices to -# change, and what to change them to. - -# XXX add error checking -# XXX make this code less ugly - -import sys, getopt, types -import string, os -import ldap -from stat import S_IROTH, S_IRGRP -PYMOD_DIR = "/usr/lib/lustre/python" - -def development_mode(): - base = os.path.dirname(sys.argv[0]) - if os.access(base+"/Makefile.am", os.R_OK): - return 1 - return 0 - -if not development_mode(): - sys.path.append(PYMOD_DIR) - -import Lustre -PARAM = Lustre.Options.PARAM - -lactive_options = [ - ('ldapurl',"LDAP server URL", PARAM, "ldap://localhost"), - ('config', "Cluster config name used for LDAP query", PARAM), - ('group', "The group of devices to update", PARAM), - ('active', "The active node name", PARAM), - ('pwfile', "File containing password", PARAM), - ] - -def fatal(*args): - msg = string.join(map(str,args)) - print "! " + msg - sys.exit(1) - -cl = Lustre.Options("lactive","", lactive_options) -config, args = cl.parse(sys.argv[1:]) - -if not (config.group or config.active): - fatal("Must specify both group and active node.") - -if not config.config: - fatal("Missing config") - -if config.pwfile: - try: - pwperm = os.stat(config.pwfile)[0] - pwreadable = pwperm & (S_IRGRP | S_IROTH) - if pwreadable: - if pwreadable == (S_IRGRP | S_IROTH): - readable_by = "group and others" - elif pwreadable == S_IRGRP: - readable_by = "group" - else: - readable_by = "others" - print "WARNING: Password file %s is readable by %s" % ( - config.pwfile, readable_by) - - pwfile = open(config.pwfile, "r") - pw = string.strip(pwfile.readline()) - pwfile.close() - except Exception, e: - fatal("Can't read secret from pwfile %s: %s" % (config.pwfile, e)) -else: - print "no pwfile specified, binding anonymously" - pw = "" - -base = "config=%s,fs=lustre" % (config.config,) -db = Lustre.LustreDB_LDAP('', {}, base=base, pw = pw, url = config.ldapurl) - -active_node = db.lookup_name(config.active) -if not active_node: - fatal(config.active, "node not found in database.") - -devices = db.get_group(config.group) -if len(devices) < 0: - fatal("no devices found for group", config.group) - -# for all devices in group - # lookup device in active node - # update the active device -for tgtuuid in devices: - active_uuid = db.get_active_dev(tgtuuid) - new_active_uuid = active_node.get_tgt_dev(tgtuuid) - if active_uuid != new_active_uuid: - print ("%s: changing active %s to %s:%s" - % (tgtuuid, active_uuid, - config.active, new_active_uuid)) - db.update_active(tgtuuid, new_active_uuid) - - - - - diff --git a/lustre/utils/lfind b/lustre/utils/lfind deleted file mode 100755 index 552394e..0000000 --- a/lustre/utils/lfind +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -PATH=`dirname $0`:$PATH - -if [ $# -eq 0 ] || [ "$1" == "-h" -o "$1" == "--help" ]; then - lfs help find 2>&1 | sed "s/find/lfind/g" - exit 0 -fi - -lfs find "$@" diff --git a/lustre/utils/lstripe b/lustre/utils/lstripe deleted file mode 100755 index 03b2014..0000000 --- a/lustre/utils/lstripe +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -PATH=`dirname $0`:$PATH - -if [ $# -eq 0 ] || [ "$1" == "-h" -o "$1" == "--help" ]; then - lfs help setstripe 2>&1 | sed "s/setstripe/lstripe/g" - exit 0 -fi - -lfs setstripe "$@" -- 1.8.3.1