From 44a7cb6f5af92c3329209f9d2c9fc21d7910718f Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Mon, 21 Oct 2019 21:07:00 -0600 Subject: [PATCH] Only restart services when the corresponding file has been modified recently --- README.md | 10 ++++++++-- boxctl.sh | 23 ++++++++++++++++++----- examples/host1/services | 2 +- man/boxctl.8 | 10 ++++++++-- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ae612ea..700fb6f 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,14 @@ The options are as follows: > An optional file that contains a list of services to enable on the remote > host. -> If a service is already enabled, it will be restarted each run of -> **boxctl**. +> Each line in the file should contain "name:path". +> Where "name" is the name of a service (httpd for example) and "path" is the +> full path to a file that when modified, should trigger a restart of the named +> service. +> For example, the entry "httpd:/etc/httpd.conf" would restart +> httpd(8) +> if the mtime on "/etc/httpd.conf" is less than 100 seconds from the current +> time. *$CWD/groups* diff --git a/boxctl.sh b/boxctl.sh index bd7bdd5..9007181 100755 --- a/boxctl.sh +++ b/boxctl.sh @@ -69,10 +69,19 @@ EOF ) SERVICE_START_RESTART=$(cat <