title: Check if service is running prior to install using Puppet
body: <p>I need to check if a service is already running before it installed using puppet.</p>
  
  <p>My code is as following, but it is keep failing.</p>
  
  <pre><code>exec {  'bud_sh':
  cwd      =&gt; '/working_dir/',
  command  =&gt; "Some Command",
  path     =&gt; '/usr/bin:/usr/sbin:/bin:/usr/local/bin',
  provider =&gt; 'shell',
  onlyif   =&gt; "test -f /path/to/shell/script/exist",
  unless  =&gt;  "`ps -eaf | grep service | grep -v grep | wc -l` -eq 3"
  </code></pre>
  
  <p>} </p>
  
  <p><strong>Following is the Error Message.</strong>  </p>
  
  <pre><code> Could not evaluate: /bin/sh: 3: command not found 
  </code></pre>
  
  <p>Appreciate your time and consideration on this matter.</p>