# as much as possible, requires should go in the subpackages specfile
Requires: redhat-lsb
Requires: bzip2
-Requires: tar
+Requires: tar
Requires: less
Requires: sendmail
Requires: sendmail-cf
%else
Requires: mod_python
%endif
+%endif
Requires: nodeimage-%{nodefamily}
Requires: myplc-docs
Requires: myplc-release
%define debug_package %{nil}
-%description
+%description
MyPLC is a complete PlanetLab Central (PLC) portable installation.
The default installation consists of a web server, an XML-RPC API
server, a boot server, and a database server: the core components of
(cd $RPM_BUILD_ROOT/usr/bin; ln -s mtail.py mtail)
chmod 755 ${RPM_BUILD_ROOT}/usr/bin/*
-# Install initscript
+# Install initscript
echo "* Installing plc initscript"
install -D -m 755 plc.init ${RPM_BUILD_ROOT}/etc/init.d/plc
install -D -m 644 plc.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/plc.service
fi
fi
done
-fi
+fi
%preun
# 0 = erase, 1 = upgrade
- figures in doc package
* Fri May 09 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-11
-- no more doc packaged outside of myplc-docs - doc/ cleaned up
+- no more doc packaged outside of myplc-docs - doc/ cleaned up
- chroot packaging does not have docs anymore
- 'cvs' and 'dev' not required from myplc-native anymore
- cosmetic change in kml output
* Thu May 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-10
- defaults for *_IP conf vars now void, expect more accurate /etc/hosts
-- gethostbyname uses python rather than perl (hope this shrinks deps)
+- gethostbyname uses python rather than perl (hope this shrinks deps)
- doc: reviewed myplc doc - deprecated everything related to myplc-devel
- doc: packaging doc in myplc-native (myplc&PLCAPI) & removed target files from svn
-- make sync now works towards vserver-based myplc only
+- make sync now works towards vserver-based myplc only
* Mon May 05 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-9
--
+-
- added vsys 'pfmount' script to the default netflow slice attributes.
--
+-
* Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-8
- plc.d/bootcd step altered for handling legacy bootcd smooth migration
- resolv file in /etc/resolv.conf, not plc_resolv.conf
- improved sirius script
- remove the 'driver' node-network-setting that was unused, and new 'Multihome' category
-- expires more properly set
+- expires more properly set
* Mon Apr 07 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - MyPLC-4.2-4 MyPLC-4.2-5
--
+-
* Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - MyPLC-4.2-3 MyPLC-4.2-4
- renew_reminder script moved to support-scripts/
# set document root - not really useful on fedora but just in case
sed -i -e "s@^DocumentRoot.*@DocumentRoot \"$DocumentRoot\"@" $httpd_conf
- # whether WWW is enabled or not :
+ # whether WWW is enabled or not :
if [ "$PLC_WWW_ENABLED" != "1" ] ; then
# avoid hitting drupal, that would try to connect to the db and create noise
disable_file $DocumentRoot/index.php
# Set open_basedir so as to avoid leaks
open_basedir="$DocumentRoot:/etc/planetlab/php:/usr/share/plc_api/php:/var/log/myslice:/var/tmp/bootmedium:/var/log/bm:/tmp"
sed -i -e "s@[;]*open_basedir =.*@open_basedir = \"$open_basedir\"@" $php_ini
-
+
# for php-5.3 under fedora12, otherwise issues tons of warning messages
# Set timezone in php.ini if not already there
if grep '^;date.timezone' $php_ini >& /dev/null; then
## patch php.ini
# memory limit
- sed -i -e 's,^memory_limit = 32M *;,memory_limit = 80M ; patch myplc -- ,' $php_ini
+ sed -i -e 's,^memory_limit = 32M *;,memory_limit = 80M ; patch myplc -- ,' $php_ini
# log_errors : is On by default
# error_log
if ! grep '^error_log *=' $php_ini > /dev/null ; then
if [ -z "${http_port}" ]; then
skip_http=1;
elif [ -z "${!http_port}" ]; then
- skip_http=1;
+ skip_http=1;
elif [ "${!http_port}" = "${!previous_http_port}" ] ; then
skip_http=1
fi
exit 1
fi
- # It would be tempting to use <IfModule> here
+ # It would be tempting to use <IfModule> here
# but early tests showed this could be tricky/fragile
# So let's hard-wire it for one module
# A lot of trial-and -error was involved in getting this that way...
# mod_wsgi location
<Location $PLC_API_PATH>
$(apache_forbid)
-</Location>
+</Location>
EOF
fi
#!/bin/bash
#
-# plc Manages all PLC services on this machine
+# plc Manages all PLC services on this machine
#
# chkconfig: 2345 60 40
#
-# description: Manages all PLC services on this machine
+# description: Manages all PLC services on this machine
#
# Source function library and configuration
stepname=$(basename $step)
plainstepname=$(echo $stepname | sed -e 's,\.,,' -e 's,~,,' -e 's,functions,,' )
if [ -f $step -a -x $step -a "$stepname" = "$plainstepname" ] ; then
- priority=$(sed -ne 's/# priority: \(.*\)/\1/p' $step)
- echo $priority $stepname
+ priority=$(sed -ne 's/# priority: \(.*\)/\1/p' $step)
+ echo $priority $stepname
fi
done | sort -n | cut -d' ' -f2
))
usage()
{
echo "Usage: $0 [OPTION]... [COMMAND] [STEP]..."
- echo " -v Be verbose"
- echo " -h This message"
+ echo " -v Be verbose"
+ echo " -h This message"
echo
echo "Commands:"
- echo " start Start all PLC subsystems"
- echo " stop Stop all PLC subsystems"
- echo " reload Regenerate configuration files"
- echo " restart Restart all PLC subsystems"
- echo " checkpoint filename : Checkpoint the current state of MyPLC to filename"
- echo " restore filename : Restore MyPLC state from filename"
- echo " steps Displays ordered list of subsystems"
+ echo " start Start all PLC subsystems"
+ echo " stop Stop all PLC subsystems"
+ echo " reload Regenerate configuration files"
+ echo " restart Restart all PLC subsystems"
+ echo " checkpoint filename : Checkpoint the current state of MyPLC to filename"
+ echo " restore filename : Restore MyPLC state from filename"
+ echo " steps Displays ordered list of subsystems"
echo
echo "Steps:"
for step in "${steps[@]}" ; do
- if [ -x /etc/plc.d/$step ] ; then
- echo " $(basename $step)"
- fi
+ if [ -x /etc/plc.d/$step ] ; then
+ echo " $(basename $step)"
+ fi
done
exit 1
}
# Get options
while getopts "vh" opt ; do
case $opt in
- v)
- verbose=1
- ;;
- h|*)
- usage
- ;;
+ v)
+ verbose=1
+ ;;
+ h|*)
+ usage
+ ;;
esac
done
start ()
{
for step in "${steps[@]}" ; do
- if [ -x /etc/plc.d/$step ] ; then
- /etc/plc.d/$step start
- # Steps may alter the configuration, may need to regenerate
- plc_reload
- else
- echo "PLC: $step: unrecognized step" >&4
- exit 1
- fi
+ if [ -x /etc/plc.d/$step ] ; then
+ /etc/plc.d/$step start
+ # Steps may alter the configuration, may need to regenerate
+ plc_reload
+ else
+ echo "PLC: $step: unrecognized step" >&4
+ exit 1
+ fi
done
}
stop ()
{
for i in $(seq 1 $nsteps) ; do
- step=${steps[$(($nsteps - $i))]}
- if [ -x /etc/plc.d/$step ] ; then
- /etc/plc.d/$step stop
- # Steps may alter the configuration, may need to regenerate
- plc_reload
- else
- echo "PLC: $step: unrecognized step" >&4
- exit 1
- fi
+ step=${steps[$(($nsteps - $i))]}
+ if [ -x /etc/plc.d/$step ] ; then
+ /etc/plc.d/$step stop
+ # Steps may alter the configuration, may need to regenerate
+ plc_reload
+ else
+ echo "PLC: $step: unrecognized step" >&4
+ exit 1
+ fi
done
}
case "$command" in
start|stop)
- $command
- ;;
+ $command
+ ;;
restart)
- stop
- start
- ;;
+ stop
+ start
+ ;;
reload)
- plc_reload force
- ;;
+ plc_reload force
+ ;;
checkpoint)
- cpfile=$1
- if [ -z "$cpfile" ] ; then
- echo "PLC: checkpoint requires a filename as an argument"
- exit 1
- fi
- cpdir=$(mktemp -d tmp.XXXXXX)
- cd $cpdir
- mkdir -p ./etc/planetlab/
- rsync -av /etc/planetlab/ ./etc/planetlab/
- /etc/plc.d/db checkpoint ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
- tar cjf $cpfile etc
- cd -
- rm -rf $cpdir
- ;;
+ cpfile=$1
+ if [ -z "$cpfile" ] ; then
+ echo "PLC: checkpoint requires a filename as an argument"
+ exit 1
+ fi
+ cpdir=$(mktemp -d tmp.XXXXXX)
+ cd $cpdir
+ mkdir -p ./etc/planetlab/
+ rsync -av /etc/planetlab/ ./etc/planetlab/
+ /etc/plc.d/db checkpoint ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
+ tar cjf $cpfile etc
+ cd -
+ rm -rf $cpdir
+ ;;
restore)
- cpfile=$1
- cpdir=$(mktemp -d tmp.XXXXXX)
- cd $cpdir
- tar xjf $cpfile
- /etc/plc.d/db restore ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
- rm -f ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
- rsync -av ./etc/planetlab/ /etc/planetlab/
- cd -
- rm -rf $cpdir
- ;;
+ cpfile=$1
+ cpdir=$(mktemp -d tmp.XXXXXX)
+ cd $cpdir
+ tar xjf $cpfile
+ /etc/plc.d/db restore ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
+ rm -f ./etc/planetlab/plc_db.checkpoint ./etc/planetlab/plc_drupal.checkpoint
+ rsync -av ./etc/planetlab/ /etc/planetlab/
+ cd -
+ rm -rf $cpdir
+ ;;
steps)
- echo "${steps[@]}" >&4
- ;;
+ echo "${steps[@]}" >&4
+ ;;
# for backwards compatibility
mount|umount|mountstatus)
- echo "${command} not used within native myplc environment"
- ;;
+ echo "${command} not used within native myplc environment"
+ ;;
*)
- usage >&3
- ;;
+ usage >&3
+ ;;
esac
exit $RETVAL