Home > Net > How to save out of service under the Linux
How to save out of service under the Linux
Time:01-02
, the service has started, how should I quit, the interfaces also make it work, I quit, this service is stopped,,,,,,,,,,,,,,,
CodePudding user response:
CTRL + C or ps check process id, then kill
CodePudding user response:
Dotnet run the project, will monopolize the conversation, whether directly to turn off the console, or CTRL + c, will stop the service, the right thing to do is to use unattended mode tasks, such as with the help of the supervisor, 1. Installation: Yum install the supervisor (red hat) Apt to install the supervisor (debian, ubuntu)
2. In the/etc/supervisor/conf. D in dotnet program to add a configuration file for you (if it is ubuntu, configuration files need to file name. The conf end, if it is a centos, need to be. Ini as suffix, depends on the/etc/supervisor/supervisor. The conf configuration, specific can use grep - E ^ "files"/etc/supervisor/supervisord conf command to see, or open this file directly to view, display files=/etc/supervisor/conf. D/*. Conf, illustrate the configuration file also contains the conf. D directory of all *. Conf) configuration file example
# cat/etc/supervisor/conf. D/dotnet. Conf
[the program: dotnet] The command=/usr/local/dotnet/dotnet/var/WWW/DDNS/DDNS. DLL Directory=/var/WWW/DDNS Autostart=true Autorestart=true Stderr_logfile=/var/WWW/daemon - DDNS. Err # service the output of the error message log Stdout_logfile daemon - DDNS.=/var/WWW/log # console output saved location Log_stderr=true Log_stdout=true User=root
3.0 use supervisorctl update this command to update the supervisor configuration (such as a new configuration file, modify, delete) 3.1 supervisorctl status to see all the supervisor managed the running state of the instance of the 3.2 supervisorctl start | stop | | restart XXXX open stop | restart XXXX instance,
Of course, you can also use other ways to implement, such as registered as a service, or with the aid of nohup, screen command, the ultimate goal is to maintain the mission in the background, without the need to depend on the current session,
CodePudding user response:
More examples can refer to this article Supervisor in unattended mode (daemon) run the task three cases (Java, redis, dotnet) https://www.chenxin.info/2020/06/08/supervisor-sample-java-redis-dotnet/
CodePudding user response:
Don't use docker deployment, is much more simple, a command dockers run - d afterward