diff --git a/doc/saio/bin/resetswift b/doc/saio/bin/resetswift index 0c47690159..dd2692f7da 100755 --- a/doc/saio/bin/resetswift +++ b/doc/saio/bin/resetswift @@ -4,8 +4,8 @@ swift-init all stop # Remove the following line if you did not set up rsyslog for individual logging: sudo find /var/log/swift -type f -exec rm -f {} \; sudo umount /mnt/sdb1 -# If you are using a loopback device substitute "/dev/sdb1" with "/srv/swift-disk" -sudo mkfs.xfs -f /dev/sdb1 +# If you are using a loopback device set SAIO_BLOCK_DEVICE to "/srv/swift-disk" +sudo mkfs.xfs -f ${SAIO_BLOCK_DEVICE:-/dev/sdb1} sudo mount /mnt/sdb1 sudo mkdir /mnt/sdb1/1 /mnt/sdb1/2 /mnt/sdb1/3 /mnt/sdb1/4 sudo chown ${USER}:${USER} /mnt/sdb1/* diff --git a/doc/source/development_saio.rst b/doc/source/development_saio.rst index e33e60db2a..0fb91465d4 100644 --- a/doc/source/development_saio.rst +++ b/doc/source/development_saio.rst @@ -404,17 +404,21 @@ commands are as follows: Setting up scripts for running Swift ------------------------------------ - #. Copy the SAIO scripts resetting the environment:: + #. Copy the SAIO scripts for resetting the environment:: cd $HOME/swift/doc; cp -r saio/bin $HOME/bin; cd - chmod +x $HOME/bin/* #. Edit the ``$HOME/bin/resetswift`` script - If you are using a loopback device substitute ``/dev/sdb1`` with - ``/srv/swift-disk`` in the ``mkfs`` step:: + The template ``resetswift`` script looks like the following: - sed -i "s/dev\/sdb1/srv\/swift-disk/" $HOME/bin/resetswift + .. literalinclude:: /../saio/bin/resetswift + + If you are using a loopback device add an environment var to + subsitute ``/dev/sdb1`` with ``/srv/swift-disk``:: + + echo "export SAIO_BLOCK_DEVICE=/srv/swift-disk" >> $HOME/.bashrc If you did not set up rsyslog for individual logging, remove the ``find /var/log/swift...`` line:: @@ -426,9 +430,6 @@ Setting up scripts for running Swift sed -i "s/service \(.*\) restart/systemctl restart \1.service/" $HOME/bin/resetswift - The template ``resetswift`` script looks like the following: - - .. literalinclude:: /../saio/bin/resetswift #. Install the sample configuration file for running tests::