我是 Linux 新手,刚开始使用 ubuntu 14.04。我试图通过编辑 rc.local 文件在启动时运行 imwheel 进程。也许我做错了什么,我需要输入一个程序路径,就像终端中的名字一样?
当我尝试通过运行进行检查时:
sudo service rc.local start
Run Code Online (Sandbox Code Playgroud)
我收到以下消息:INFO:
imwheel started (pid=4906)
Could not open display, check shell DISPLAY variable, and export or setenv it!
Run Code Online (Sandbox Code Playgroud)
rc.local 文件:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
imwheel
exit 0
Run Code Online (Sandbox Code Playgroud)
imwheel 是在 X 下运行的 GUI 应用程序。您没有运行 X,也没有在运行 rc.local 文件时可用的 X DISPLAY。
登录后,您将有一个 X DISPLAY。因此,要使其自动运行,您应该将其设置为启动应用程序之一。
您可以Startup Applications
通过在 Ubuntu 启动按钮搜索字段中输入“启动应用程序”来获取您的配置。
只需单击Add
,然后在三个字段中输入:
imwheel
单击Add
以保存新的启动应用程序,然后关闭窗口。