nohup

Using nohup to execute command very confused?

偶尔善良 提交于 2019-12-11 07:03:48
问题 my script: #!/bin/bash . /home/was/.bash_profile export PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/was/bin:/wasdata/oracle/10.2.0/client_1/bin: sqlplus "mon_system/monsystem@10.10.4.90" <<eof set echo off set feedback off set serveroutput on set term off set sqlprompt "" set linesize 200 spool /wasdata/scripts/systeminf/tmp-was-restart.sh exec prc_auto_restart eof sed -i '/prc_auto_restart/d' tmp-was-restart.sh /wasdata/scripts/systeminf/tmp-was-restart.sh cat

Nohup failing with Anaconda ipython

橙三吉。 提交于 2019-12-11 06:05:43
问题 I am trying to run a code using "nohup" command with Anaconda IPython. My code runs fine (for hours) if I run it inside ipython environment like; irsacf00-debian:~/WISE_AP> ipython Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) Type 'copyright', 'credits' or 'license' for more information IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: %run WISE_PHOT_052918_MODULER_IRSACF.py However, when I try to run the same code using "nohup" it breaks down with

Telling nohup to write output in real-time

帅比萌擦擦* 提交于 2019-12-11 01:02:21
问题 When using nohup the output of a script is buffered and only gets dumped to the log file (nohup.out) after the script has finished executing. It would be really useful to see the script output in something close to real-time, to know how it is progressing. Is there a way to make nohup write the output whenever it is produced by the script? Or, since such frequent file access operations are slow, to dump the output periodically during execution? 回答1: There's a special program for this:

Nohup: can't detach from console

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 13:54:11
问题 I have a bash script that will run in both Linux and Mac OS X. One particular line of the script works as is in Linux, but not in OS X. nohup <utility> <arg> > output.txt 2> error.txt </dev/null & When the bash script runs in Linux, it works like a charm. However, running the bash script in OS X, I get the error nohup: can't detach from console: Inappropriate ioctl for device I've done a lot of searching and haven't found a suitable answer as to why this is behaving as such. The executing

PHP: get PID of a specific process

纵然是瞬间 提交于 2019-12-10 12:14:36
问题 I have a QNAP box, that runs a flavor of linux and I am having problems getting the PID of a process using a php script. What I have so far: $command = "PATH=$PATH:/share/MD0_DATA/.qpkg/Optware/bin: nohup /opt/bin/plowdown -o /share/MD0_DATA/Qdownload/plowshare http://www.megaupload.com/?d=m7duotr1 2> /share/MD0_DATA/Qdownload/plowshare/outputeeds.txt > /dev/null &"; exec($command, $out); $result = $out[0]; echo $result; If I run the command through PUTTY, I get: [~] # nohup /opt/bin/plowdown

nohup create new files nohup.out by day

妖精的绣舞 提交于 2019-12-10 11:55:59
问题 I don't know if I can do it with nohup, but this is the question.... I have this command: nohup java -XX:MaxHeapFreeRatio=70 -Xmx2048M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -jar $iscsiJar & and I want that when the day change I save the before day nohupYYYYMM01.out and create another file nohupYYYYMM02.out , of course, with out kill my process. =) Is it possible, how do I program it in shell script? thanks a lot! 回答1: I think one solution for this is using Supervisord.

nohup为何没有任何作用

痴心易碎 提交于 2019-12-09 20:48:27
微信公众号: 51码农网 专业编程问答社区 www.51manong.com 查看huponexit对应的值,通过下面查询 [root@ky35z etc]# shopt | grep onexit 你的结果应该会返回 huponexit on。会导致nohup失效,将其设置为off [root@ky35z etc]# shopt -u huponexit session 退出的时候,不会把SIGHUP信号发给”后台任务” 来源: CSDN 作者: 51码农 链接: https://blog.csdn.net/yunxiaoxiehou/article/details/103463673

Nohup源码分析

家住魔仙堡 提交于 2019-12-09 19:28:49
在我们日常工作中, 总是不可避免的需要将进程放置后台运行, 于是我们就会使用& 或者nohup ... &, 我们有时会疑虑, 其实为什么多余添加一个nohup, 于是就是谷歌/百度, 然后就会得出一个答案: nohup 能够避免在终端断开时, 后台进程被杀掉. 但为什么nohup能够实现这个? 我们先来看下bash 对& 和nohup的解析吧: & If a command is terminated by the control operator &, the shell executes the command in the background in a subshell. The shell does not wait for the command to finish, and the return status is 0. Commands separated by a ; are executed sequentially; the shell waits for each command to terminate in turn. The return status is the exit status of the last command executed. nohup Run COMMAND, ignoring hangup signals

Using aliases with nohup

南笙酒味 提交于 2019-12-09 15:18:07
问题 Why doesn't the following work? $ alias sayHello='/bin/echo "Hello world!"' $ sayHello Hello world! $ nohup sayHello nohup: appending output to `nohup.out' nohup: cannot run command `sayHello': No such file or directory (the reason I ask this question is because I've aliased my perl and python to different perl/python binaries which were optimized for my own purposes; however, nohup gives me troubles if I don't supply full path to my perl/python binaries) 回答1: Because the shell doesn't pass

Amazon EC2 NodeJS server stops itself after 2 days even after using sudo nohup

寵の児 提交于 2019-12-09 13:51:11
问题 I have my app running on http://talkwithstranger.com/ and I have deployed it on AWS EC2. I use this command sudo nohup node index.js & To continue running my Node JS server even if I close my terminal and exit my SSH. However, after 2 days everytime I wake up and I find out that the node server itself stops automatically. I checked the running processes by using ps -ef and my node script is not there. Google Chrome say site DNS not found, because NodeJS Express is not running of course to