From 320a71c520ea26936264d9935b6b05e25a0de9bc Mon Sep 17 00:00:00 2001 From: parmentelat Date: Fri, 7 Dec 2018 16:58:02 +0100 Subject: [PATCH] spaces --- myplc.spec | 23 ++++---- plc.d/httpd | 12 ++--- plc.init | 152 ++++++++++++++++++++++++++-------------------------- 3 files changed, 94 insertions(+), 93 deletions(-) diff --git a/myplc.spec b/myplc.spec index 49240b6..95eb0d5 100644 --- a/myplc.spec +++ b/myplc.spec @@ -27,7 +27,7 @@ Group: Applications/Systems # 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 @@ -80,6 +80,7 @@ Requires: mod_wsgi %else Requires: mod_python %endif +%endif Requires: nodeimage-%{nodefamily} Requires: myplc-docs Requires: myplc-release @@ -87,7 +88,7 @@ Requires: myplc-config %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 @@ -126,7 +127,7 @@ rsync -av --exclude .svn bin/ ${RPM_BUILD_ROOT}/usr/bin/ (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 @@ -226,7 +227,7 @@ if [ $1 -gt 0 ] ; then fi fi done -fi +fi %preun # 0 = erase, 1 = upgrade @@ -576,22 +577,22 @@ fi - figures in doc package * Fri May 09 2008 Thierry Parmentelat - 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 - 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 - MyPLC-4.2-9 -- +- - added vsys 'pfmount' script to the default netflow slice attributes. -- +- * Thu Apr 24 2008 Thierry Parmentelat - MyPLC-4.2-8 - plc.d/bootcd step altered for handling legacy bootcd smooth migration @@ -606,10 +607,10 @@ fi - 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 - MyPLC-4.2-4 MyPLC-4.2-5 -- +- * Wed Mar 26 2008 Thierry Parmentelat - MyPLC-4.2-3 MyPLC-4.2-4 - renew_reminder script moved to support-scripts/ diff --git a/plc.d/httpd b/plc.d/httpd index 6180e6e..b14c76f 100755 --- a/plc.d/httpd +++ b/plc.d/httpd @@ -46,7 +46,7 @@ case "$1" in # 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 @@ -61,7 +61,7 @@ case "$1" in # 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 @@ -75,7 +75,7 @@ case "$1" in ## 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 @@ -137,7 +137,7 @@ EOF 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 @@ -190,7 +190,7 @@ EOF exit 1 fi - # It would be tempting to use here + # It would be tempting to use 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... @@ -249,7 +249,7 @@ EOF # mod_wsgi location $(apache_forbid) - + EOF fi diff --git a/plc.init b/plc.init index c3ae8f4..1488194 100755 --- a/plc.init +++ b/plc.init @@ -1,10 +1,10 @@ #!/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 @@ -39,8 +39,8 @@ for step in /etc/plc.d/* ; do 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 )) @@ -49,23 +49,23 @@ nsteps=${#steps[@]} 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 } @@ -73,12 +73,12 @@ usage() # Get options while getopts "vh" opt ; do case $opt in - v) - verbose=1 - ;; - h|*) - usage - ;; + v) + verbose=1 + ;; + h|*) + usage + ;; esac done @@ -113,86 +113,86 @@ RETVAL=0 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 -- 2.43.0