brianbianco/redisio — pull request #129 by martinb3 (2014-07-29 15:02:27+00:00)
Title: Sentinel service resource's status_command broken on Ubuntu

I'm testing the 2.0.0_wip branch, and I've discovered that the sentinel work in this branch uses a different status_command for the service than the normal redis service status command:

```
service "redis_sentinel_#{sentinel_name}" do
start_command "/etc/init.d/redis_sentinel_#{sentinel_name} start"
stop_command "/etc/init.d/redis_sentinel_#{sentinel_name} stop"
case node['platform']
when 'centos','redhat','scientific','amazon','suse'
status_command "pgrep -lf 'redis.*#{sentinel_name}' | grep -v 'sh'"
else
status_command "pgrep -lf 'redis.*#{sentinel_name}'"
end
restart_command "/etc/init.d/redis_sentinel_#{sentinel_name} stop && /etc/init.d/redis_sentinel_#{sentinel_name} start"
supports :start => true, :stop => true, :restart => true, :status => false
end
```
vs.
```
service "redis#{server_name}" do
start_command "/etc/init.d/redis#{server_name} start"
stop_command "/etc/init.d/redis#{server_name} stop"
status_command "/etc/init.d/redis#{server_name} status"
restart_command "/etc/init.d/redis#{server_name} stop && /etc/init.d/redis#{server_name} start"
supports :start => true, :stop => true, :restart => true, :status => true
end
```

When sentinel isn't running, I was surprised to learn that the pgrep is broken:
```
root@sentinel-ubuntu-1204:~# sh -c "pgrep -lf 'pleasedontexist-redistest' && echo yes"
7736 sh -c pgrep -lf 'pleasedontexist-redistest' && echo yes
yes
root@sentinel-ubuntu-1204:~# pgrep -lf 'pleasedontexist-redistest' && echo yes
```

The work appears to have happened in this commit:
https://github.com/brianbianco/redisio/commit/c61314aa56c22c4b81930389d8bf4a431a031569

The message says, "When using init.d, I have added a status command to the init script and the init.d based service now uses that instead of trying to use pgrep."

Perhaps the sentinel service status command was simply missed?

Thanks,
Martin