Open rhencke opened 4 years ago
I agree, that sounds like a good idea and would be cool to have. :-)
My apologies... I did not read the Linux patch close enough...
CLOCK_REALTIME - System-wide clock that measures real (i.e., wall-clock) time.
For many users, the time namespace means the ability to changes date and time in a container (CLOCK_REALTIME). Providing per namespace notions of CLOCK_REALTIME would be complex with a massive overhead, but has a dubious value.
So.. it.. doesn't namespace the one part of time that would have been interesting, currently. Well.. maybe in Linux 7.12 or so.. (sorry for the noise - you can close this as 'currently impossible'.. d'oh)
As of Linux 5.6, a new namespace was added for time.
Within each time namespace, you can set:
This allows you to run programs as if they were running in the past or future, without modifying the system clock.
Here are some of the things I would like to do with such a feature, if it existed:
firejail
to run unit tests at varying points in the future as part of a CI process, to catch time-related problems before they become real. Because so many of our unit tests use the system clock.. grumble grumble.. but.. I digress..firejail
to easily test network scenarios where a client has an incorrect system clock.firejail
to inspect and explore how software and systems act at various points in the future (e.g. is this software affected by the year 2038 problem?)Is this an idea that firejail would be open to? (I'd be happy to hack on a PR if so.)