Answer the question
In order to leave comments, you need to log in
How to end a process running before connecting to the server?
I use a server on ubuntu for my telegram bot. I start it with nohup: nohup python3 bot.py & and usually end it with killall python3 . But now it works when there is only one bot, but when there are several of them, this approach is clearly not suitable. If I have not exited the terminal yet, then I can simply write ps, find out the pid of the process and kill it. But if I disconnect and then reconnect, then ps no longer displays this process, although it exists. How to find out his pid? Thanks in advance.
Answer the question
In order to leave comments, you need to log in
I agree with Fox Jovovich 's answer , but I also advise you to study the ps command
in particular, try the following options
ps a
ps axu
ps axuf | grep python3
man systemd. Create services for all your bots and manage them via systemctl
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question