我在前台启动了我的程序(一个守护程序),然后我用它杀了它kill -9,但我得到了一个僵尸,我无法杀死它kill -9.如何杀死僵尸进程?
如果僵尸是一个死的进程(已经被杀死),我如何从输出中删除它ps aux?
root@OpenWrt:~# anyprogramd &
root@OpenWrt:~# ps aux | grep anyprogram
1163 root 2552 S anyprogramd
1167 root 2552 S anyprogramd
1169 root 2552 S anyprogramd
1170 root 2552 S anyprogramd
10101 root 944 S grep anyprogram
root@OpenWrt:~# pidof anyprogramd
1170 1169 1167 1163
root@OpenWrt:~# kill -9 1170 1169 1167 1163
root@OpenWrt:~# ps aux |grep anyprogram
1163 root 0 Z [cwmpd]
root@OpenWrt:~# kill -9 1163
root@OpenWrt:~# ps aux |grep anyprogram
1163 …Run Code Online (Sandbox Code Playgroud) 让我的模拟器SD卡工作时我遇到了麻烦......我用新的SD卡创建了一个新的AVD设备.
那么如何将数据放到它上面呢?我发现要在Daemon工具上安装的"正确"文件,但是已损坏或根本无法读取...
如果你有任何想法会很棒:)
所以我的问题出现在前几天通过iPhone配置实用程序查看一些iOS 7.0.x设备的控制台输出.我很困惑地看到几个迹象表明WiFi守护进程无缘无故地注册WiFi rssi活动(没有后台应用程序活动/推送消息待处理等等).这些都在控制台中以耦合记录的形式出现:
Mar xx xx:xx:xx iDevice wifid[xx] <Notice>: WiFi:[406330748.823677]:
Mar xx xx:xx:xx iDevice wifid[xx] <Notice>: Too frequent(1.822344 secs) rssi event from driver
Mar xx xx:xx:xx iDevice wifid[xx] <Notice>: WiFi:[406330748.895756]:
Mar xx xx:xx:xx iDevice wifid[xx] <Notice>: Too frequent(0.835468 secs) rssi event from driver, ignoring
Run Code Online (Sandbox Code Playgroud)
...等等.令我担心的是,上面的行每隔一秒左右重复一次,似乎永远不会结束.
现在我不是任何形式的程序员,但了解UNIX的一些基础知识,我已经设法得出结论,WiFi守护程序占用了大量的CPU时间,如使用终端的最高分解所示,这可能表明这可能(或不是)是我最近在这些设备中遇到电池寿命不佳的原因.
接下来,我显然会问你们所有人是否熟悉上面提到的行为,如果有的话,那么"噪音"的来源是什么呢?
使用GNU parallel:http://www.gnu.org/software/parallel/
我有一个程序,需要两个参数,例如
$ ./prog file1 file2
$ ./prog file2 file3
...
$ ./prog file23456 file23457
Run Code Online (Sandbox Code Playgroud)
我正在使用生成文件名对的脚本,但这会产生问题,因为脚本的结果是单个字符串 - 而不是一对.喜欢:
$ ./prog "file1 file2"
Run Code Online (Sandbox Code Playgroud)
GNU parallel 似乎有一大堆技巧,我想知道是否有一个用于在分隔符周围分割文本:
$ generate_file_pairs | parallel ./prog ?
# where ? is text under consideration, like "file1 file2"
Run Code Online (Sandbox Code Playgroud)
简单的解决方法是在prog中手动拆分args,但我想知道它是否可能GNU parallel.
我想使用该query操作搜索Wikipedia .我正在使用这个网址:
http://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=apple
这有效,但我想进入搜索的第一个结果.我怎样才能做到这一点?
注意:当只有一个结果时,该URL工作正常.我只需要标题和一些简短描述.
我知道
program1 | program2
Run Code Online (Sandbox Code Playgroud)
和
program1 | tee outputfile | program2
Run Code Online (Sandbox Code Playgroud)
但有没有办法将program1的输出提供给program2和program3?
我在这里的代码中创建了/ etc/defaults /中的celeryd文件:
https://github.com/celery/celery/blob/3.0/extra/generic-init.d/celeryd
现在当我想将celeryd作为一个守护进程运行并执行此操作时:sudo /etc/init.d/celerdy它说命令未找到.我哪里错了?
在Bash中,可以通过追加在后台执行命令&.我怎么能在Python中做到这一点?
while True:
data = raw_input('Enter something: ')
requests.post(url, data=data) # Don't wait for it to finish.
print('Sending POST request...') # This should appear immediately.
Run Code Online (Sandbox Code Playgroud)