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.

echo "rc.local executed successfully" > /tmp/rclocal_executed

/usr/bin/synclient TapButton2=0
/usr/bin/synclient RightButtonAreaLeft=3
/usr/bin/tilda &

exit 0

命令

echo "rc.local executed successfully" > /tmp/rclocal_executed

成功执行,但其余的不是。.

我认为问题可能是这些命令应该在我登录后执行,而 rc.local 可能在操作系统启动时执行,因此它可能没有效果。.

如何在启动时执行指定的命令?

0
01.01.2014, 15:55
2 答案

问题是以下命令需要 X 服务器运行,但 rc.local 在 X 初始化之前执行,因此无法执行命令。.

解决方案 :

在 Ubuntu 12.04 中调用“启动应用程序”应用程序,并将这些命令放在那里。.

1
04.19.2019, 02:01

问题是以下命令需要 X 服务器运行,但 rc.local 在 X 初始化之前执行,因此无法执行命令。.

解决方案 :

在 Ubuntu 12.04 中调用“启动应用程序”应用程序,并将这些命令放在那里。.

1
04.19.2019, 02:01

標籤

相關問題