TProcess weird behavior on Linux, urgent help needed! lazarus / 32-Linux ---------------------------------------------------------------------- ggallo · 2013-11-08 12:31 Hi All! I have a weird problem with TProcess on Linux, and I can't find any solution. I wrote an application that uses some self update as follows: the main application checks if update available, downloads it and starts the included update program. If update program started, the main application quits to let the update program change files and so. This works very well on Windows, updater started, main application quits, files replaced, main application restarted by updater program. But on Linux, the updater started, but immediately ended when TProcess.Free called on main application exit. I can't find any solution to keep the program running - started by TProcess - after TProcess.Free. Can anyone help me? ---------------------------------------------------------------------- marcov · 2013-11-08 23:22 Afaik under *nix, processes remain part of their parents process tree. Kill the parent, kill the process tree. To fix this is called "daemonization", roughly the same way a daemon (equivalent to a service on windows) is created. So probably the updater program should at least partially daemonize itself. There is a daemonizing program in the FPC demos. ---------------------------------------------------------------------- Yogi · 2013-11-09 00:12 marcov is right. Your updater program is killed when the program which started it is ending. On Linux You can start your updater via "nohup" to avoid this. Google for "nohup" (nohup => the "hangup"-Signal will be ignored) ---------------------------------------------------------------------- ggallo · 2013-11-09 00:24 Thanks for the answers marcov and Yogi! I will look at the "daemonization" demo tomorrow, maybe it will help me solve this problem. I already fount "nohup" today, but unfortunately it not work with user right elevation. If I start my updater with "nohup updater -option -option" the solution works, updater run after main app exit. Good. But if I run "nohup pkexec updater -option..." then this combo also killed with main app, as before. So I can't copy to program's install dir (it's created root:root). To be correct, standalone "pkexec updater ..." also not working, so this is not nohup's fault. I'll write here if I solve this somehow, to let others read it.