- 编写启动脚本:
vim srvd#!/bin/bash function start() { # 启动命令 } function stop() { # 停止命令 } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo "Usage : start | stop | restart" ;; esac
- 加入系统启动文件夹:
chmod a+x srvd cp -arf srvd /etc/init.d/
- 手动启动:
systemctl start srvd
- 设置开机自启动:
chkconfig --add srvd chkconfig srvd on
centos7编写自启动脚本
猜你喜欢
转载自blog.51cto.com/12173069/2118590
今日推荐
周排行