
私は Linux 初心者で、ubuntu 14.04 を使い始めたばかりです。rc.local ファイルを編集して、起動時に imwheel プロセスを実行しようとしています。おそらく何か間違っているのでしょうか。ターミナルのように、名前だけでなくプログラムへのパスも入力する必要があるのでしょうか?
次を実行してチェックしようとすると:
sudo service rc.local start
以下のメッセージが表示されます:INFO:
imwheel started (pid=4906)
Could not open display, check shell DISPLAY variable, and export or setenv it!
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
答え1
imwheel は、X で実行される GUI アプリケーションです。rc.local ファイルの実行時には、X は実行されておらず、X DISPLAY も利用できません。
ログインすると X DISPLAY が表示されます。これを自動的に実行するには、スタートアップ アプリケーションの 1 つとして設定する必要があります。
Startup Applications
Ubuntu 起動ボタンの検索フィールドに「スタートアップ アプリケーション」と入力すると、設定にアクセスできます。
をクリックしAdd
、3 つのフィールドに次の内容を入力します。
- エントリの名前(任意の名前)
- コマンド(この場合)
imwheel
- コメント(オプション - 何をするか思い出すため)
クリックしてAdd
新しいスタートアップ アプリケーションを保存し、ウィンドウを閉じます。