Linux设置开机自启动的方式

方式1:shell脚本

将写好的脚本(.sh文件)放到下面的目录,系统启动后该目录下的shell文件都会执行。

cd /etc/profile.d/

编写shell文件,比如本例需要将docker加入开机启动项。 

#!/bin/bash

systemctl start docker

方式2:systemctl命令

systemctl enable docker

        

你可能感兴趣的:(Linux,linux,运维,centos)