TDaemonApp run with --background option will cause an issue that TThread cannot write to files/syslog.
Original Reporter info from Mantis: cst_zf
-
Reporter name: cst_zf
Original Reporter info from Mantis: cst_zf
- Reporter name: cst_zf
Description:
i used a TEventLog in TDaemonApp and want to use a TThread in it, too.
but i cannot write logs properly when i run the app with -b(--background) option.
the same issue appears when i run this daemonapp with start-stop-daemon --background.
Steps to reproduce:
- build a DaemonApp with LazDaemon.
- add a Daemon to DaemonMapper.
- create a class with TThread. Writing to syslog(TEventlog) or some files(AssginFile, Rewrite, Reset and so on).
- create the TThread in start procedure of Daemon, and Resume it.
- build the app.
- tail -f /var/log/syslog(in Ubuntu).
if we run the app with only -r, it will write syslog.
if we run with -r -b, it can not write anything from TThread but can write logs from main thread and the Daemon thread(maybe?).
And i find that when i write to a file in TThread, the modified time of the file is refreshed but nothing is written.
Mantis conversion info:
- Mantis ID: 23445
- OS: Linux
- Platform: x86_64
- Version: 2.6.0
- Fixed in version: 3.0.0
- Fixed in revision: 26697 (#98dc27db)
- Target version: 3.0.0