nohup

linux 部署jar

折月煮酒 提交于 2019-12-06 16:46:56
Linux 运行jar包命令如下: 方式一: java -jar xxx.jar 这种方式特点是ssh窗口关闭时,程序中止运行.或者是运行时没法切出去执行其他任务,有没有办法让Jar在后台运行呢: 方式二: java -jar xxx.jar & &代表在后台运行。 特定:当前ssh窗口不被锁定,但是当窗口关闭时,程序中止运行。 继续改进,如何让窗口关闭时,程序仍然运行? 方式三: nohup java -jar xxx.jar & nohup 意思是不挂断运行命令,当账户退出或终端关闭时,程序仍然运行 当用 nohup 命令执行作业时,缺省情况下该作业的所有输出被重定向到nohup.out的文件中,除非另外指定了输出文件 方式四: nohup java -jar xxx.jar >temp.txt & 解释下 >temp.txt command >out.file command >out.file是将command的输出重定向到out.file文件,即输出内容不打印到屏幕上,而是输出到out.file文件中。 可通过jobs命令查看后台运行任务 jobs 截图: 那么就会列出所有后台执行的作业,并且每个作业前面都有个编号。 如果想将某个作业调回前台控制,只需要 fg + 编号即可。 fg 23 查看某端口占用的线程的pid netstat -nlp |grep :8080

phantomjs with nohup not working

痴心易碎 提交于 2019-12-06 13:54:05
问题 I was trying to run phantomjs script via ssh using nohup command . But nohup threw an error which i found in nohup.out file. My command was --> nohup phantomjs example.js & phantomjs example.js run perfectly without nohup . I have also created a bash script to run this command with nohup but both time, I got this error --> events.js:72 throw er; // Unhandled 'error' event ^ Error: EBADF, read ** code of example.js var page = require('webpage').create(), system = require('system'), address,

Zookeeper not starting, nohup error

ⅰ亾dé卋堺 提交于 2019-12-06 09:01:04
问题 I have Downloaded zookeeper-3.4.5.tar.gz and after extracting it I wrote conf/zoo.cfg as tickTime=2000 dataDir=/var/zookeeper clientPort=2181 Now I tried to start zookeeper by bin/zkServer.sh start it gives mohit@mohit:~/zookeeper-3.4.5/bin$ sudo sh zkServer.sh start [sudo] password for mohit: JMX enabled by default Using config: /home/mohit/zookeeper-3.4.5/bin/../conf/zoo.cfg Starting zookeeper ... STARTED But $ echo ruok | nc localhost 2181 is not giving any output. I checked zookeeper.out,

How to manage nohup.out file in Tornado?

℡╲_俬逩灬. 提交于 2019-12-06 08:57:33
I built a web service using tornado and it serves days and nights. I used the command to start my service: nohup python my_service.py & The service log is able to write to nohup.out . However, the file becomes bigger as time goes. I want to know how can I manage it more conveniently? For saying, using an automatic method to generate the log files with proper names and size? Such as: service_log_1.txt service_log_2.txt service_log_3.txt ... Thanks. jjsmith83 Yes, there is. Put a cron-job in effect, which truncates the file (by something like "cat /dev/null > nohup.out" ). How often you will

linux命令 - nohup

我的梦境 提交于 2019-12-06 06:59:11
nohup command & nohup scrapy crawl eeo > /home/wangliang/eeo.log & nohou 需要后台的命令 打印的日志位置 文件可以随便写 &   使用 jobs -l 可以查看当前正在寻的程序 使用 ps -ef | grep scrpay 可以查看你的命令 使用 kill -9 进程号 可以杀掉你的命令 使用 tail -f 文件名 可以动态查看文件输入       来源: https://www.cnblogs.com/wang102030/p/11967529.html

Possible I/O sync issue with Ruby script under nohup?

跟風遠走 提交于 2019-12-06 06:46:35
This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 6 years ago . Had an odd issue with the output of a Ruby script running under nohup. Basically, there's a severe output delay when writing to a logfile or with stdout to nohup.out. You can see the original post here, which was answered for that use case: StackOverflow - Question 19455667 It was suggested that I use something like file_object.sync = true Which works, however I'm interested in the specifics of why this is occurring only when the script is under nohup. I'm guessing there's a deeper

How to get the proper exit code from nohup

这一生的挚爱 提交于 2019-12-06 03:59:44
问题 From the nohup documentation in info coreutils 'nohup invocation' it states: Exit status: 125 if `nohup' itself fails, and `POSIXLY_CORRECT' is not set 126 if COMMAND is found but cannot be invoked 127 if COMMAND cannot be found the exit status of COMMAND otherwise However, the only exit codes I've ever gotten from nohup have been 1 and 0. I have a nohup command that's failing from within a script, and I need the exception appropriately...and based on this documentation I would assume that

Send Output errors of nohup to syslog

旧巷老猫 提交于 2019-12-06 03:49:59
I'm attempting to write a bash script that uses nohup and passes errors to rsyslog. I've tried this command with different variations of the log variable (see below) but can't get the output passed to anything but a std txt file. I can't get it to pipe. nohup imageprocessor.sh > "$LOG" & Is it possible to pipe nohup output or do I need a different command. A couple of variations of log that I have tried LOG="|/usr/bin/logger -t workspaceworker -p LOCAL5.info &2" or LOG="|logtosyslog.sh" or LOG="logtosyslog.sh" A way in bash to redirect output to syslog is: exec > >(logger -t myscript) stdout

Linux下如何不停止服务,清空nohup.out文件

心已入冬 提交于 2019-12-06 03:18:00
tips:最近发现有不少人在百度这个问题,当初如易我也是初学者,随便从网上搜了一下,就转过来了,不过为了避免搜索结果同质化,为大家提供更翔实的参考,我将nohup.out相关 知识整理汇总如下: 1.nohup.out的由来及作用 用途:LINUX命令用法,不挂断地运行命令。 语法:nohup Command [ Arg … ] [ & ] 描述:nohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令,忽略所有挂断(SIGHUP)信号。在注销后使用 nohup 命令运行后台中的程序。要运行后台中的 nohup 命令,添加 & ( 表示“and”的符号)到命令的尾部。 例子: nohup ./startWeblogic.sh & 意思是即使退出ssh界面,命令仍然在后台执行,并且打印过程日志到nohup.out,当然也可以将nohup.out的输出转向到其他文件,高级应用请参考扩展阅读。 2.nohup.out的查看方式与方法 实际使用过程中,往往人们为了省心(嗯,没错,就是懒),经常没有给nohup.out进行重定向输出,也没有按日期分割文件,会造成这个文件特别巨大,达到2G或者3G,这个使用想查看文件,搜索出错内容就比较痛苦了。一般有两种方式 1.linux本机查看:使用tail 命令,查看最新的日志,或滚动监控日志打印。 例如命令 tail -1000