Supported way to require that a service be stopped prior to installing an .rpm package?

2016-10-25 Thread jhally
Hello,

My team is building and maintaining a fairly complex software stack that is 
being packaged via rpm.  As part of the requirements, the service provided by 
the .rpm file must be stopped prior to installation / update of the package.

Is there any supported / recommended way to do this?  Currently the team uses 
the %pre section to check if the service is running and fail if so, but this 
seems a bit ugly.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org


Re: Supported way to require that a service be stopped prior to installing an .rpm package?

2016-10-25 Thread jhally
> On 10/25/2016 4:47 PM, jhally(a)gmail.com wrote:
> 
> https://fedoraproject.org/wiki/Packaging:Scriptlets
> 
> It seems like this is something that could be done in %pretrans, as well. 
> Alternatively,
> depending on the paradigm you're working with, you could give service restart
> responsibility to the rpm process itself. This already happens during most 
> daemon updates
> anyway, so if it's for your team's internal use, I'd consider saving state in
> %pretrans, stopping the service (if running), and starting back up in 
> %posttrans.
> 
> On 10/25/2016 5:10 PM, Subhendu Ghosh wrote:
> 
> 
> I don't see why this needs to be the case.
> 
> Between %pre, %post, %verify, and the newer %*trans functions, along 
> with Requires(pre), etc, 'rpm' provides all the tools you need to 
> perform modifications of a service using easily-grokkable logic, already 
> running as root, and using easily-testable methods.
> 
> Edge cases like saving state have best-practice implementations already 
> available, and rpm scriptlets already perform this action for many 
> services. Meta-packages which perform service control aren't 
> particularly groundbreaking.
> 
> Regards,
> 
> -jc

Thanks for the response!  could you possibly point me to an example of what 
you're referencing?
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org