Hi.
I would like to use external Tor Socks Proxy with sdwdate at config file /etc/sdwdate.d/50_user.conf
:
PROXY_IP=192.168.7.70
PROXY_PORT=9050
And have the error (Tor’s Control Port could not be reached):
[user ~]% sudo journalctl -fu sdwdate
...
Jul 01 10:07:58 localhost sdwdate[706393]: __ ### START: ### /usr/libexec/helper-scripts/onion-time-pre-script
Jul 01 10:07:58 localhost sdwdate[706393]: __ Status: Subsequent run after boot.
Jul 01 10:07:58 localhost sdwdate[706393]: __ Static Time Sanity Check: Within minimum time 'Wed May 7 00:00:00 UTC 2025' and expiration timestamp 'Tue May 17 10:00:00 UTC 2033', ok.
Jul 01 10:07:58 localhost sdwdate[706393]: __ Tor Bootstrap Result: Tor's Control Port could not be reached.
Jul 01 10:07:58 localhost sdwdate[706393]: __ ### END: ### Exiting with exit_code '1' indicating 'wait, show error icon and retry.'.
...
Sdwdate is still running, but there is no time synchronization, no any success line in log, like this one:
...
Jul 01 12:19:37 localhost sdwdate[291586]: 2025-07-01 09:19:37 - sdwdate - INFO - Success.
...
Is it possible to use sdwdate without Tor Control Port?
Or i could keep using my good old bash script for time synchronization behind a proxy as a temporary forced alternative?:
#!/bin/bash
#How to use ntpdate behind a proxy?
#time.sh -v https://time.is
if [ "${UID:-}" != '0' ]; then
echo "ERROR: $0 must be run as root" 1>&2
exit 1
fi
if [ "${1:-}" = '-v' ]; then
set -o xtrace
shift
fi
UNAME=user
selected=(https://time.is https://time.is https://time.is)
selected_one=${selected[$RANDOM % ${#selected[@]} ]}
selectedsource=${1:-$selected_one}
get_date() {
grep -E '^[[:space:]]*[dD]ate:' | \
sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | \
head -1l | \
awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | \
sed 's/,//'
}
#wget
#stamp="$( sudo -u $UNAME wget --timeout=60 --tries=1 -S "$selectedsource" 2>&1 | get_date )"
#curl
stamp="$( sudo -u $UNAME curl -I "$selectedsource" 2>&1 | get_date )"
[ -z "$stamp" ] && echo "can't get date info" || date -s "$stamp"
Modified it for use with kicksecure:
#!/bin/bash
#How to use ntpdate behind a proxy?
#time.sh -v https://time.is
if [ "${UID:-}" != '0' ]; then
echo "ERROR: $0 must be run as root" 1>&2
exit 1
fi
if [ "${1:-}" = '-v' ]; then
set -o xtrace
shift
fi
UNAME=user
source /etc/sdwdate.d/30_default.conf
selected_zero=${SDWDATE_POOL_ZERO[$RANDOM % ${#SDWDATE_POOL_ZERO[@]} ]}
selected_one=${SDWDATE_POOL_ONE[$RANDOM % ${#SDWDATE_POOL_ONE[@]} ]}
selected_two=${SDWDATE_POOL_TWO[$RANDOM % ${#SDWDATE_POOL_TWO[@]} ]}
selected=$(shuf -e -n1 ${selected_zero%%#*} ${selected_one%%#*} ${selected_two%%#*})
selectedsource=${1:-$selected}
get_date() {
grep -E '^[[:space:]]*[dD]ate:' | \
sed 's/^[[:space:]]*[dD]ate:[[:space:]]*//' | \
head -1l | \
awk '{print $1, $3, $2, $5 ,"GMT", $4 }' | \
sed 's/,//'
}
#wget
#stamp="$( sudo -u $UNAME wget --timeout=60 --tries=1 -S "$selectedsource" 2>&1 | get_date )"
#curl
stamp="$( sudo -u $UNAME curl -I "$selectedsource" 2>&1 | get_date )"
[ -z "$stamp" ] && echo "can't get date info" || echo "$stamp" | clock-random-manual-cli