diff options
author | Alexandre Oliva <oliva@lsd.ic.unicamp.br> | 2012-11-26 13:13:46 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-11-26 15:04:08 -0800 |
commit | b1c71088bbd13955cfa81283fa2efc34822cd873 (patch) | |
tree | 9fbeb909550e1fb559820edcf504e0e44a4ce0cb | |
parent | a37c34debdfc6277d5829ab96190b03e87acea4d (diff) | |
download | ceph-b1c71088bbd13955cfa81283fa2efc34822cd873.tar.gz |
logrotate on systems without invoke-rc.d
The which command doesn't output anything to stdout when it can't find
the given program name, and then [ -x ] passes. Use the exit status
of which to tell whether the command exists, before testing whether
it's executable, to fix it.
Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
-rw-r--r-- | src/logrotate.conf | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/logrotate.conf b/src/logrotate.conf index aef3572918b..97d4fcdc545 100644 --- a/src/logrotate.conf +++ b/src/logrotate.conf @@ -4,11 +4,11 @@ compress sharedscripts postrotate - if [ -x `which invoke-rc.d` ]; then + if which invoke-rc.d && [ -x `which invoke-rc.d` ]; then invoke-rc.d ceph reload >/dev/null - elif [ -x `which service` ]; then + elif which service && [ -x `which service` ]; then service ceph reload >/dev/null - elif [ -x `which initctl` ]; then + elif which initctl && [ -x `which initctl` ]; then # upstart reload isn't very helpful here: # https://bugs.launchpad.net/upstart/+bug/1012938 for type in mon osd mds; do |