post-boot scripts

7 views
Skip to first unread message

Jeffery Lim

unread,
Jun 6, 2025, 4:34:43 PMJun 6
to cloudlab-users
Hello,

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. 

Thanks

Leigh Stoller

unread,
Jun 6, 2025, 5:30:42 PMJun 6
to cloudlab-users


> 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
Reply all
Reply to author
Forward
0 new messages