Monday, February 26, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 59149  / 1 Year ago, sat, october 1, 2022, 4:34:50

I wanted a daemon to start on boot so I added a line to /etc/rc.local that ended in "&"
I did that so it would run in the background.



The daemon is loaded and working fine but when the daemon is running you can press keys that do other important things.



When I am finally logged in I wanted to resume process or send it a terminal (tty2) so I can do a couple of things.



I'm new to linux and not sure how to do this.



I do a ps -aux |grep uox to work out which PID it is. But not sure how to resume.


More From » process

 Answers
0

jobs will only list the jobs that are associated with the shell that the jobs command is run in, and similarly fg and bg only work with processes on the same process tree as the current shell. In the context of this question, the job you want to attach to was started with /etc/rc.local, so that shell is not the current one you are in.



You could start the process from /etc/rc.local with the screen command (https://help.ubuntu.com/community/Screen) - this will start it up attached to a pseudo terminal, then you can later use screen again to attach to that terminal and type characters at the running program.



Install screen using apt-get, then type man screen to see all the options. I'm not sure exactly what you should put in rc.local and don't have time right now to experiment, but may update this answer later.


[#29985] Sunday, October 2, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
polcomposte

Total Points: 421
Total Questions: 92
Total Answers: 109

Location: Uzbekistan
Member since Mon, Jul 20, 2020
4 Years ago
;