PAUL WILLIAMSON wrote: > How can I tell a process to restart only if a certain file has > changed? > > We just changed the way our login banners are supposed to occur. > Before, they appeared prior to login, so I could just use the > sshd_config file and specify an banner in the file. Now, I need to > present the banner after login. In order to do this, I need to restart > sshd. But, I don't want to restart sshd during the middle of the day > or when the sshd_config file hasn't changed.
How are you updating sshd_config? If it is via a cfengine copy action, you can define a class in that statement and then make your processes or shellcommands action conditional upon that class. If you are updating the file with a system that is not under cfengine control, you can maintain a datestamp file separate from the sshd_config file, and restart sshd (along with updating the datestamp file) if the last modified time of the sshd_config file is more recent than the last modified time of the datestamp file. If you choose that strategy, you will probably want to use the IsNewerThan evaluated class. You can find details on that at: http://www.cfengine.org/docs/cfengine-Reference.html#Evaluated-classes-and-special-functions Let me know if you want some example cfengine code for this. Best, Brendan -- Senior System Administrator The University of Chicago Department of Computer Science http://www.cs.uchicago.edu/people/brendan http://praksys.blogspot.com/ _______________________________________________ Help-cfengine mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-cfengine
