为什么/root/.bash_profile中的命令启动两次? [英] Why the command in /root/.bash_profile start twice?
问题描述
这是我的/root/.bash_profile
:
export DISPLAY=:42 && cd /home/df/SimulatedRpu-ex/bin && ./SimulatedRpu-V1 &
启动服务器时,我运行 ps aux |grep SimulatedRpu
,这是输出:
When I start my server,I run ps aux | grep SimulatedRpu
and here is the output:
root 2758 0.2 1.0 62316 20416 ? Sl 14:35 0:00 ./SimulatedRpu-V1
root 3197 0.5 0.9 61428 19912 pts/0 Sl 14:35 0:00 ./SimulatedRpu-V1
root 3314 0.0 0.0 5112 716 pts/0 S+ 14:35 0:00 grep SimulatedRpu
因此,有关该端口的程序打印错误消息已被使用.但是,为什么/root/.bash_profile
中的命令启动两次?请帮助我,谢谢!顺便说一句,我使用的是Redhat Enterprise 5.5
So,the program print error message about the port is already used.
But why the command in /root/.bash_profile
start twice?
Please help me,thank you!By the way,I use Redhat Enterprise 5.5
推荐答案
每次登录时都会读取该配置文件.因此,只需登录即可运行 ps aux |.grep SimulatedRpu
,您将再次运行配置文件,从而开始新的过程.
The profile is read every time you log in. So just by logging in to run the ps aux | grep SimulatedRpu
, you run the profile once more and thus start a new process.
您应该将命令放入 init脚本.
,您还应该在同一脚本中运行 Xvnc
-这样,您就可以与应用一起启动和停止显示服务器.
You should also run Xvnc
in the same script - that way, you can start and stop the display server together with your app.
这篇关于为什么/root/.bash_profile中的命令启动两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!