Skip to content

Commit 8478ae9

Browse files
committed
Fix and log
1 parent 1b4eea2 commit 8478ae9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

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

44
[Timer]
5+
OnBootSec=20sec
56
OnUnitActiveSec=20sec
67
Unit=check-update.service
78

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

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

44
[Service]
55
Type=oneshot
6-
ExecStart=/bin/bash -c 'if [ $(( $(date +%%s) - $(stat -c %%Y <%= node['cluster']['shared_update_path'] %>) )) -lt 60 ]; then <%= node['cluster']['scripts_dir'] %>/cfn-hup-update-action.sh; fi'
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+
78

89
[Install]
910
WantedBy=multi-user.target

0 commit comments

Comments
 (0)