antirez/redis — pull request #1592 by datasmid (2014-03-11 13:36:35+00:00)
Title: fixing install with chkconfig

Syntax correction of 2 lines of bash code.

Problem:
The install_server.sh does not create a valid init script according to chkconfig on centos 6.5
How to reproduce/debug:
sudo bash -x ./install_server.sh

output:
Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf] /etc/redis.conf
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log] /var/log/redis/redis.conf
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379] /var/lib/redis
Selected default - /var/lib/redis/6379
which: no redis-server in (/sbin:/bin:/usr/sbin:/usr/bin)
Please select the redis executable path [] /usr/local/bin/redis-server
which: no redis-cli in (/sbin:/bin:/usr/sbin:/usr/bin)
s#^port [0-9]{4}$#port 6379#;s#^logfile .+$#logfile /var/log/redis_6379.log#;s#^dir .+$#dir /var/lib/redis/6379#;s#^pidfile .+$#pidfile /var/run/redis_6379.pid#;s#^daemonize no$#daemonize yes#;
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
service redis_6379 does not support chkconfig
service redis_6379 does not support chkconfig
exists, process is already running or crashed
Installation successful!

Proof of problem:
the chkconfig headers are not included in the init script.

Root cause:
Invalid syntax
if [ !`which chkconfig` ];
-bash: !`which: event not found

Suggested fix:
change syntax to
if [ ! $(which chkconfig) ];