linux如何添加服务为系统服务快速启动或关闭
start)
echo $"bieanju notice: Apache now is Starting ……"
/bin/systemctl start httpd.service
echo -e $"bieanju notice:Start is \033[32m[OK]\033[0m";;
stop)
echo $"bieanju notice:iptabels now is Stop"
/bin/systemctl stop httpd.service
echo -e $"bieanju notice:Stop is OK";;
restart)
echo $"bieanju notice:iptabels now is Restarting"
/bin/systemctl restart httpd.service
echo $"bieanju notice:restart is OK";;
esac
exit
echo -e “\033[30m 黑色字 \033[0m”
echo -e “\033[31m 红色字 \033[0m”
echo -e “\033[32m 绿色字 \033[0m”
echo -e “\033[33m 黄色字 \033[0m”
echo -e “\033[34m 蓝色字 \033[0m”
echo -e “\033[35m 紫色字 \033[0m”
echo -e “\033[36m 天蓝字 \033[0m”
echo -e “\033[37m 白色字 \033[0m”
字背景颜色范围:40—–47
echo -e “\033[40;37m 黑底白字 \033[0m”
echo -e “\033[41;37m 红底白字 \033[0m”
echo -e “\033[42;37m 绿底白字 \033[0m”
echo -e “\033[43;37m 黄底白字 \033[0m”
echo -e “\033[44;37m 蓝底白字 \033[0m”
echo -e “\033[45;37m 紫底白字 \033[0m”
echo -e “\033[46;37m 天蓝底白字 \033[0m”
echo -e “\033[47;30m 白底黑字 \033[0m”
\33[0m 关闭所有属性
\33[1m 设置高亮度
\33[4m 下划线
\33[5m 闪烁
\33[7m 反显
\33[8m 消隐
\33[30m — \33[37m 设置前景色
\33[40m — \33[47m 设置背景色
\33[nA 光标上移n行
\33[nB 光标下移n行
\33[nC 光标右移n行
\33[nD 光标左移n行
\33[y;xH设置光标位置
\33[2J 清屏
\33[K 清除从光标到行尾的内容
\33[s 保存光标位置
\33[u 恢复光标位置
\33[?25l 隐藏光标
\33[?25h 显示光标
start)
echo -e $"bieanju notice: \033[32mApache\033[0m now is Starting ……"
/bin/systemctl start httpd.service
echo -e $"bieanju notice: \033[32mApache\033[0m is \033[32m[OK]\033[0m"
echo -e $"bieanju notice: \033[32mMysql\033[0m now is Starting ……"
/bin/systemctl start mysqld.service
echo -e $"bieanju notice: \033[32mMysql\033[0m is \033[32m[OK]\033[0m";;
stop)
echo -e $"bieanju notice: \033[32mApache\033[0m now is Stopping……"
/bin/systemctl stop httpd.service
echo -e $"bieanju notice: \033[32mApache\033[0m Stop is \033[32m[OK]\033[0m"
echo -e $"bieanju notice: \033[32mMysql\033[0m now is Stopping……"
/bin/systemctl stop mysqld.service
echo -e $"bieanju notice: \033[32mMysql\033[0m Stop is \033[32m[OK]\033[0m";;
restart)
echo -e $"bieanju notice: \033[32mApache\033[0m now is Restarting……"
/bin/systemctl restart httpd.service
echo -e $"bieanju notice: \033[32mApache\033[0m Restartting is \033[32m[OK]\033[0m"
echo -e $"bieanju notice: \033[32mMysql\033[0m now is Restarting……"
/bin/systemctl restart mysqld.service
echo -e $"bieanju notice: \033[32mMysql\033[0m Restartting is \033[32m[OK]\033[0m";;
esac
exit
linux如何添加服务为系统服务快速启动或关闭的更多相关文章
- LXPanel自定义添加应用程序到快速启动栏
LXPanel是Linux下LXDE项目的一个桌面面板软件.我一开始接触的时候,对于自己自定义的程序到快速启动栏绕了很多弯路,这里记录下,防止以后自己忘了.还有一点就是很多时候,panel下的应用程序 ...
- windows下快速启动或关闭系统服务方法
在windows下有些后台服务会开机自动启动. 用命令行方式启动关闭应用服务 使用sc.exe命令功能列表 修改服务启动类型的命令行格式为(特别注意start=后面有一个空格) sc config 服 ...
- Linux上添加服务(htttpd,samba等等)
service httpd restart 出现 httpd:unrecognized service 错误 vi /etc/rc.d/rc.local #在/etc/rc.d/rc.local中 ...
- Linux下Apache服务的查看和启动
cd到/etc/rc.d/init.d/目录,并列出该目录下的所有文件,看看是否有httpd 使用httpd -v查看已经安装的httpd的版本 使用rpm -qa | grep http ...
- Centos搭建nginx环境,编译,添加服务,开机启动。
首先安装所需的安装库,yum -y install gcc gcc-c++ autoconf libtool* openssl openssl-devel 编译的时候,若有提示错误,提示缺少某个库,y ...
- Windows下快速启动/关闭orcl服务
大家都知道windows下绝大部分都是图形操作化,很少用命令来执行,例如启动.关闭orcl数据库服务时,一般情况都是在任务管理器(taskmgr.ctrl+shift+esc)或服务(services ...
- 重装助手教你如何禁用Windows 10快速启动
快速启动是首先在Windows 8中实现并延续到Windows 10的功能,可在启动PC时提供更快的启动时间.它是一个方便的功能,也是大多数人在不知情的情况下使用的功能,但还有一些功能会在他们掌握新P ...
- Linux下chkconfig命令详解即添加服务以及两种方式启动关闭系统服务
The command chkconfig is no longer available in Ubuntu.The equivalent command to chkconfig is update ...
- linux chkconfig添加开机启动服务
--add:增加所指定的系统服务,让chkconfig指令得以管理它,并同时在系统启动的叙述文件内增加相关数据: --del:删除所指定的系统服务,不再由chkconfig指令管理,并同时在系统启动的 ...
随机推荐
- PHP 基础知识-数组
PHP 的数组主要分为: 索引数组 - 带有数字索引的数组 关联数组 - 带有指定键的数组 多维数组 - 包含一个或多个数组的数组 索引数组: 有两种创建索引数组的方法: 索引是自动分配的(索 ...
- WCF Endpoint分类
WCF中可以为一个Service配置多个Endpoint 这些Endpoint的分类方法有下面3中 1.全局就一个endpoint,一个接口公开所有的方法,这适合简单的业务场景 2.将endpoint ...
- WPF绑定属性
1.创建model类 model类要继承接口INotifyPropertyChanged,用于通知客户端属性值已更改 public class StudentModel : INotifyProper ...
- 1121 Django基本
目录 Django前戏 一.课程导读 1.web应用 2.c/s b/s 架构 3.Python Web框架 二.原生socket服务 三.http协议 什么是http协议 四大特性 http工作原理 ...
- 201871010111-刘佳华《面向对象程序设计(java)》课程学习总结
201871010111-刘佳华<面向对象程序设计(java)>课程学习总结 课程学习总结(45分) 经历了一个学期的<面向对象程序设计>课程学习,请每位同学完成以下任务: 点 ...
- Vue-main.js中的一些配置
import Vue from 'vue' import App from './App.vue' import router from './router' import store from '. ...
- 纯 css 控制隔行变色
使用::nth-child 选择器 tr:nth-child(odd) { background-color: #ccc; } tr:nth-child(even) { background-colo ...
- 【leetcode】1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
题目如下: Given a m x n matrix mat and an integer threshold. Return the maximum side-length of a square ...
- Codeforces Round #426 (Div. 2) B题【差分数组搞一搞】
B. The Festive Evening It's the end of July – the time when a festive evening is held at Jelly Castl ...
- Chrome浏览器设置自动启用Flash插件
Chrome浏览器设置自动启用Flash插件 1.打开Chrome浏览器,输入chrome://flags/#run-all-flash-in-allow-mode,打开,找到Enable Eph ...