Yeah, that's what we do in 99% of our manifests, but for cups, the config file contains this disclaimer right at the top:
# Printer configuration file for CUPS v1.5.4 # Written by cupsd on 2014-01-24 09:47 # DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING And the manpages say the same thing: "...If you do choose to edit this file manually, you will need to stop the scheduler first, make your changes, and then start the scheduler to make them active." It just seems like a useful thing, if not exactly common, to say "hey, do this thing before me, but only when I trigger." Declaring a predicate step, as it were. *Bret Wortman* http://about.me/wortmanbret On Tue, Jan 28, 2014 at 9:10 AM, jcbollinger <john.bollin...@stjude.org>wrote: > > > On Monday, January 27, 2014 1:50:24 PM UTC-6, Bret Wortman wrote: >> >> I'm looking at the case of distributing /etc/cups/printers.conf. >> >> When this file changes, I'd like to distribute it. But before placing the >> new file, cupsd needs to be shut down, and restarted again afterwards. This >> can be done easily enough using an Exec to shut it down and the existing >> Service entry to trigger a restart, but how can I tell my manifest that >> when the File triggers, first do the Exec, then the File, then the Service? >> >> Is there a way to chain these together to produce the effect I'm looking >> for? To stop a service before deploying a new config file, then start it up >> again? >> > > > No easy way to do that, no. On the other hand, it's probably not > necessary. You should be able to put the new config in place first, then > trigger a service restart; it is a rare service that cannot be updated in > that way. Moreover, it makes the length of the service interruption > slightly shorter, and it does not leave the service down if the file update > fails for some reason. Your manifest will also be simpler. Just remove > the Exec, and you should be good to go. > > > John > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Puppet Users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/puppet-users/MGIkGFm1LYY/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/fddddd78-f5e9-4fa2-82c4-37a5eaef0d8a%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAN9oxgRMSmdSszvd71_tgTp6GMfhw8D71uMJKtvXt5ZEusOy%3DQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.