On Fri, Nov 19, 2010 at 10:25:30AM -0800, Rudy Gevaert wrote:
> Hi puppet users
> 
> I'm trying to get around the following issue.  I want to make sure if
> a service is stopped.  I'm trying to do this is solaris but I don't
> think this is OS specific.
> 
> If the software that provides the service (sendmail in my cause) is
> installed the smf provider can make sure that the service is not
> running.
> 
> However, when the software is not installed it can not check:
> info: Service[sendmail](provider=smf): Could not get status on service
> sendmail

So you want to remove a package and make sure that the service is
stopped before that. I can think of a few options:

- remove the service resource: When you remove a package there should be
  a pre_exec or something that stops your service. But I dont know if
  Solaris has any support for that
- onlyif is only supported by the exec resource. You can define
  something like
  /etc/init.d/package stop ... onlyif => 'pkginfo | grep PACKAGE'
- Request a feature that all service providers should return stopped
  if the state could not be determined. But that might raise other
  problems
- Build a custom fact that will show you if your package is installed.
  Then you can build an if statement around your ressource. Not really
  great if you want to manage more than one package

I prefer number one but that might not be possible. I'm curious what
others think about your problem.

-Stefan

Attachment: pgpT1Xe2Wh0IY.pgp
Description: PGP signature

Reply via email to