Answer the question
In order to leave comments, you need to log in
How to implement background application control via console?
The question is the following:
there is a small application with websockets on go. I thought about adding the ability to ban / unban users to it.
It seems logical to just do it through standard input - output in the console, but since the application is launched in the background via systemd, but I can’t catch up yet, how can I switch to console application management in this case)
Flags seem to have nothing to do with it either, because are responsible for configuring the application at startup and do not work with already launched ones.
In the end, it needs to work like, for example, mongoDB - you enter mongo and the console is transferred to application management.
Where to dig to implement this? Programming is a hobby for me, I still don’t understand what to google in the direction.
Answer the question
In order to leave comments, you need to log in
There are several options:
1. Through stdin, in linux, as a rule, you can reach it in /proc/PROCESS_ID/fd/0
2. Listen in a separate socket file
3. Send a separate network request
4. You can look towards d-bus
.. .
In the end, it needs to work like, for example, mongoDB - you enter mongo and the console is transferred to application management.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question