0

I'm having problems knowing whether a program is running in the background.

The program is run via command line, but the computer is just a server (apologies if terminology is incorrect), which we access using our own computer's command line. In this instance, I am using my Mac's terminal to run the program, which can take 20 hours or so.

I've read the forums on the use of nohup and & to keep this process running, even when I disconnect by closing terminal, or putting my laptop on sleep - however, it doesn't seem to work. This is only an assumption - using htop, I checked to see whether the process was running, but found that it wasn't there.

It may be the initial command that isn't working. This is currently what I type:

nohup recon-all -all -s &

("recon-all -all -s" being the command)

This doesn't start the process, but generates a nohup.txt file in the directory that I was currently in. Only when I remove nohup from the command does it work.

I was wondering if anybody has any ideas about how I get this process to run? Is it a problem of the command?

Any help would be much appreciated.

1
  • What makes you think it doesn't start the process?
    – terdon
    May 9, 2014 at 13:18

1 Answer 1

0

I also have a similar situation: I often use my Mac terminal to launch commands on my Ubuntu server.

One thing you did not mention in your question is the way you connect to your Ubuntu server from the Mac terminal. If you do not connect to the Ubuntu server first, all your commands typed in the Mac terminal will be executed by the Mac itself, not by the Ubuntu server.

To connect to your Ubuntu server from the Mac terminal, type one of the following commands depending on the configuration of your Ubuntu server:

telnet <IP address or DNS name of your Ubuntu server>

or

ssh <IP address or DNS name of your Ubuntu server>

Once you are correctly logged in your ubuntu server, the prompt will indicate it by displaying the IP address or DNS name of your ubuntu server.

Then, you can type your commands as if you were in an Ubuntu server terminal. When I tested what you want to do, I had not to use the nohup command. The "&" thing was enough.

In my test case, I connected to the Ubuntu Sever from my Mac terminal through the ssh command, then I launched my command from the connected Mac terminal :

ssh myServerDNSname
x11vnc &

At this time, when I analyse the process hierarchy using ps -elaf command, the x11vnc process is attached to a -bash process that is attached to the sshd process (the one that corresponds to the ssh session).

Then, I disconnect from the ssh session (ctrl + D or type exit in the Mac terminal). The x11vnc process is still running: it has been automatically attached to the root process "1".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.