1

My question is same as the ones I already found on SO here, here and here. But, for me nohup doesn't work. compiling screen gives errors and for disown, Control+Z does not make the process "stopped".

I run a data generation binary which writes data into a file and also prints status messages on the screen (stdout). I tried the following

nohup ./sp2b <options for sp2b> > output &

When I logout of the terminal and login back, the process is already killed. I actually would like to time it as well, so want to do

nohup time ./sp2b <options for sp2b> > output &

Why is nohup not working in my case?

5

2 Answers 2

1

maybe try something like this, instead of screen use tmux (a more modern alternative of screen), as you do not have root, we will install it locally.

mkdir tmp && cd tmp;
aptitude download tmux;
ar x tmux_*
tar xvf data.tar.gz

Now you can try ./usr/bin/tmux, hopefully you will have dependencies installed, tmux has only a few. This worked on my machine.

6
  • Thank you for the reply. I tried this, but tmux depends on libevent and that is not installed on our server. Although I can compile and generate the binary of libevent and place it locally, I don't think there is an option to make tmux look in that folder for libevent(?). Why do you think the nohup option is not working for me?
    – Raghava
    Commented Aug 12, 2013 at 21:49
  • yes, this is possible via changing the export LD_LIBRARY_PATH variable. you can set by export LD_LIBRARY_PATH=/my/libevent/path:$LD_LIBRARY_PATH
    – Uku Loskit
    Commented Aug 12, 2013 at 22:06
  • why the process is not responding to NOHUP and suspend signals, I do not know, i'm no expert. It's possible to explicitly ignore these signals though, the default behavior is to respect them. is this them program: dbis.informatik.uni-freiburg.de/index.php?project=SP2B ?
    – Uku Loskit
    Commented Aug 12, 2013 at 22:10
  • I tested it out with /.sp2b_gen -t 5000000000000000 suspending works just fine for me, is this the right executable?
    – Uku Loskit
    Commented Aug 12, 2013 at 22:34
  • wow, thats a huge number, might takes days to finish. Yes, thats the executable that I am trying out with a lesser number as parameter. For suspending, did you do a control+z?
    – Raghava
    Commented Aug 12, 2013 at 22:37
0

The problem with nohup is that if you don't send the output to > /dev/null 2>&1 then it will keep the output process opened (it will output to nohup.out). So if you close the terminal, you also close the output process.

Example:

nohup node somescrip.js >/dev/null 2>&1 &

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