@@ -134,6 +134,59 @@ python_info () {
134
134
echo " ------"
135
135
}
136
136
137
+
138
+ cconfig_dump_systemd () {
139
+ local instance=" $1 "
140
+ local executable=" $2 "
141
+
142
+ local service=" ${executable} @${instance} .service"
143
+ local servicep=" ${executable} -privileged@${instance} .service"
144
+ local active
145
+ local activep
146
+ local enabled
147
+ local enabledp
148
+
149
+ [[ $( systemctl is-active " $service " ) == active ]] && active=1
150
+ [[ $( systemctl is-active " $servicep " ) == active ]] && activep=1
151
+ [[ $( systemctl is-enabled " $service " ) == enabled ]] && enabled=1
152
+ [[ $( systemctl is-enabled " $servicep " ) == enabled ]] && enabledp=1
153
+
154
+ if [[ ! ( $active || $activep || $enabled || $enabledp ) ]]; then
155
+ # This service is neither enabled nor active. Skip it; we don't care
156
+ return 0
157
+ fi
158
+
159
+ echo -n " ***** XRootD cconfig for executable $executable , instance $instance ("
160
+ if [[ $activep ]]; then
161
+ echo -n " active (privileged)"
162
+ elif [[ $active ]]; then
163
+ echo -n " active"
164
+ else
165
+ echo -n " inactive"
166
+ fi
167
+ echo -n " , "
168
+ if [[ $enabledp ]]; then
169
+ echo -n " enabled (privileged)"
170
+ elif [[ $enabled ]]; then
171
+ echo -n " enabled"
172
+ else
173
+ echo -n " disabled"
174
+ fi
175
+ echo " )"
176
+
177
+ if [[ $enabled && $enabledp ]]; then
178
+ echo " WARNING! Both $service and $servicep are enabled; this may result in conflicts"
179
+ fi
180
+ if [[ $active && $activep ]]; then
181
+ echo " WARNING! Both $service and $servicep are active; this may result in conflicts"
182
+ fi
183
+
184
+ cconfig -x " $executable " -h " $( hostname -f) " -n " $instance " -c " /etc/xrootd/xrootd-${instance} .cfg" 2>&1 \
185
+ | grep -v " ^Config continuing with file "
186
+ echo
187
+ }
188
+
189
+
137
190
dir=` pwd`
138
191
139
192
if [ ! -w $dir ]; then
@@ -223,6 +276,17 @@ if $rpm_install; then
223
276
dump_files_in_dir " /etc/osg/config.d"
224
277
fi
225
278
279
+ # XRootD cconfig dumps for available instances
280
+ if command -v cconfig & > /dev/null; then
281
+ for file in /etc/xrootd/xrootd-* .cfg
282
+ do
283
+ instance=${file#/ etc/ xrootd/ xrootd-}
284
+ instance=${instance% .cfg}
285
+
286
+ cconfig_dump_systemd " $instance " " xrootd"
287
+ cconfig_dump_systemd " $instance " " cmsd"
288
+ done
289
+ fi
226
290
echo " ***** Xrootd information:"
227
291
for file in /etc/xrootd/xrootd-* .cfg
228
292
do
0 commit comments