ubuntu service 开机启动
2020-08-28 本文已影响0人
不合格码农
执行
$ systemctl cat getty@tty1 | grep Exec
输出
ExecStart=-/sbin/agetty --noclear %I $TERM
执行
sudo systemctl edit getty@tty1
在文本中输入
[Service]
ExecStart=
ExecStart=-/sbin/agetty -a <USERNAME> --noclear %I $TERM
执行
$ systemctl cat getty@tty1 | grep Exec
输出
ExecStart=-/sbin/agetty --noclear %I $TERM
ExecStart=
ExecStart=-/sbin/agetty -a <USERNAME> --noclear %I $TERM
执行
vi .profile
在文本中输入
if [[ "$(tty)" == "/dev/tty1" ]]
then
sh /data/keras-retinanet/sh/roslaunch.sh
fi