#!/bin/sh # This is a rudimentary script that for starting/stopping the cipres registry via the init # daemon on linux. Most of the work is done in the cipresctl script. This script # is a place where you can set env variables specific for your platform before invoking cipresctl. # Set CIPRES_USER to user the service should run as. Will su to this user. CIPRES_USER=cipresd # Set CIPRES_ROOT to the top of the cipres installation # export CIPRES_ROOT=/projects/cipres/terri/CIPRES-and-deps/cipres/build # Set CIPRES_USER_DIR to an existing directory where cipres can create tmp files, logfiles, etc. export CIPRES_USER_DIR=/Users/terri/cipres_user_dir # Source something to set the PATH correctly for running cipres. # We need to pick up the right version of java, python, etc. # source /projects/cipres/etc/build_cipres_vars.sh # These echo commands replace the two scripts user_propsvc.sh and user_registry.sh in # the cipres installation with versions that do nothing. The user running this # script must have write permission to the cipres installation directory. # # These scripts are replaced so that no additional instances of the services will # be started by accident. The cipres library launches the services if it can't # can't connect to them - which is the desired behavior when multiple users are # running cipres, but with a single user, there's no reason, and additional services # could be started accidentally if a process has trouble connecting for some reason (eg. timeout). # # The scripts only need to be replaced once, but this script does it everytime its invoked. # Better that than forgetting to do it at all (after a "make install"). # echo "#!/bin/sh" > $CIPRES_ROOT/bin/user_propsvc.sh echo "exit" >> $CIPRES_ROOT/bin/user_propsvc.sh echo "#!/bin/sh" > $CIPRES_ROOT/bin/user_registry.sh echo "exit" >> $CIPRES_ROOT/bin/user_registry.sh # su -m -c "$CIPRES_ROOT/bin/cipresctl $@" $CIPRES_USER sh -c "$CIPRES_ROOT/bin/cipresctl $@"