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

CodePudding user response:

reference 4 floor nan peony reply:
aren't use docker deployment, is much more simple, a command dockers run - d finished the

1. The installation supervisor; 2. Add tasks configuration files; 3. Update command to update the configuration, a total of three steps, didn't see where is the complex, from the process point of view, docker was tedious, and docker threshold should be higher than the supervisor,
There could be many way to solve a problem, if you want further discussion, can sit down and talk about the contrast between the technology, but constrained by their cognitive, direct assumption method must be the best, others method must be better than his own poor, it is not appropriate,

CodePudding user response:

refer to fifth floor X - I - n reply:
Quote: refer to 4th floor nan peony reply:
aren't use docker deployment, is much more simple, a command dockers run - d finished the

1. The installation supervisor; 2. Add tasks configuration files; 3. Update command to update the configuration, a total of three steps, didn't see where is the complex, from the process point of view, docker was tedious, and docker threshold should be higher than the supervisor,
There could be many way to solve a problem, if you want further discussion, can sit down and talk about the contrast between the technology, but constrained by their cognitive, direct assumption method must be the best, others method must be better than his own poor, it is not appropriate,

I didn't say anything, it is your own YY, and let me just give an option for the building, he used it or not, don't need you to teach me

CodePudding user response:

refer to 6th floor nan peony reply:
Quote: refer to the 5 floor X - I - n reply:
Quote: refer to 4th floor nan peony reply:
aren't use docker deployment, is much more simple, a command dockers run - d finished the

1. The installation supervisor; 2. Add tasks configuration files; 3. Update command to update the configuration, a total of three steps, didn't see where is the complex, from the process point of view, docker was tedious, and docker threshold should be higher than the supervisor,
There could be many way to solve a problem, if you want further discussion, can sit down and talk about the contrast between the technology, but constrained by their cognitive, direct assumption method must be the best, others method must be better than his own poor, it is not appropriate,

I didn't say anything, it is your own YY, and let me just give an option for the building, he used it or not, don't need you to teach me

That may be I didn't see you said "docker easier" is what meaning, think you want to discuss,
  • Related