开发了瘦客户机远程桌面登录程序,为了加快启动过程,在桌面启动前启动自己的图形界面程序
1.增加文件/etc/rc.d/rc.local 内容
#!/bin/bash
/usr/bin/mystartx
增加执行权限: chmod +x /etc/rc.d/rc.local
2. nano /lib/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.d/rc.local Compatibility
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.d/rc.local
After=network.target
[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no
[Install]
WantedBy=multi-user.target
3. cp /usr/bin/startx /usr/bin/mystartx
编辑 /usr/bin/mystartx
找到一行 $client" $clientargs -- "$server" $display $serverargs
在这一行的前面加入一行 client="/root/thinclient/thinclient" (自己要启动的图形界面程序)
4. 启动服务
systemctl enable rc-local.service
systemctl start rc-local.service