Delphi-Cross-Socket icon indicating copy to clipboard operation
Delphi-Cross-Socket copied to clipboard

在 Linux 下怎么后台运行?

Open isgbuddy opened this issue 4 years ago • 2 comments

用 TCrossHttpServer 做了个 http 服务,打算在 ubuntu 下跑,现在在 shell 下直接跑没问题,但是加 & ,想在后台运行,跑不起来,这个怎么办?

try with TAppServer.Create do try Start(); Writeln(APP_NAME, ' start at port: ', HttpServer.Port, ', IO threads: ', HttpServer.IoThreads); Writeln('Press Enter stop'); Readln; Stop(); Writeln(APP_NAME, ' stopped'); Writeln('Press Enter exit'); Readln; finally Free; end; except on E: Exception do Writeln(APP_NAME + ' exception => ' + E.ClassName, ': ', E.Message); end;

isgbuddy avatar Apr 25 '21 03:04 isgbuddy

可以使用这个开源弄成守护程序: https://github.com/EvgeniyKorepov/LinuxDaemonNewStyle

fjfzeagle avatar May 10 '21 03:05 fjfzeagle

http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html

PassByYou888 avatar Nov 06 '21 11:11 PassByYou888