`w U1` - login informations for example for user U1 you can see in output something like this
User tty login@ idle JCPU PCPU what
also you can make a bash script and put in crontab for example to be run a few times per one day, with varibles w U1, w U2, w U3 and make some otput into file
also
`/var/run/utmp` - List of current login sessions.
`/var/log/wtmp` - List of previous login sessions
`/var/log/btmp` - List all the bad login attempt
No, strace
should not cause a program crash -
Except in this somewhat unusual case:
If it has a bug that depends on timing of execution, or runtime memory locations.
It may trigger this kind of "heisenbug" - but extremely rarely, because this kind of bug is rare, and it needs to only trigger under strace or other instrumentation.
And when you find a heisenbug, that's often a good thing.
Regarding ptrace()
- the syscall - that is just what strace
does inside I think, so it's similar. One can just do more than strace
can when using ptrace()
directly.
Your example would be just this kind of bug:
In the example, strace
would change the timing of the steps to create a network connection. If that causes a problem, it was a "problem waiting to happen" - the timing of execution changes constantly. With strace
, just a little more. But any other application could have changed the timing more, like starting a program.
Best Answer
From the source code:
This means that the time is shown in seconds, with microseconds (calculated from the nanosecond value) after the decimal point.