Make resetswift customizable via environment
Instead of recommending to edit resetswift to replace "/dev/sdb1" with "/srv/swift-disk", use an environment variable instead. This way I can set SAIO_BLOCK_DEVICE=/srv/swift-disk in my .bashrc, and then when I'm testing out changes to resetswift, I don't need to remember to edit the modified script, nor do I end up submitting changes with the wrong default in there. The variable defaults to /dev/sdb1, so if you use the script unmodified and don't set SAIO_BLOCK_DEVICE, nothing changes for you. Change-Id: I741a8c91c2c54a4f32bc391cd794ef4206402753
This commit is contained in:
parent
16e1e1e3c6
commit
466403723c
@ -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/*
|
||||
|
@ -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::
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user