背景说明截至2020.11.17,SystemD已经打败新贵成为SystemV的接班人。CentOS7/8、Ubuntu18.04/20.04LTS默认配置SystemD。测试环境CentOS7测试步骤写入/root/tmp/qbit_startup.sh文件date>/root/tmp/qbit_startup.txt写入/usr/lib/systemd/system/qbit_startup.service文件[Unit]Description=customstartupscriptConditionPathExists=/root/tmp/qbit_startup.shAfter=network.target[Service]Type=forkingExecStart=/usr/bin/bash/root/tmp/qbit_startup.sh[Install]WantedBy=multi-user.target刷新配置sudosystemctldaemon-reloadstarttestsudosystemctlstartqbit_startupsetbootstartsudosystemctlenableqbit_startuprestarttest$cat/root/tmp/qbit_startup.txtTueNov1717:17:17CST2020本文来自qbitsnap
