0

I am using the librarie "libfaketime" to fake the time of my system. My objective is to change the time inside a docker container, independently of the host time. It can allow me to transform the container as a ntp server, distributing the fake time to the host. (I know I shouldn't sync a ntp server to itself, and i shouldn't peer to a server giving fake time but it is for testing purposes).

By looking at the readme, i found the possibility to change the date and time system-wide, faking directly the output of the date command.

It is using environment variables and the file /etc/faketimerc. The file is allowing the time modification wanted. Details on the exact configuration.

I replicated the configuration of the link above, I have all 3 environment variables and the file configured. But I cant change the output of the date command.

enter image description here

The librarie is working when I use basic modification like : faketime -f ā€˜-10d’ date` (echo the fake time to the terminal).

Edit : For information, libfaketime doesn't change the time distributed by the server (running ntpd). So the client is not stepping to the fake time displayed by the date command.

molik
  • 69
  • 2
  • 11
  • 2
    Your screenshot shows a typo in the first line. That's also why it's never a good idea to use screenshots of text: not so visible. – A.B Apr 26 '21 at 15:55
  • You were right, not only i needed to change the name of the variable, the path was also wrong. Thanks – molik Apr 27 '21 at 06:20

0 Answers0