68{
69 const int AMode = S_IRWXU|S_IRGRP|S_IXGRP;
70 const char *endMsg = "completed.";
71 char *aPath;
72 int rc;
73 bool autoDis = false;
74
75
76
78
79
80
81 OfsEroute.
Say(
"++++++ Checkpoint initialization started.");
82
83
84
89 } else {
90 if (!(aPath = getenv("XRDADMINPATH")))
92 "Unable to determine adminpath for chkpnt files.");
93 return false;
94 }
96 }
97
98
99
102 return false;
103 }
104
105
106
107
108 if (!strncmp(
Path,
"/tmp/", 5))
110 "directory in '/tmp' is ill-advised!");
111 else autoDis = true;
112 }
113
114
115
117 XrdOucNSWalk::NSEnt *nsX, *nsP = nsWalk.Index(rc);
118 if (rc)
120 return false;
121 }
122
123
124
125 Stats stats;
126 while((nsX = nsP))
127 {Recover(nsX->
Path, stats);
129 delete nsX;
130 }
131
132
133
134 if (stats.numFiles)
135 {char mBuff[256];
136 snprintf(mBuff, sizeof(mBuff),
137 "%d of %d checkpoints restored, %d failed, and %d skipped.",
138 stats.numRecov, stats.numFiles, stats.numError, stats.numSkipd);
140 if (stats.numUnres)
141 {snprintf(mBuff, sizeof(mBuff), "%d", stats.numUnres);
142 OfsEroute.
Say(
"Config warning: ", mBuff,
" unresolved checkpoint "
143 "restore failures found!");
144 endMsg = "requires attention!";
145 }
146 }
147
148
149
150 if (autoDis)
151 {
OfsEroute.
Say(
"Config warning: checkpoints disabled because the "
152 "checkpoint directory is rooted in '/tmp'!");
154 }
155
156
157
158 OfsEroute.
Say(
"++++++ Checkpoint initialization ", endMsg);
159 return true;
160}
static char * genPath(const char *path, const char *inst, const char *psfx=0)
static const char * InstName(int TranOpt=0)
static int makePath(char *path, mode_t mode, bool reset=false)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)