Closed subssn594 closed 3 years ago
Please try with FAKETIME_DONT_RESET=1
set as described in section 4c of the README, this part:
https://github.com/wolfcw/libfaketime/blob/9a73db074b2ec47f0b336d7644309b354cf2b198/README#L230-L233
In my test environment, it then works as you probably expected:
$ FAKETIME_DONT_RESET=1 faketime -f "@2021-06-23 12:00:00" tcsh
debian:~> date;sleep 5;date
Wed 23 Jun 2021 12:00:06 PM CEST
Wed 23 Jun 2021 12:00:11 PM CEST
I tried it (running in tcsh):
env FAKETIME_DONT_RESET=1 faketime -f "@2021-06-23 12:00:00" tcsh date Wed Jun 23 12:00:00 EDT 2021 (same result with multiple tries) echo $FAKETIME_DONT_RESET 1
Are you sure you're using libfaketime v0.9.8 or more recent (FAKETIME_DONT_RESET was added there)? I'm unable to reproduce this. Not sure what Ubuntu 18.04.5 LTS currently ships, v0.9.8 was released in August 2019.
Apparently 18.04 has 0.9.7-2. If that's the issue, then I'll just use the -f '+5d' syntax. That option works fine.
Again, not sure what Ubuntu backported into 0.9.7-2, but that's most likely the problem. Using relative offsets works as well (without FAKETIME_DONT_RESET), otherwise you could try compiling from source.
It's interesting that the syntax I used did get the time right, but the clock froze. The other syntax "+5d", didn't freeze the clock.
Since this is an old issue, closing it is the right thing. Thanks for your attention.
My command: faketime -f "@2021-06-23 12:00:00" tcsh
Time freezes in the tcsh shell. Documentation says that this is a start time.