Skip to content
Snippets Groups Projects
Commit 5586cf82 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #7522: Moved DAL, casacore, QPID to /opt, added QPID to postinstall

parents 1be035b3 346ff86c
No related branches found
No related tags found
No related merge requests found
...@@ -4666,6 +4666,7 @@ SubSystems/LAPS_CEP/test/tBasicQueueTest.run eol=lf ...@@ -4666,6 +4666,7 @@ SubSystems/LAPS_CEP/test/tBasicQueueTest.run eol=lf
SubSystems/LAPS_CEP/test/tBasicQueueTest.sh eol=lf SubSystems/LAPS_CEP/test/tBasicQueueTest.sh eol=lf
SubSystems/LAPS_CEP/test/tExampleTest.run eol=lf SubSystems/LAPS_CEP/test/tExampleTest.run eol=lf
SubSystems/LAPS_CEP/test/tExampleTest.sh eol=lf SubSystems/LAPS_CEP/test/tExampleTest.sh eol=lf
SubSystems/Online_Cobalt/install/init.d-qpidd.sh eol=lf
SubSystems/Online_Cobalt/install/install_DAL.sh eol=lf SubSystems/Online_Cobalt/install/install_DAL.sh eol=lf
SubSystems/Online_Cobalt/install/install_IERS.sh eol=lf SubSystems/Online_Cobalt/install/install_IERS.sh eol=lf
SubSystems/Online_Cobalt/install/install_casacore.sh eol=lf SubSystems/Online_Cobalt/install/install_casacore.sh eol=lf
...@@ -4676,6 +4677,7 @@ SubSystems/Online_Cobalt/install/postinstall.sh eol=lf ...@@ -4676,6 +4677,7 @@ SubSystems/Online_Cobalt/install/postinstall.sh eol=lf
SubSystems/Online_Cobalt/install/postinstall_lofarbuild.sh eol=lf SubSystems/Online_Cobalt/install/postinstall_lofarbuild.sh eol=lf
SubSystems/Online_Cobalt/install/postinstall_lofarsys.sh eol=lf SubSystems/Online_Cobalt/install/postinstall_lofarsys.sh eol=lf
SubSystems/Online_Cobalt/install/postinstall_root.sh eol=lf SubSystems/Online_Cobalt/install/postinstall_root.sh eol=lf
SubSystems/Online_Cobalt/install/postinstall_root_final.sh eol=lf
SubSystems/Online_Cobalt/test/Beamformer/tCoherentStokes_3sec_2st_3sb.output/Beam_0.float.raw -text SubSystems/Online_Cobalt/test/Beamformer/tCoherentStokes_3sec_2st_3sb.output/Beam_0.float.raw -text
SubSystems/Online_Cobalt/test/Beamformer/tComplexVoltages_3sec_2st_3sb.output/Beam_0.float.raw -text SubSystems/Online_Cobalt/test/Beamformer/tComplexVoltages_3sec_2st_3sb.output/Beam_0.float.raw -text
SubSystems/Online_Cobalt/test/Beamformer/tComplexVoltages_3sec_2st_3sb.output/Beam_1.float.raw -text SubSystems/Online_Cobalt/test/Beamformer/tComplexVoltages_3sec_2st_3sb.output/Beam_1.float.raw -text
......
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Chkconfig: 2345 81 19
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
# Author: Foo Bar <peterzon@astron.nl>
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.
# Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
DAEMON=/opt/qpid/sbin/qpidd
DESC="QPID message broker daemon"
NAME="qpidd"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --oknodo --exec $DAEMON --chuid qpid:qpid -- -d --pid-dir /localhome/qpid --data-dir /localhome/qpid/.qpidd --config /opt/qpid/etc/qpid/qpidd.conf --auth no --log-to-file /localhome/qpid/qpid.log
return "$?"
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON --user qpid
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
# Many daemons don't delete their pidfiles when they exit.
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
#start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
# Note: if a new version is used, update: # Note: if a new version is used, update:
# lofarsys/bashrc (to use the new version in $PATH) # lofarsys/bashrc (to use the new version in $PATH)
# /CMake/variants/variants.cbm001 (to compile against the new version) # /CMake/variants/variants.cbm001 (to compile against the new version)
CASACORE_SOURCE="ftp://ftp.atnf.csiro.au/pub/software/casacore/casacore-1.7.0.tar.bz2"
#CASACORE_SOURCE="ftp://ftp.atnf.csiro.au/pub/software/casacore/casacore-1.7.0.tar.bz2"
CASACORE_SOURCE="https://github.com/casacore/casacore/archive/v2.0.1.tar.gz"
function strip_extensions { function strip_extensions {
# strip all extensions that are non-numeric # strip all extensions that are non-numeric
...@@ -24,21 +26,22 @@ echo "Configuring casacore..." ...@@ -24,21 +26,22 @@ echo "Configuring casacore..."
CASACOREDIR=`mktemp -d` CASACOREDIR=`mktemp -d`
pushd $CASACOREDIR >/dev/null pushd $CASACOREDIR >/dev/null
CASACOREVERSION=`basename "$CASACORE_SOURCE" | strip_extensions`
echo " Version is $CASACOREVERSION"
echo " Downloading..." echo " Downloading..."
wget -q -N --tries=3 $CASACORE_SOURCE wget -q -N --tries=3 "$CASACORE_SOURCE"
echo " Analyzing..."
TARBALL_FILENAME=`basename $CASACORE_SOURCE`
CASACORE_VERSION=`tar tf "$TARBALL_FILENAME" | head -n 1 | cut -d/ -f1`
echo " Version is $CASACORE_VERSION"
echo " Extracting..." echo " Extracting..."
tar xf `basename $CASACORE_SOURCE` tar xf "$TARBALL_FILENAME"
cd $CASACOREVERSION cd $CASACORE_VERSION
echo " Configuring..." echo " Configuring..."
mkdir build mkdir build
cd build cd build
# Note that the -DDATA_DIR option does not fully override the measures tables search paths. # Note that the -DDATA_DIR option does not fully override the measures tables search paths.
# In fact, some of ., ./data, $HOME/aips++/data, $HOME/data, $HOME/casacore/data are still searched first. # In fact, some of ., ./data, $HOME/aips++/data, $HOME/data, $HOME/casacore/data are still searched first.
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/$CASACOREVERSION \ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/$CASACORE_VERSION \
-DUSE_HDF5=ON -DUSE_FFTW3=ON -DFFTW3_DISABLE_THREADS=OFF \ -DUSE_HDF5=ON -DUSE_FFTW3=ON -DFFTW3_DISABLE_THREADS=OFF \
-DUSE_THREADS=ON -DUSE_OPENMP=ON \ -DUSE_THREADS=ON -DUSE_OPENMP=ON \
-DDATA_DIR=/localhome/lofar/IERS/current/data > cmake.log -DDATA_DIR=/localhome/lofar/IERS/current/data > cmake.log
...@@ -50,10 +53,10 @@ echo " Installing..." ...@@ -50,10 +53,10 @@ echo " Installing..."
make -j 8 install > make_install.log make -j 8 install > make_install.log
echo " Validating measures tables..." echo " Validating measures tables..."
/localhome/lofar/$CASACOREVERSION/bin/findmeastable >/dev/null /opt/$CASACORE_VERSION/bin/findmeastable >/dev/null
echo " Creating softlink /opt/casacore..." echo " Creating softlink /opt/casacore..."
ln -sfT /opt/$CASACOREVERSION /opt/casacore ln -sfT /opt/$CASACORE_VERSION /opt/casacore
echo " Cleaning up..." echo " Cleaning up..."
popd >/dev/null popd >/dev/null
......
#!/bin/bash -eu #!/bin/bash -eu
function error {
echo "$@" >&2
exit 1
}
sudo -n true >&/dev/null || error "Need to be root or have sudo rights active (run 'sudo true' first)." sudo -n true >&/dev/null || error "Need to be root or have sudo rights active (run 'sudo true' first)."
echo "[Postinstall as root]" echo "[Postinstall as root]"
sudo -u root ./postinstall_root sudo -u root ./postinstall_root.sh
echo "[Postinstall as lofarbuild]" echo "[Postinstall as lofarbuild]"
sudo -u lofarbuild ./postinstall_lofarbuild sudo -u lofarbuild ./postinstall_lofarbuild.sh
echo "[Postinstall as lofarsys]" echo "[Postinstall as lofarsys]"
sudo -u lofarsys ./postinstall_lofarsys sudo -u lofarsys ./postinstall_lofarsys.sh
echo "[Postinstall (final) as root]"
sudo -u root ./postinstall_root_final.sh
echo "[Done]" echo "[Done]"
#!/bin/bash -eu #!/bin/bash -eu
# NOTE: '~' may belong to a different user, due to intricacies of sudo.
# So use '~lofarsys' instead.
# ******************************************** # ********************************************
# Populate ~/.ssh directory # Populate ~/.ssh directory
# #
...@@ -7,7 +10,7 @@ ...@@ -7,7 +10,7 @@
# to stay in sync with the rest of LOFAR. # to stay in sync with the rest of LOFAR.
# ******************************************** # ********************************************
echo "Configuring ssh..." echo "Configuring ssh..."
cp -a /globalhome/lofarsystem/.ssh ~ cp -a /globalhome/lofarsystem/.ssh ~lofarsys
echo " Testing..." echo " Testing..."
ssh localhost true >/dev/null ssh localhost true >/dev/null
...@@ -16,8 +19,8 @@ ssh localhost true >/dev/null ...@@ -16,8 +19,8 @@ ssh localhost true >/dev/null
# Install bash initialisation scripts # Install bash initialisation scripts
# ******************************************** # ********************************************
echo "Configuring bash..." echo "Configuring bash..."
cp lofarsys/bashrc ~/.bashrc cp lofarsys/bashrc ~lofarsys/.bashrc
cp lofarsys/bash_profile ~/.bash_profile cp lofarsys/bash_profile ~lofarsys/.bash_profile
echo " Validating login..." echo " Validating login..."
ssh localhost true ssh localhost true
......
#!/bin/bash -eu #!/bin/bash -eu
echo "Giving /opt to lofarbuild..."
chown lofarbuild.lofarbuild /opt
#
# Casacore
#
echo "Removing system-supplied /opt/casacore..." echo "Removing system-supplied /opt/casacore..."
rm -rf /opt/casacore rm -rf /opt/casacore
echo "Giving /opt to lofarbuild..." #
chown lofarbuild.lofarbuild /opt # QPID
#
echo "Creating /data symlink..."
ln -sfT /localhome /data
echo "Creating qpid user..."
adduser qpid --system --home /localhome/qpid --disabled-password --disabled-login
mkdir -p /localhome/qpid
chown qpid.qpid /localhome/qpid
echo "Installing /etc/init.d/qpidd..."
cp init.d-qpidd.sh /etc/init.d/qpidd
update-rc.d qpidd defaults 95 15
#!/bin/bash -eu
echo "Starting qpid service..."
service qpidd start
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment