ログインする前にバックグラウンドでChromeを起動する方法は?

ログインする前にバックグラウンドでChromeを起動する方法は?

次のようにログインする前に、バックグラウンドでChromeを起動してみました。

/etc/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.
#

su --login juan /home/juan/bin/scripts/initChrome.sh
exit 0

これは

#!/bin/bash

/opt/google/chrome/google-chrome --no-startup-window;

何らかの理由で開始されませんでした。何が起こっているかを確認するためにテストしましたが、次のエラーが発生しました。

root@JuanDavid:/home/juan# su --login juan /home/juan/bin/scripts/initChrome.sh
[1108/125347.857986:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/8a03449b-2ed2-4f12-bdd0-97a08ee7791d.lock: File exists (17)
[1108/125347.858034:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/3660d16c-2f07-4ad1-8589-452fe1bc22ba.lock: File exists (17)
[1108/125347.858044:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/df78db7b-7e60-4493-b7a4-66edee2faf8d.lock: File exists (17)
[1108/125347.858072:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/a8af800b-6c31-4865-aae0-56aebb913c1f.lock: File exists (17)
[33595:33595:1108/125347.903116:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[33595:33595:1108/125347.903152:ERROR:env.cc(255)] The platform failed to initialize.  Exiting.
[1108/125347.972651:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/8a03449b-2ed2-4f12-bdd0-97a08ee7791d.lock: File exists (17)
[1108/125347.972696:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/3660d16c-2f07-4ad1-8589-452fe1bc22ba.lock: File exists (17)
[1108/125347.972706:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/df78db7b-7e60-4493-b7a4-66edee2faf8d.lock: File exists (17)
[1108/125347.972730:ERROR:file_io_posix.cc(152)] open /home/juan/.config/google-chrome/Crash Reports/pending/a8af800b-6c31-4865-aae0-56aebb913c1f.lock: File exists (17)
[33626:33626:1108/125348.017772:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[33626:33626:1108/125348.017810:ERROR:env.cc(255)] The platform failed to initialize.  Exiting.

dice que el error se debe a que:

エラー:ozone_platform_x11.cc(239)] Xサーバーまたは$ DISPLAYがありません

ログイン時にChromeの背景を起動したら、Chromeがロードされるのを待つ必要がありますが、これが私が避けたいことです。

私の目標は、Windowsと同様に、Linuxで初めてChromeを開くようにすることです。

ベストアンサー1

おすすめ記事