> On Jun 6, 2025, at 1:34 PM, 'Jeffery Lim' via cloudlab-users <
cloudla...@googlegroups.com> wrote:
>
> Is there a way to configure a post boot script to run under your user or will it always run under the geniuser? I'm looking to have a profile setup the node home directory with my repos before I ssh into it.
Hi. Here is an sh script fragment that will do what you want:
#!/bin/sh
SCRIPTNAME=$0
#
# Might not be on the local cluster, so need to use the urn to
# see who the actual creator is.
#
GENIUSER=`geni-get user_urn | awk -F+ '{print $4}'`
if [ $? -ne 0 ]; then
echo "ERROR: could not run geni-get user_urn!"
exit 1
fi
if [ $USER != $GENIUSER ]; then
sudo -u $GENIUSER $SCRIPTNAME
exit $?
fi