Skip to content

Commit 6b58acf

Browse files
committed
Add/clean crontabs for VOCMS machines (kinit)
1 parent 6aed618 commit 6b58acf

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

deploy_dqmgui.sh

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,38 @@ check_dependencies() {
108108
echo "INFO: All required packages are installed"
109109
}
110110

111+
# Clean VOCMS-specific crontabs
112+
_clean_crontab_vocms() {
113+
FLAVOR="${SPECIAL_HOSTS[$HOST]}"
114+
if [ -z "$FLAVOR" ]; then
115+
echo "INFO: Not a vocms machine, not cleaning vocms crontabs"
116+
return
117+
fi
118+
crontab -l 2>/dev/null | grep -v "$INSTALLATION_DIR/current/config/admin/kinit.sh" | crontab -
119+
}
120+
111121
# Remove existing DQMGUI cronjobs
112122
clean_crontab() {
113123
# Filter cronjobs starting in $INSTALLATION_DIR/current/dqmgui and
114124
# replace crontabs
115125
crontab -l 2>/dev/null | grep -v "HOME=/tmp" | grep -v "$INSTALLATION_DIR/current/config/dqmgui" | grep -vE "$INSTALLATION_DIR/current.+logrotate.conf" | crontab -
116126
}
117127

128+
# Crontabs specific to VOCMS
129+
_install_crontab_vocms() {
130+
FLAVOR="${SPECIAL_HOSTS[$HOST]}"
131+
if [ -z "$FLAVOR" ]; then
132+
echo "INFO: Not a vocms machine, not installing vocms crontabs"
133+
return
134+
fi
135+
(
136+
crontab -l # Get existing crontabs
137+
# Adding kinit script for EOS
138+
echo "*/6 * * * * $INSTALLATION_DIR/current/config/admin/kinit.sh"
139+
echo "@reboot $INSTALLATION_DIR/current/config/admin/kinit.sh"
140+
) | crontab -
141+
}
142+
118143
# Install DQMGUI cronjobs
119144
install_crontab() {
120145
_create_logrotate_conf
@@ -125,11 +150,12 @@ install_crontab() {
125150
echo "HOME=/tmp" # Workaround for P5, where the home dir is an NFS mount and isn't immediately available.
126151
echo "@reboot (sleep 30 && $INSTALLATION_DIR/current/config/dqmgui/manage sysboot)"
127152
) | crontab -
153+
_install_crontab_vocms
128154
}
129155

130156
# Clean acrontabs for Offline/RelVal/Dev GUI
131157
clean_acrontab() {
132-
FLAVOR="${SPECIAL_HOSTS[$HOST]}" # TODO: Get flavor
158+
FLAVOR="${SPECIAL_HOSTS[$HOST]}"
133159
if [ -z "$FLAVOR" ]; then
134160
echo "INFO: Not a vocms machine, not cleaning acrontabs"
135161
return
@@ -306,8 +332,9 @@ extract_dmwm() {
306332

307333
install_dmwm() {
308334
# Move dqmgui-related scripts from DMWM to the config folder
309-
rm -rf "$INSTALLATION_DIR/$DMWM_GIT_TAG/config/dqmgui" # Cleanup dir if exists
310-
mv "$DMWM_TMP_DIR/dqmgui" "$INSTALLATION_DIR/$DMWM_GIT_TAG/config/dqmgui"
335+
rm -rf "$INSTALLATION_DIR/$DMWM_GIT_TAG/config/dqmgui" # Cleanup dir if exists
336+
mv "$DMWM_TMP_DIR/dqmgui" "$INSTALLATION_DIR/$DMWM_GIT_TAG/config/dqmgui" # DQMGUI Layouts
337+
mv "$DMWM_TMP_DIR/admin" "$INSTALLATION_DIR/$DMWM_GIT_TAG/config/admin" # Needed for kinit.sh
311338
rm -rf $DMWM_TMP_DIR
312339
}
313340

0 commit comments

Comments
 (0)