ubuntu新开机启动方法

2440阅读 0评论2018-12-13 帅得不敢出门
分类:LINUX

bashrc, profile   init.d的方式新的版本不好用了,弄半天没效果,最后用systemctl来实现开机启动程序

创建新建文件 /lib/systemd/system/my.service
内容如下:
[Unit]
Description=run_auto

[Service]
Type=forking
ExecStart=/home/xx/run_auto

[Install]
WantedBy=multi-user.target

创建一个链接
sudo ln -s  /lib/systemd/system/my.service    /etc/systemd/system/multi-user.target.wants/my.service

手动启动sudo systemctl start  my.service
--------------------- 
作者:帅得不敢出门 
上一篇:target使用overlay实现在squashfs只读区写操作
下一篇:windows安装adb方法及问题解决