/etc/rc.local 中的自定义脚本 - 无法正确启动 X

/etc/rc.local 中的自定义脚本 - 无法正确启动 X

我创建了一个名为starter.sh的脚本:

#!/bin/bash

while true; do
sudo fluxbox & 

sudo -u pi epiphany-browser -a --profile ~/.config http://localhost/index.php &
sleep 2s

done;

在 /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.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

sudo  xinit /home/lustron/Lustron/starter.sh - :0 -nocursor & 2>1  &
sleep 5s
sudo  python /home/lustron/Lustron/sensor5.py  &


exit 0

在 raspi-config 中,我命令 RPi 仅启动 shell,而不是 X 服务器。我可以看到,在 RPi 启动期间未加载 rc.local。当我使用以下命令手动执行 /etc/rc.local 时

sudo sh /etc/rc.local

我收到很多错误:

_XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
_XSERVTransOpen: transport open failed for inet6/Lustron:0
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6

X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-2-mx5 armv7l Debian
Current Operating System: Linux Lustron 4.0.8+ #805 PREEMPT Thu Jul 16 18:09:07 BST 2015 armv6l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1024 bcm2708_fb.fbheight=1280 bcm2708.boardrev=0x10 bcm2708.serial=0x92f55424 smsc95xx.macaddr=B8:27:EB:F5:54:24 bcm2708_fb.fbswap=1 bcm2708.disk_led_gpio=47 bcm2708.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Build Date: 11 February 2015  09:31:17PM
xorg-server 2:1.12.4-6+deb7u6 (Julien Cristau <[email protected]>)
Current version of pixman: 0.33.1
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Jul 26 16:12:48 2015
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
FATAL: Module g2d_23 not found.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Type "ONE_LEVEL" has 1 levels, but <RALT> has 2 symbols
>                   Ignoring extra symbols
Errors from xkbcomp are not fatal to the X server
Failed to read: session.ignoreBorder
Setting default value
Failed to read: session.forcePseudoTransparency
Setting default value
Failed to read: session.colorsPerChannel
Setting default value
Failed to read: session.doubleClickInterval
Setting default value
Failed to read: session.tabPadding
Setting default value
Failed to read: session.styleOverlay
Setting default value
Failed to read: session.slitlistFile
Setting default value

(等等等等。)

(...)

Failed to read: session.screen0.windowPlacement
Setting default value
BScreen::BScreen: an error occured while querying the X server.
        another window manager already running on display:0
Error: Couldn't find screens to manage.
Make sure you don't have another window manager running.

** (epiphany-browser:2973): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Failed to read: session.ignoreBorder

请帮忙!我该如何让它工作(要自动在信息亭模式下启动 Epiphany,我知道我可以使用

while true; do
 sudo matchbox-window-manager -use_cursor no -use_titlebar no &
 sudo -u lustron epiphany-browser -a --profile ~/.config http://localhost/index.php
 sleep 2s
done;

在 starter.sh 中,但是由于 X 服务器问题,它无法工作。

相关内容