自动运行startx后运行脚本 [英] Running a script after startx automatically
问题描述
使用我的树莓派,我设法自动登录用户圆周率,然后自动启动tomcat,然后启动X服务器也是如此。
With my Raspberry Pi, I managed to login pi user automatically, then start tomcat automatically and then start X server as well.
对于那些有兴趣,
自动登录:
For those interested, auto login:
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
而不是
1:2345:respawn:/sbin/getty 115200 tty1
在/ etc / inittab文件
in /etc/inittab
和
sh /home/pi/apache-tomcat-7.0.47/bin/startup.sh
su -l pi -c startx
exit 0
在/etc/rc.local中
in /etc/rc.local
现在,我想推出一个Java程序(JAR文件),我做了,服务器X启动后自动运行。我怎么能这样做呢?
Now, I'd like to launch a java program (jar file) that I made, automatically after server X has started. How could I do that?
感谢您
更新:
在我Rapsberry,因为LXDE时, http://wiki.lxde.org/en/Autostart 解决我的问题。
推荐答案
startx的使用〜HOME / .xinitrc文件在X的启动时加载的程序
其中〜HOME是用户运行X的home目录[在这种情况下PI]
startx uses the ~HOME/.xinitrc file to load programs at the startup of X where ~HOME is the home directory of the user running X [ in this case pi]
请参见 http://www.x.org/archive /X11R6.8.1/doc/startx.1.html 获得的.xinitrc的例子
see http://www.x.org/archive/X11R6.8.1/doc/startx.1.html for an example of .xinitrc
这篇关于自动运行startx后运行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!