Skip to content
Snippets Groups Projects
Commit ee547388 authored by Mike Lake's avatar Mike Lake
Browse files

Added initial files

parent 0098760c
No related merge requests found
LICENSE 0 → 100644
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
# Installs the check_utilisation.py Python script and its dependencies.
# TODO This would be placed in /usr/local/bin so it can be run by users
# but it is still being worked on so its not installed for now.
#
# Usage: bash ./check_utilisation_install.sh
dest="/opt/eresearch"
# Check the public users database is up-to-date with the private one.
num1=$(echo 'select count(id) from users;' | sqlite3 users_ldap.db)
num2=$(echo 'select count(id) from users;' | sqlite3 users_ldap_public.db)
if [ $num1 -ne $num2 ]; then
echo "Number of users in each database does not match ($num1 & $num2) so updating public database..."
./users_ldap_public_create.sh
else
echo "Number of users in each database is the same."
fi
# Now do the install.
#mkdir -p ${dest}/pbs
#cp pbs/pbs.py ${dest}/pbs
#cp pbs/_pbs.so ${dest}/pbs
#cp pbs/pbsutils.py ${dest}/pbs
#cp check_utilisation.py ${dest}
#cp users_ldap_public.db ${dest}
#chmod ugo+x ${dest}/check_utilisation.py
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
# Uses the PBS files pbs_ifl.h and pbs.i to create pbs.py, pbs_wrap.c and _pbs.so.
conf="/etc/pbs.conf" # PBS configuration file
#############################
# Set your configuration here
#############################
# Example: If using my laptop.
PYTHON_INCL="/usr/include/python3.8"
# Example: If using Python in a virtual environment.
#PYTHON_INCL=/var/www/wsgi/virtualenvs/pbsweb/include/python3.8
SWIG_EXEC="/usr/bin/swig"
# You should not need to change anything below here.
# Make sure we have a PBS config file.
if [ ! -f $conf ]; then
echo "Error: missing PBS configuration file $conf"
exit 0
fi
# The PBS config file must be sourced to provide $PBS_EXEC.
. $conf
# Running swig creates pbs.py and pbs_wrap.c
$SWIG_EXEC -I$PBS_EXEC/include -python pbs.i
if [ $? -ne 0 ]; then
echo 'Error: You are probably missing the file: /opt/pbs/include/pbs_ifl.h'
exit 0
fi
# Running gcc creates _pbs.so
gcc -shared -fPIC -I$PYTHON_INCL -I$PBS_EXEC/include pbs_wrap.c $PBS_EXEC/lib/libpbs.a \
-o _pbs.so -L/lib -lcrypto -lssl
# It does not need to be executable.
chmod ugo-x _pbs.so
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment