Skip to content
Snippets Groups Projects
Commit 76015a41 authored by Steven Murray's avatar Steven Murray
Browse files

bug #102815: RFE: Remove the tprstat command from CASTOR

Fixed in the master branch.
parent 3367608b
Branches
Tags
No related merge requests found
%attr(6755,root,root) usr/bin/smc
%attr(0755,root,root) usr/bin/tpconfig
%attr(0755,root,root) usr/bin/tprstat
%attr(0755,root,root) usr/bin/tpstat
debian/castor/usr/share/man/man1/smc.1castor.gz
debian/castor/usr/share/man/man1/tprstat.1castor.gz
debian/castor/usr/share/man/man1/tpstat.1castor.gz
debian/castor/usr/share/man/man1/tpconfig.1castor.gz
......@@ -78,10 +78,8 @@ CLIENTLIBMANPAGE(wrttpmrk)
TAPELIB = DepSharedLibraryTargetName(tape,castortape)
TapeProgramTarget(tpconfig,tpconfig.o,$(TAPELIB),$(TAPELIB),755)
TapeProgramTarget(tprstat,tprstat.o,$(TAPELIB),$(TAPELIB),755)
TapeProgramTarget(tpstat,tpstat.o,$(TAPELIB),$(TAPELIB),755)
EXEMANPAGE(tpconfig)
EXEMANPAGE(tprstat)
EXEMANPAGE(tpstat)
TapeMakeDir($(LOGPATH),0755)
......
/*
* Copyright (C) 1990-2000 by CERN/IT/PDP/DM
* All rights reserved
*/
/* tprstat - resource reservation status display */
#include <stdio.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "Ctape_api.h"
#define MAXDGP 4
#define MAXJOBS 64
void usage(char *cmd)
{
fprintf (stderr, "usage: %s [hostname]\n", cmd);
}
int main(int argc,
char **argv)
{
int c, i, j;
struct rsv_status rsv_status[MAXJOBS];
char hostname[CA_MAXHOSTNAMELEN+1];
char jobid[11];
char name[CA_MAXUSRNAMELEN+1];
int nbdgp = MAXDGP;
int nbentries = MAXJOBS;
struct passwd *pwd;
if (argc > 2) {
usage (argv[0]);
exit (USERR);
}
if (argc == 2)
strcpy (hostname, argv[1]);
else
gethostname (hostname, sizeof(hostname));
/* allocate dgn_rsv_status structures */
for (i = 0; i < MAXJOBS; i++) {
if ((rsv_status[i].dg = calloc (MAXDGP, sizeof(struct dgn_rsv_status))) == NULL) {
perror ("tprstat");
exit (SYERR);
}
}
c = Ctape_rstatus (hostname, rsv_status, nbentries, nbdgp);
if (c > 0) {
printf ("userid jid dgn rsvd used\n");
for (i = 0; i < c; i++) {
if (i == 0)
strcpy (name, "taped");
else {
if ((pwd = getpwuid (rsv_status[i].uid)) == NULL) {
sprintf (name, "%d", rsv_status[i].uid);
} else {
strcpy (name, pwd->pw_name);
}
}
sprintf (jobid, "%d", rsv_status[i].jid);
for (j = 0; j < rsv_status[i].count; j++) {
if (j) {
name[0] = '\0';
jobid[0] = '\0';
}
printf ("%-8s %6s %-8s %4d %4d\n",
name, jobid, rsv_status[i].dg[j].name,
rsv_status[i].dg[j].rsvd,
rsv_status[i].dg[j].used);
}
}
}
exit (c > 0 ? 0 : SYERR);
}
.\" Copyright (C) 1990-2000 by CERN/IT/PDP/DM
.\" All rights reserved
.\"
.TH TPRSTAT 1 "$Date: 2009/07/23 12:22:05 $" CASTOR "Ctape User Commands"
.SH NAME
tprstat \- give the device group reservations for all tape users on a given server
.SH SYNOPSIS
.B tprstat
.RB [ hostname ]
.SH DESCRIPTION
.B tprstat
gives the device group reservations for all tape users on a given server in
tabular form: one line per device group per user.
.HP
userid user login name. The tape daemon entry gives a summary
for the complete system.
.HP
jid process id of the user login shell. It is equal to the
process group id for the Bourne shell.
.HP
dgn device group name.
.HP
rsvd number of units reserved in this device group. The
tape daemon entry gives the number of units configured.
.HP
used number of units allocated in this device group.
.SH EXIT STATUS
This program returns 0 if the operation was successful or >0 if the operation
failed.
.SH SEE ALSO
.B Ctape_rstatus(3)
.SH AUTHOR
\fBCASTOR\fP Team <castor.support@cern.ch>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment