H
H
hpfmsd2021-07-18 01:11:27
System administration
hpfmsd, 2021-07-18 01:11:27

How bad is it to run programs with screen?

Hey!
I run some programs on servers using screen.
For example, some main.js:
screen node main.js
there is a forever for the node, does it work the same way?

The task is to "daemonize" scripts with unfinished error handling, when daemonizing them on the Java itself is not so fun and not very desirable (when there is a screen). Let him fly, I will go through screen -r and see what he spat out before he died.

The main question is this tool exclusively for such small tasks as mine, or does someone use it in real production?

p.s. how to exit a specific screen when key combinations don't work? have to kill the ss session)))

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
poisons, 2021-07-18
@poisons

No one in their right mind does this in real life.
systemd unit - drive this line into Google, there is nothing complicated in reality.
What the process spat out before death can be written to the log file by stupidly redirecting the output.

S
Slava Rozhnev, 2021-07-18
@rozhnev

For NodeJS there is pm2
for all other supervisors

J
justhostRU, 2021-07-18
@justhostRU

>ps how to exit a specific screen when key combinations don't work? you have to kill the ssh session)))
did you mean to disable the session?
Ctrl+A then just D

V
Valentine, 2021-07-19
@ProFfeSsoRr

The task is to "demonize" scripts
so there is some kind of control system for that, now, in modern distributions, this is usually systemd. Read the documentation on how to write systemd units (which are daemons in the old terminology) and use them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question