Ask Your Question
0

how to stop service before package update

asked 2017-07-15 15:17:55 -0500

gra gravatar image

Hi all

i would like to stop service before package update.

for example, before puppet apply ntp is already installed and version is 2. after puppet apply ntp version 2 to 3. (specify ensure parameter 3)

i would like to realize below step 1. stop service like service ntpd stop 2. apply new rpm 3. finnaly start service like service ntpd start

how can i do that ?

edit retag flag offensive close merge delete

Comments

Usually your (high-level) way of installing software does that for you, so you don't have to care about it. At least that's true with Debian apt/dpkg.

Kai Burghardt gravatar imageKai Burghardt ( 2017-07-15 16:26:33 -0500 )edit
1

If your OS is Redhat or CentOS you can examine what the RPM will do on an update by executing `sudo rpm -q --script whatever-the-rpm-is-called`, but typically one would restart the service after updating the software. In your puppet code, your service resource should "require" the package.

Red Cricket gravatar imageRed Cricket ( 2017-07-15 17:42:27 -0500 )edit

sorry my poor explain i use puppet packge resouce, before apply ensure 2 and now ensure parameter chnge 2 to3. so i eoud like to know this apply will change version.and when puppet change version, id like to stop service before pakage update

gra gravatar imagegra ( 2017-07-16 08:00:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-07-17 10:10:11 -0500

reesek gravatar image

It sounds like you're looking for the functionality puppetlabs/transition would provide.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-07-15 15:17:55 -0500

Seen: 54 times

Last updated: Jul 17