wolfcw / libfaketime

libfaketime modifies the system time for a single application
https://github.com/wolfcw/libfaketime
GNU General Public License v2.0
2.62k stars 319 forks source link

nohup can only works for a while #445

Open fredericky123 opened 7 months ago

fredericky123 commented 7 months ago

Related issue: https://github.com/wolfcw/libfaketime/issues/372 nohup ./script.sh && Anycommand can works for a while, however, after several minutes the command stops althouth the loop shouldn't stop

the content of script is: LD_PRELOAD=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 FAKETIME="2020-01-01 00:00:00" command

wolfcw commented 7 months ago

Could you please post a complete example showing that effect? I don't see the loop you mentioned. It'd be also helpful to have a concrete example of a command where this happens.

fredericky123 commented 7 months ago

It's surprising I find an alternative way. The command below works correctly: LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 FAKETIME="2020-01-01 00:00:00" FAKETIME_STOP_AFTER_SECONDS=1 nohup COMMAND

However, if I create a .sh file contains:LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 FAKETIME="2020-01-01 00:00:00" FAKETIME_STOP_AFTER_SECONDS=1 Then I run nohup ./script.sh && COMMAND The syntax stopped due to unknown errors.

I will use the alternative way.