From b33e49c3f2cb18fd979ba385e32c15cfc8e7b1df Mon Sep 17 00:00:00 2001
From: Alan Malta Rodrigues <alan.malta@cern.ch>
Date: Thu, 1 Aug 2024 07:03:00 -0400
Subject: [PATCH] Ensure X509_USER_PROXY is set for MSUnmerged restarts

---
 docker/pypi/dmwm-base/manage | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/docker/pypi/dmwm-base/manage b/docker/pypi/dmwm-base/manage
index 9d42923b3..278a76ad5 100755
--- a/docker/pypi/dmwm-base/manage
+++ b/docker/pypi/dmwm-base/manage
@@ -36,6 +36,10 @@ export X509_USER_KEY=$AUTHDIR/dmwm-service-key.pem
 export X509_USER_CERT=$AUTHDIR/dmwm-service-cert.pem
 export REQMGR_CACHE_DIR=$STATEDIR
 export WMCORE_CACHE_DIR=$STATEDIR
+# MSUnmerged also needs to access a proxy with additional voms roles
+if [ -f $AUTHDIR/proxy.cert ]; then
+    export X509_USER_PROXY=$AUTHDIR/proxy.cert
+fi
 
 # by default Rucio relies on /opt/rucio/etc/config.cfg
 # if necessary we may setup RUCIO_HOME which should provide this location