The daemon under Linux

Source: Internet
Author: User
Tags exit in

About Daemons, here are a few things to look at:

1.screen

2.supervisord (Python)

One: Screen

  

Start using screen

Simply put, screen is a window manager that can multiplex a physical terminal across multiple processes. Screen has the concept of session, users can create multiple screen windows in a screen session, in each of the screens window like the operation of a real telnet/ssh connection window. There are several ways to create a new window in screen:

1. Type the screen command directly at the command line

[Email protected] ~]# screen

Screens will create a full-screen window that executes the shell. You can execute any shell program, just like in the SSH window. Type exit in the window to exit the window, if this is the only window of the screen session, the screen session exits, otherwise screen automatically switches to the previous window.

2. Screen command followed by the program you are going to execute.

[Email protected] ~]# Screen VI test.c

Screen creates a single-window session that executes VI test.c, and exiting VI exits the window/session.

3. Both of these methods create a new screen session. We can also create a new window in an existing screen session. In the current screen window C-a c , type the CTRL key +a, and then press the C key, screen to generate a new window within the session and switch to that window.

Screen also has more advanced features. You can temporarily disconnect (detach) a screen session without interrupting the program running in the screens window, and reconnect (attach) The session at a later time to regain control of the programs running in each window. For example, we open a screen window to edit the/tmp/abc file:

[Email protected] ~]# screen VI/TMP/ABC

Then we want to quit for a while and do something else, like go for a walk, then type in the screen window C-a d , which will give you a detached hint:

Temporarily interrupt a session

Came back in half an hour and found the screen session:

[[email protected] ~]# Screen-lsthere is a screens on:        16582.pts-1.tivf06      (Detached) 1 Socket In/tmp/screens/s-ro Ot.

Reconnect session:

[Email protected] ~]# screen-r 16582

See what's going on, it's great, it's all there. Keep doing it.

You may notice that a special key combination c-a is used to send a command to screen. This is because the information we type on the keyboard is sent directly to the current screen window and must be issued in a different way to the screen window manager, which, by default, receives a command starting with C-a. This form of command is called key binding in screen, C-a is called command character.

You can C-a ? view all the key bindings by using the key bindings that are commonly used:

C-a? Show all key binding information
C-a W Show list of all windows
C-a c-a Switch to the previously displayed window
C-a C Create a new window to run the shell and switch to that window
C-a N Switch to the next window
C-a P Switch to the previous window (relative to C-a N)
C-a 0..9 Switch to Window 0: 9
C-a A Send c-a to current window
C-a D Temporarily disconnecting a screen session
C-a K Kill the current window
C-a [ Enter copy/rollback mode

Difficult diseases:

  Q1: Solve screen cannot open your terminal '/dev/pts/1 ' problem

problem description :

UserA First login to the system, using screen to open a session, and then Detach this window.

UserB then logs into the system, Su-usera to UserA, and then uses screen-r to restore the detached window before the system reports the following error :

   ' /DEV/PTS/1 ' -please check.
workaround :

UserB after Su-usera , execute the following command :

   script/dev/NULL

Turn from: Solve screen cannot open your terminal '/dev/pts/1 ' problem

The daemon under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.