File tree Expand file tree Collapse file tree
uid2-operator-ami/ansible Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,30 +25,6 @@ echo "Starting vsock proxy..."
2525TIME_SYNC_URL=" http://127.0.0.1:27015/getCurrentTime"
2626TIME_SYNC_PROXY=" socks5h://127.0.0.1:3305"
2727TIME_SYNC_TRIGGER_PORT=" ${TIME_SYNC_TRIGGER_PORT:- 27100} "
28- TIME_SYNC_OFFSET_SECONDS=" ${TIME_SYNC_OFFSET_SECONDS:- 30} "
29-
30- sync_enclave_time_with_offset_once () {
31- local current_time
32- local parent_epoch
33- if current_time=$( curl -s -f -x socks5h://127.0.0.1:3305 " ${TIME_SYNC_URL} " ) ; then
34- parent_epoch=$( date -u -d " ${current_time} " +%s 2> /dev/null || true)
35- if [[ -n " ${parent_epoch} " ]]; then
36- parent_epoch=$(( parent_epoch + TIME_SYNC_OFFSET_SECONDS))
37- if ! date -u -s " @${parent_epoch} " ; then
38- echo " Time sync: failed to set enclave time from '${current_time} ' with offset ${TIME_SYNC_OFFSET_SECONDS} s"
39- return 1
40- fi
41- echo " Time sync: updated enclave time to ${current_time} + ${TIME_SYNC_OFFSET_SECONDS} s"
42- fi
43- else
44- echo " Time sync: failed to fetch time from parent instance"
45- return 1
46- fi
47- }
48-
49- sync_enclave_time_with_offset_once || true
50-
51-
5228
5329start_time_sync_server () {
5430 python3 -u - << 'PY ' &
Original file line number Diff line number Diff line change 266266 dest : /etc/cron.d/uid2-time-sync
267267 mode : " 0644"
268268 content : |
269- */5 * * * * root /usr/local/bin/uid2-time-sync
269+ 0 0 * * * root /usr/local/bin/uid2-time-sync
270270
271271 - name : Clean up tmp files
272272 file :
You can’t perform that action at this time.
0 commit comments