Whamcloud - gitweb
LU-807 utils: remove old service tags support
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 31 Oct 2011 19:17:01 +0000 (13:17 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 20 Jan 2012 02:27:22 +0000 (21:27 -0500)
Remove obsolete and unused service tags infrastructure from the
build system and mount utilities.  This reverts the changes from:

    14765d2816bafa2a08879ece0e33bf8c97f84948
    805392ae4c4a4295d0f027234c83a670dfdc2268

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I1f2bd75dfd285fa1cebb5cb8eb4772cf2fc9ad7a
Reviewed-on: http://review.whamcloud.com/1634
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/autoconf/lustre-version.ac
lustre/doc/mount.lustre.8
lustre/include/lustre_ver.h.in
lustre/utils/mount_lustre.c
lustre/utils/mount_utils.c
lustre/utils/mount_utils.h

index 4b1308c..2f38b58 100644 (file)
@@ -3,12 +3,6 @@ m4_define([LUSTRE_MINOR],[1])
 m4_define([LUSTRE_PATCH],[54])
 m4_define([LUSTRE_FIX],[0])
 
 m4_define([LUSTRE_PATCH],[54])
 m4_define([LUSTRE_FIX],[0])
 
-dnl # don't forget to update the service tags info
-m4_define([CLIENT_URN],["LUSTRE-210-CLT"])
-m4_define([MDS_URN],["LUSTRE-210-MDS"])
-m4_define([MGS_URN],["LUSTRE-210-MGS"])
-m4_define([OSS_URN],["LUSTRE-210-OSS"])
-
 dnl # liblustre delta is 0.0.1.32 , next version with fixes is ok, but
 dnl # after following release candidate/beta would spill this warning already.
 m4_define([LUSTRE_VER_ALLOWED_OFFSET],["OBD_OCD_VERSION(0,0,1,32)"])
 dnl # liblustre delta is 0.0.1.32 , next version with fixes is ok, but
 dnl # after following release candidate/beta would spill this warning already.
 m4_define([LUSTRE_VER_ALLOWED_OFFSET],["OBD_OCD_VERSION(0,0,1,32)"])
@@ -30,10 +24,6 @@ m4_define([LUSTRE_VERSION],m4_if(LUSTRE_FIX,[0],LUSTRE_MAJOR.LUSTRE_MINOR.LUSTRE
 [AC_LUSTRE_VER_ALLOWED_OFFSET]=LUSTRE_VER_ALLOWED_OFFSET
 [AC_LUSTRE_LIB_VER_OFFSET_WARN]=LUSTRE_LIB_VER_OFFSET_WARN
 [AC_LUSTRE_CLI_VER_OFFSET_WARN]=LUSTRE_CLI_VER_OFFSET_WARN
 [AC_LUSTRE_VER_ALLOWED_OFFSET]=LUSTRE_VER_ALLOWED_OFFSET
 [AC_LUSTRE_LIB_VER_OFFSET_WARN]=LUSTRE_LIB_VER_OFFSET_WARN
 [AC_LUSTRE_CLI_VER_OFFSET_WARN]=LUSTRE_CLI_VER_OFFSET_WARN
-[AC_LUSTRE_CLIENT_URN]=CLIENT_URN
-[AC_LUSTRE_MGS_URN]=MGS_URN
-[AC_LUSTRE_MDS_URN]=MDS_URN
-[AC_LUSTRE_OSS_URN]=OSS_URN
 
 AC_SUBST([AC_LUSTRE_MAJOR])
 AC_SUBST([AC_LUSTRE_MINOR])
 
 AC_SUBST([AC_LUSTRE_MAJOR])
 AC_SUBST([AC_LUSTRE_MINOR])
@@ -43,7 +33,3 @@ AC_SUBST([AC_LUSTRE_VERSION_STRING])
 AC_SUBST([AC_LUSTRE_VER_ALLOWED_OFFSET])
 AC_SUBST([AC_LUSTRE_LIB_VER_OFFSET_WARN])
 AC_SUBST([AC_LUSTRE_CLI_VER_OFFSET_WARN])
 AC_SUBST([AC_LUSTRE_VER_ALLOWED_OFFSET])
 AC_SUBST([AC_LUSTRE_LIB_VER_OFFSET_WARN])
 AC_SUBST([AC_LUSTRE_CLI_VER_OFFSET_WARN])
-AC_SUBST([AC_LUSTRE_CLIENT_URN])
-AC_SUBST([AC_LUSTRE_MDS_URN])
-AC_SUBST([AC_LUSTRE_MGS_URN])
-AC_SUBST([AC_LUSTRE_OSS_URN])
index ea63a20..a09237c 100644 (file)
@@ -131,18 +131,6 @@ Start the Lustre metadata target service from /dev/sda1 on mountpoint /mnt/test/
 .B mount -t lustre -L testfs-MDT0000 -o abort_recov /mnt/test/mdt
 Start the testfs-MDT0000 service (by using the disk label), but abort the
 recovery process.
 .B mount -t lustre -L testfs-MDT0000 -o abort_recov /mnt/test/mdt
 Start the testfs-MDT0000 service (by using the disk label), but abort the
 recovery process.
-.SH NOTES
-If the Service Tags tool (from the sun-servicetag package) can be found in
-/opt/sun/servicetag/bin/stclient an inventory service tag will be created
-reflecting the Lustre service being provided.  If this tool cannot be found
-.B mount.lustre
-will silently ignore it and no service tag is created.  The
-.BR stclient (1)
-tool only creates the local service tag.  No information is sent to the asset
-management system until you run the Registration Client to collect the tags
-and then upload them to the inventory system using your inventory system account.
-See https://inventory.sun.com/ for more details on a web-based, free, IT asset
-management system.
 .SH BUGS
 Not very many mount options can be changed with
 .BR "-o remount" .
 .SH BUGS
 Not very many mount options can be changed with
 .BR "-o remount" .
index 1553f68..583447e 100644 (file)
@@ -9,10 +9,6 @@
 #define LUSTRE_PATCH @AC_LUSTRE_PATCH@
 #define LUSTRE_FIX @AC_LUSTRE_FIX@
 #define LUSTRE_VERSION_STRING "@AC_LUSTRE_VERSION_STRING@"
 #define LUSTRE_PATCH @AC_LUSTRE_PATCH@
 #define LUSTRE_FIX @AC_LUSTRE_FIX@
 #define LUSTRE_VERSION_STRING "@AC_LUSTRE_VERSION_STRING@"
-#define CLIENT_URN "@AC_LUSTRE_CLIENT_URN@"
-#define MDS_URN "@AC_LUSTRE_MDS_URN@"
-#define MGS_URN "@AC_LUSTRE_MGS_URN@"
-#define OSS_URN "@AC_LUSTRE_OSS_URN@"
 
 #define LUSTRE_VERSION_CODE OBD_OCD_VERSION(LUSTRE_MAJOR,LUSTRE_MINOR,LUSTRE_PATCH,LUSTRE_FIX)
 
 
 #define LUSTRE_VERSION_CODE OBD_OCD_VERSION(LUSTRE_MAJOR,LUSTRE_MINOR,LUSTRE_PATCH,LUSTRE_FIX)
 
index 00dd74e..b2f33a0 100644 (file)
@@ -726,8 +726,6 @@ int main(int argc, char *const argv[])
                                 argv[0], source);
         }
 
                                 argv[0], source);
         }
 
-        register_service_tags(usource, source, target);
-
         if (!fake) {
                 /* flags and target get to lustre_get_sb, but not
                    lustre_fill_super.  Lustre ignores the flags, but mount
         if (!fake) {
                 /* flags and target get to lustre_get_sb, but not
                    lustre_fill_super.  Lustre ignores the flags, but mount
index 1b06999..570fa54 100644 (file)
@@ -28,6 +28,7 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ * Copyright (c) 2012 Whamcloud, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -162,115 +163,3 @@ out_rmdir:
 
         return ret;
 }
 
         return ret;
 }
-
-#define PARENT_URN "urn:uuid:2bb5bdbf-6c4b-11dc-9b8e-080020a9ed93"
-#define PARENT_PRODUCT "Lustre"
-
-static int stclient(char *type, char *arch)
-{
-
-        char product[64];
-        char *urn = NULL;
-        char cmd[1024];
-        FILE *fp;
-        int i;
-
-        if (strcmp(type, "Client") == 0)
-                urn = CLIENT_URN;
-        else if (strcmp(type, "MDS") == 0)
-                urn = MDS_URN;
-        else if (strcmp(type, "MGS") == 0)
-                urn = MGS_URN;
-        else if (strcmp(type, "OSS") == 0)
-                urn = OSS_URN;
-
-        snprintf(product, 64, "Lustre %s %d.%d.%d", type, LUSTRE_MAJOR,
-                 LUSTRE_MINOR, LUSTRE_PATCH);
-
-        /* need to see if the entry exists first */
-        snprintf(cmd, 1024,
-                 "/opt/sun/servicetag/bin/stclient -f -t '%s' ", urn);
-        fp = popen(cmd, "r");
-        if (!fp) {
-                if (verbose)
-                        fprintf(stderr, "%s: trying to run stclient -f: %s\n",
-                                progname, strerror(errno));
-                return 0;
-        }
-
-        i = fread(cmd, 1, sizeof(cmd), fp);
-        if (i) {
-                cmd[i] = 0;
-                if (strcmp(cmd, "Record not found\n") != 0) {
-                        /* exists, just return */
-                        pclose(fp);
-                        return 0;
-                }
-        }
-        pclose(fp);
-
-        snprintf(cmd, 1024, "/opt/sun/servicetag/bin/stclient -a -p '%s' "
-                 "-e %d.%d.%d -t '%s' -S mount -F '%s' -P '%s' -m SUN "
-                 "-A %s -z global", product, LUSTRE_MAJOR, LUSTRE_MINOR,
-                 LUSTRE_PATCH, urn, PARENT_URN, PARENT_PRODUCT, arch);
-
-        return(run_command(cmd, sizeof(cmd)));
-}
-
-void register_service_tags(char *usource, char *source, char *target)
-{
-        struct lustre_disk_data mo_ldd;
-        struct utsname utsname_buf;
-        struct stat stat_buf;
-        char stclient_loc[] = "/opt/sun/servicetag/bin/stclient";
-        int rc;
-
-        rc = stat(stclient_loc, &stat_buf);
-
-        if (rc) {
-                if (errno != ENOENT && verbose) {
-                        fprintf(stderr,
-                                "%s: trying to stat stclient failed: %s\n",
-                                progname, strerror(errno));
-                }
-
-                return;
-        }
-
-        /* call service tags stclient to show Lustre is in use on this system */
-        rc = uname(&utsname_buf);
-        if (rc) {
-                if (verbose)
-                        fprintf(stderr,
-                                "%s: trying to get uname failed: %s, "
-                                "inventory tags will not be created\n",
-                                progname, strerror(errno));
-                return;
-        }
-
-        /* client or server? */
-        if (strchr(usource, ':')) {
-                stclient("Client", utsname_buf.machine);
-        } else {
-                /* first figure what type of device it is */
-                rc = get_mountdata(source, &mo_ldd);
-                if (rc) {
-                        if (verbose)
-                                fprintf(stderr,
-                                        "%s: trying to read mountdata from %s "
-                                        "failed: %s, inventory tags will not "
-                                        "be created\n",
-                                        progname, target, strerror(errno));
-                        return;
-                }
-
-                if (IS_MDT(&mo_ldd))
-                        stclient("MDS", utsname_buf.machine);
-
-                if (IS_MGS(&mo_ldd))
-                        stclient("MGS", utsname_buf.machine);
-
-                if (IS_OST(&mo_ldd))
-                        stclient("OSS", utsname_buf.machine);
-        }
-}
index b61ea1a..eb0cf7b 100644 (file)
@@ -42,6 +42,5 @@
 void fatal(void);
 int run_command(char *, int);
 int get_mountdata(char *, struct lustre_disk_data *);
 void fatal(void);
 int run_command(char *, int);
 int get_mountdata(char *, struct lustre_disk_data *);
-void register_service_tags(char *, char *, char *);
 
 #endif
 
 #endif