Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4460518
  • 博文数量: 356
  • 博客积分: 10458
  • 博客等级: 上将
  • 技术积分: 4734
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-24 14:59
文章分类

全部博文(356)

文章存档

2020年(17)

2019年(9)

2018年(26)

2017年(5)

2016年(11)

2015年(20)

2014年(2)

2013年(17)

2012年(15)

2011年(4)

2010年(7)

2009年(14)

2008年(209)

分类: LINUX

2018-12-13 17:02:57

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
--------------------- 
作者:帅得不敢出门 
阅读(2284) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~