我有一个使用shell脚本(monitoring.sh)调用的c++文件。
cfile="/home/workspace/printprocess/print"
cmp=start
if [ $1 = $cmp ]
then
$cfile
fi
当我运行./monitoring.sh start时,它工作得很好
现在,我想在这个shell中创建另一个shell来存储它的pid,另一个shell应该具有正在运行的父shell的pid。
它是这样的:
if [$1 = $cmp ]
then
$cfile
cat > pid_no.sh <<EOF
w
我在crontab中有下面一行。
@reboot /usr/bin/teamspeak3-server_linux-amd64/ts3server_minimal_runscript.sh
当我重新启动时,脚本在后台运行(即我的terminal 3服务器启动),但我试图找到如何阻止它(我不能只是ctrl+c终端,因为它现在正在后台运行)。一个论坛帖子说通过使用下面的命令来终止这个过程。
ps -ef | grep -i XXXX: to find your background running process
kill OID : kill your unnecessary process
这似乎是一个类似的问题,在网上漫游,但这不是因为我没有发现任何类似的问题,所以在这里问。
问题是,我有一个名为abc.go的go程序,它包含两个函数,用于运行和停止someScript.sh脚本。在API命中时,会调用Run()和stop()。我使用命令sudo go run abc.go someFolder/someScript.sh运行这个sudo go run abc.go someFolder/someScript.sh文件,同时将someScript.sh路径作为参数传递。在stop()中,我保存进程组I,然后杀死整个进程组。
但是,当我调用run,然后停止函数时,它给出了这个输出
我对supervisor在docker上有个问题。我使用supervisor启动4个.sh脚本:datagrid.sh、ml.sh、startmap.sh和dirwatcher.sh。
当我打开容器时,导航到脚本目录并尝试手动启动脚本,一切正常,脚本全部启动,但它们不是在启动时启动的。我想问题出在主管身上。谢谢。
错误:
2018-08-08 12:28:08,512 INFO spawned: 'datagrid' with pid 171
2018-08-08 12:28:08,514 INFO spawned: 'dirwatcher' with pid
这是在python 2.7.12中完成的
serialHelper是一个围绕python系列的类模块,这段代码确实运行良好。
#!/usr/bin/env python
import threading
from time import sleep
import serialHelper
sh = serialHelper.SerialHelper()
def serialGetter():
h = 0
while True:
h = h + 1
s_resp = sh.getResponse()
print ('re
我正在尝试在docker镜像上安装postgres,基本镜像正在运行centos。
我在上按照说明操作,下面是我的Dockerfile文件:
FROM our-internal-docker-registry.org/centos:7.3.1611
RUN yum install -y postgresql-server postgresql-contrib
RUN postgresql-setup initdb
第一个RUN命令成功,但第二个命令失败,并显示以下信息:
Step 3/3 : RUN postgresql-setup initdb
---> Running in d26
我刚刚开始在windows 7中使用hadoop,cygwin,我需要知道,是否有任何方法可以使用linux中的命令- start-all.sh启动所有服务。我在cygwin不工作时使用了这个命令。如果可能的话,请建议我使用cygwin在windows 7中使用hadoop。
我需要每次执行以下步骤来启动五个守护进程,如
Start the namenode in the first window by executing
cd hadoop
bin/hadoop namenode
Start the secondary namenode in the second window by ex