|
46 | 46 | #include <readline/readline.h> |
47 | 47 | #include <readline/history.h> |
48 | 48 | #include <list> |
| 49 | +#include <sys/time.h> |
| 50 | +#include <sys/resource.h> |
49 | 51 | #include <XrdCl/XrdClPostMaster.hh> |
50 | 52 |
|
51 | 53 | #ifdef __APPLE__ |
@@ -92,6 +94,7 @@ extern int com_license(char*); |
92 | 94 | extern int com_ln(char*); |
93 | 95 | extern int com_ls(char*); |
94 | 96 | extern int com_map(char*); |
| 97 | +extern int com_mdcopy(char*); |
95 | 98 | extern int com_member(char*); |
96 | 99 | extern int com_mkdir(char*); |
97 | 100 | extern int com_motd(char*); |
@@ -136,7 +139,7 @@ extern int com_accounting(char*); |
136 | 139 | extern int com_quota(char*); |
137 | 140 | extern int com_daemon(char*); |
138 | 141 | extern int com_proto_sched(char*); |
139 | | - |
| 142 | +extern int com_zip(char*); |
140 | 143 |
|
141 | 144 | //------------------------------------------------------------------------------ |
142 | 145 | // Command mapping array |
@@ -184,6 +187,7 @@ COMMAND commands[] = { |
184 | 187 | { (char*) "ls", com_ls, (char*) "List a directory"}, |
185 | 188 | { (char*) "ln", com_ln, (char*) "Create a symbolic link"}, |
186 | 189 | { (char*) "map", com_map, (char*) "Path mapping interface"}, |
| 190 | + { (char*) "mdcopy", com_mdcopy, (char*) "Meta-data copy toole"}, |
187 | 191 | { (char*) "member", com_member, (char*) "Check Egroup membership"}, |
188 | 192 | { (char*) "mkdir", com_mkdir, (char*) "Create a directory"}, |
189 | 193 | { (char*) "motd", com_motd, (char*) "Message of the day"}, |
@@ -222,6 +226,7 @@ COMMAND commands[] = { |
222 | 226 | { (char*) "vid", com_vid, (char*) "Virtual ID System Configuration"}, |
223 | 227 | { (char*) "whoami", com_whoami, (char*) "Determine how we are mapped on server side"}, |
224 | 228 | { (char*) "who", com_who, (char*) "Statistics about connected users"}, |
| 229 | + { (char*) "zip", com_zip, (char*) "Remote Zip Tools"}, |
225 | 230 | { (char*) "?", com_help, (char*) "Synonym for 'help'"}, |
226 | 231 | { (char*) ".q", com_quit, (char*) "Exit from EOS console"}, |
227 | 232 | { (char*) 0, (int (*)(char*))0, (char*) 0} |
@@ -1164,6 +1169,19 @@ Run(int argc, char* argv[]) |
1164 | 1169 | execute_line((char*) "version"); |
1165 | 1170 | } |
1166 | 1171 |
|
| 1172 | +// bump up the filedescriptor limits |
| 1173 | + { |
| 1174 | + int fdlimit = 4096; |
| 1175 | + struct rlimit newrlimit; |
| 1176 | + newrlimit.rlim_cur = fdlimit; |
| 1177 | + newrlimit.rlim_max = fdlimit; |
| 1178 | + if ((setrlimit(RLIMIT_NOFILE, &newrlimit) != 0) && (!geteuid())) { |
| 1179 | + fprintf(stderr, "warning: unable to set fd limit to %d - errno %d\n", |
| 1180 | + fdlimit, errno); |
| 1181 | + } |
| 1182 | + } |
| 1183 | + |
| 1184 | + |
1167 | 1185 | char prompt[4096]; |
1168 | 1186 |
|
1169 | 1187 | if (pipemode) { |
@@ -1198,8 +1216,11 @@ Run(int argc, char* argv[]) |
1198 | 1216 | } |
1199 | 1217 |
|
1200 | 1218 | read_history(historyfile.c_str()); |
| 1219 | + |
1201 | 1220 | // load the last used current working directory |
1202 | | - read_pwdfile(); |
| 1221 | + if (interactive) { |
| 1222 | + read_pwdfile(); |
| 1223 | + } |
1203 | 1224 |
|
1204 | 1225 | // Loop reading and executing lines until the user quits. |
1205 | 1226 | for (; done == 0;) { |
@@ -1547,7 +1568,9 @@ bool RequiresMgm(const std::string& name, const std::string& args) |
1547 | 1568 | (name == "exit") || (name == "help") || (name == "json") || |
1548 | 1569 | (name == "pwd") || (name == "quit") || (name == "role") || |
1549 | 1570 | (name == "silent") || (name == "timing") || (name == "?") || |
1550 | | - (name == ".q") || (name == "daemon") || (name == "scitoken")) { |
| 1571 | + (name == ".q") || (name == "daemon") || (name == "scitoken") || |
| 1572 | + (name == "mdcopy")) |
| 1573 | + { |
1551 | 1574 | return false; |
1552 | 1575 | } |
1553 | 1576 |
|
|
0 commit comments