Skip to content

Commit aaea12e

Browse files
committed
Add logging
1 parent b03b46e commit aaea12e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

cookbooks/aws-parallelcluster-computefleet/files/check_update/check-update.timer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Description=Check file modification time every minute
33

44
[Timer]
5-
OnBootSec=20sec
5+
OnActiveSec=20sec
66
OnUnitActiveSec=20sec
77
Unit=check-update.service
88

cookbooks/aws-parallelcluster-computefleet/templates/check_update/check-update.service.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ Description=Check for recent file modifications
33

44
[Service]
55
Type=oneshot
6-
ExecStart=/bin/bash -c "echo 'Checking file: <%= node['cluster']['shared_update_path'] %>'; if [ $(( $(date +%%s) - $(stat -c %%Y <%= node['cluster']['shared_update_path'] %>) )) -lt 20 ]; then echo 'File modified recently, running action'; <%= node['cluster']['scripts_dir'] %>/cfn-hup-update-action.sh; else echo 'File not modified recently'; fi"
7-
6+
ExecStart=/bin/bash -c "echo \"Checking file at $(date): <%= node['cluster']['shared_update_path'] %>\"; if [ $(( $(date +%%s) - $(stat -c %%Y <%= node['cluster']['shared_update_path'] %>) )) -lt 20 ]; then echo 'File modified recently, running action'; <%= node['cluster']['scripts_dir'] %>/cfn-hup-update-action.sh; else echo 'File not modified recently'; fi"
87

98
[Install]
109
WantedBy=multi-user.target

0 commit comments

Comments
 (0)