.net Core 2.1console program cannot be resident in the background as a Linux daemon (service)

now there is a console program written by. Net core. The publish target is ubuntu-16.04-x64, and then you want to resident in the background as a daemon under Ubuntu, and start the timer to perform a series of operations. The code is as follows:

1. Call a method in .dll in console program.cs to open TCP

            ChildTCPServerHelper.Instance.OnInitSuccess += _ChildTCPServerHelper_OnInitSuccess;
            ChildTCPServerHelper.Instance.CreateTCPServer();

2. Then CreateTCPServer () in the ChildTCPServerHelper class starts the timer:
_ HandleCanUsePortTimer = new Timer ();

            _HandleCanUsePortTimer.Interval = 2000; //21
            _HandleCanUsePortTimer.Elapsed += _HandleCanUsePortTimer_Elapsed;
            
            _HandleCanUsePortTimer.Elapsed.Start();

but the problem is that after executing the start, the program does not execute the timer event, but instead comes to the point where it exits the program (because the CreateTCPServer () function is the last step of the console program). I would like to ask the gods how to make this console program permanent in the background.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bda25b-30a2b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bda25b-30a2b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?