我想实现两件事:
1.自动登录
2.自动登录后运行/scripts/bootstrap.sh
(前台不后台)。
我尝试使用 /etc/systemd/system/...
并将我的脚本作为服务运行,但它始终在后台运行。我也尝试通过 /etc/rc.local
运行它,但它在我不想要的登录提示之前开始运行。
任何帮助将不胜感激。谢谢!
最佳答案
/usr/share/xsessions/bootstrap.desktop
[Desktop Entry]
Name=bootstrap
Comment=Auto start without password
Exec=xterm -e /scripts/bootstrap.sh
#Exec=xterm
Type=Application
Terminal=true
/etc/lightdm/lightdm.conf
[Seat:*]
autologin-user=user
autologin-session=bootstrap
xserver-command=X -s 0 -dpms
关于linux - 使用 super 用户访问权限自动登录并在 Ubuntu 服务器 16.04.2 LTS 中运行我的脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42860909/