Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of , nohup and Systemctl in linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the use of linux &, nohup and Systemctl, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.

&, nohup and Systemd

When the client browser first accesses the server, the server creates a different HttpSession object for each browser. Use the request.getSession () method on the server side to get the HttpSession object and use the methods provided for us by the HttpSession interface.

When will session expire?

The server clears the session that has not been active for a long time from the server memory, and the Session becomes invalid. The default failure time for Session in Tomcat is 20 minutes.

Call the invalidate method of Session.

Close the browser and end session.

1. Use & run the program in the background:

The result will be output to the terminal.

Use Ctrl + C to send SIGINT signal, program immunity

Close session to send SIGHUP signal, program shuts down

two。 Run the program using nohup:

The result is output to nohup.out by default

Use Ctrl + C to send SIGINT signal, the program shuts down

Turn off session to send SIGHUP signal, program immune

Therefore, nohup and & cooperation are often used online to start programs: SIGINT and SIGHUP signals can be immunized at the same time.

3. Systemctl:

Systemctl is a systemd tool that controls the systemd system and service manager.

Type ps ax | grep systemd in the terminal and see the first line, where the number 1 indicates that its process number is 1, which means it is the first program initiated by the Linux kernel. Therefore, once the kernel has detected the hardware and organized the memory, it runs the / usr/lib/systemd/systemd executable program, which initiates other programs in order. In the days before Systemd, the kernel would run / sbin/init, and then the program would run the rest of the startup scripts on a system called SysVinit. )

Tip: the .service suffix at the end of this name can be omitted because the default suffix for systemctl is .service. The meaning of the Unit file suffix will be explained in detail in subsequent advanced articles.

Systemd automatically finds the .service file in the / usr/lib/systemd/system directory and starts the services defined in it. If the Unit file you created earlier is in a different directory, you need to use the full path to the file.

Thank you for reading this article carefully. I hope the article "how to use linux & nohup and Systemctl" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report