Autodetect systemctl in SAIO and use it on systemd distros

Change-Id: I84a9b27baac89327749d8774032860f8ad5166f2
This commit is contained in:
Ondřej Nový 2015-10-10 20:57:07 +02:00
parent 6b854bd908
commit 9cafa472a3
2 changed files with 7 additions and 8 deletions

View File

@ -15,6 +15,10 @@ mkdir -p /srv/1/node/sdb1 /srv/1/node/sdb5 \
/srv/4/node/sdb4 /srv/4/node/sdb8 /srv/4/node/sdb4 /srv/4/node/sdb8
sudo rm -f /var/log/debug /var/log/messages /var/log/rsyncd.log /var/log/syslog sudo rm -f /var/log/debug /var/log/messages /var/log/rsyncd.log /var/log/syslog
find /var/cache/swift* -type f -name *.recon -exec rm -f {} \; find /var/cache/swift* -type f -name *.recon -exec rm -f {} \;
# On Fedora use "systemctl restart <service>" if [ "`type -t systemctl`" == "file" ]; then
sudo service rsyslog restart sudo systemctl restart rsyslog
sudo service memcached restart sudo systemctl restart memcached
else
sudo service rsyslog restart
sudo service memcached restart
fi

View File

@ -451,11 +451,6 @@ Setting up scripts for running Swift
sed -i "/find \/var\/log\/swift/d" $HOME/bin/resetswift sed -i "/find \/var\/log\/swift/d" $HOME/bin/resetswift
On Fedora, replace ``service <name> restart`` with ``systemctl restart
<name>.service``::
sed -i "s/service \(.*\) restart/systemctl restart \1.service/" $HOME/bin/resetswift
#. Install the sample configuration file for running tests:: #. Install the sample configuration file for running tests::