X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=guest.init;h=309523e3371c23b7fa07cb6a5a0061330faccc71;hb=5c61bd05c3236afe260a7119e9edd8232d71c9a5;hp=8a493941c850a04ae180aa787b5333e5964d32d0;hpb=e81a8f4a5368ab9d8a5bb64d0fe1033b10634d54;p=myplc.git diff --git a/guest.init b/guest.init index 8a49394..309523e 100755 --- a/guest.init +++ b/guest.init @@ -77,6 +77,9 @@ reload () if [ -n "$force" -o /etc/planetlab/plc_config.xml -nt /etc/planetlab/plc_config ] ; then plc-config --shell >/etc/planetlab/plc_config fi + if [ -n "$force" -o /etc/planetlab/plc_config.xml -nt /etc/planetlab/plc_config.py ] ; then + plc-config --python >/etc/planetlab/plc_config.py + fi if [ -n "$force" -o /etc/planetlab/plc_config.xml -nt /etc/planetlab/php/plc_config.php ] ; then mkdir -p /etc/planetlab/php plc-config --php >/etc/planetlab/php/plc_config.php @@ -94,6 +97,8 @@ usage() 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:" @@ -188,10 +193,43 @@ case "$command" in 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 + ;; + + 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 + ;; + steps) echo "${steps[@]}" >&4 ;; + # for backwards compatibility + mount|umount|mountstatus) + echo "${command} not used within native myplc environment" + ;; + *) usage >&3 ;;