0
点赞
收藏
分享

微信扫一扫

ubuntu制作为镜像boot.service自启动


1、创建boot.service,并将其push到此路径下。

/etc/systemd/system/boot.service

[Unit]
Description=boot Application Servie
Requires=network.target
DefaultDependencies=no

[Service]
Type=oneshot
ExecStart=/work/boot.sh
RemainAfterExit=true
Restart=on-failure

[Install]
WantedBy=multi-user.target

2、创建软连接

ln -s /etc/systemd/system/boot.service /etc/systemd/system/multi-user.target.wants/boot.service

3、打包ubuntu镜像,烧录后,开机即启动了boot.service里面的可执行程序。

举报

相关推荐

0 条评论