postfix启动脚本
使用该脚本是一定要注意postfix安装路径
#!/bin/bash
#
# postfix Postfix Mail Transger Agent
#
# chkconfig:
# description: Postfix is a Mail Transport Agent, which is the program that moves mail from one machine to another
# processname: master
# pidfile /var/spool/postfix/pid/master.pid
# config: /etc/postfix/main.cf
# config: /etc/postfix/master.cf # Source function library.
source /etc/rc.d/init.d/functions # Source networking configuation.
source /etc/sysconfig/network # Check that networking is up.
[ $NETWORKING = "no" ] && exit [ -x /usr/sbin/postfix ] || exit
[ -d /etc/postfix ] || exit
[ -d /var/spool/postfix ] || exit RETVAL=
prog="postfix" start() {
# Start daemons .
echo -n $"Starting postfix: "
/usr/bin/newaliases >/dev/null >&
/usr/sbin/postfix start >/dev/null >& && success || failure $"$prog start"
RETVAL=$?
[ $RETVAL -eq ] && touch /var/lock/subsys/postfix
echo
return $RETVAL
} stop() {
# Stop daemons .
echo -n $"Shutting down postfix: "
/usr/sbin/postfix stop >/dev/null >& && success || failure $"$prog stop"
RETVAL=$?
[ $RETVAL -eq ] && rm -f /var/lock/subsys/postfix
echo
return $RETVAL
} reload() {
echo -n $"Reloading postfix: "
/usr/sbin/postfix reload >/dev/null >& && success || failure $"$prog reload"
RETVAL=$?
echo
return $RETVAL
} abort() {
/usr/sbin/postfix abort >/dev/null >& && success || failure $"$prog abort"
return $?
} flush() {
/usr/sbin/postfix flush >/dev/null >& && success || failure $"$prog flush"
return $?
} check() {
/usr/sbin/postfix check >/dev/null >& && success || failure $"$prog check"
return $?
} restart() {
stop
start
} # See how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload)
reload
;;
abort)
abort
;;
flush)
flush
;;
check)
check
;;
status)
status master
;;
condrestart)
[ -f /var/lock/subsys/postfix ] && restart || :
;;
*)
echo $"Usage:$0 {start|stop|restart|reload|abort|flush|check|status|condrestart}"
exit
esac exit $?
#END
赋予执行权限:
# chmod 755 /etc/rc.d/init.d/postfix
将postfix添加到服务列表
chkconfig --add postfix
设置开机自启动
# chkconfig postfix on
postfix启动脚本的更多相关文章
- gitlab6 nginx配置和启动脚本
		
gitlab6 nginx配置和启动脚本 cheungmine 2013-10 最近把gitlab安装到了ubuntu12.04.3的虚拟机上了.参考: https://github.com/gitl ...
 - Linux_自制系统服务启动脚本
		
目录 目录 前言 Case语句 Apache 启动脚本 Postfix service 启停脚本 前言 在Linux的某些系统服务中,需要自己定制启动服务的脚本.通常会使用Cash语句来实现. Cas ...
 - logstash服务启动脚本
		
logstash服务启动脚本 最近在弄ELK,发现logstash没有sysv类型的服务启动脚本,于是按照网上一个老外提供的模板自己进行修改 #添加用户 useradd logstash -M -s ...
 - 改进uwsgi启动脚本,使其支持多个独立配置文件
		
最近在研究flask,在架设运行环境的时候犯了难.因为我想把每个独立的应用像NGINX处理多个网站那样,每个应用单独一个配置文件.而网上流传的uwsgi启动脚本都只支持单个配置文件.虽然有文章说可以把 ...
 - linux nginx 启动脚本
		
linux nginx 启动脚本 [root@webtest76 ~]# vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the ...
 - busybox rootfs 启动脚本分析(二)
		
上次分析了busybox的启动脚本,这次分析一下init.d中一些脚本的内容. 参考链接 http://www.cnblogs.com/helloworldtoyou/p/6169678.html h ...
 - Tomcat启动脚本
		
记录一个比较好的tomcat启动脚本,截取<OneinStack>,修改如下两个参数即可用. 使用之前修改下面2个参数: #Location of JAVA_HOME (bin files ...
 - Linux Runlevel 启动 脚本
		
Linux 操作系统自从开始启动至启动完毕需要经历几个不同的阶段,这几个阶段就叫做 Runlevel,同样,当Linux操作系统关闭时也要经历另外几个不同的 Runlevel,下面详细介绍一下 Run ...
 - [Tomcat 源码分析系列] (二) : Tomcat 启动脚本-catalina.bat
		
概述 Tomcat 的三个最重要的启动脚本: startup.bat catalina.bat setclasspath.bat 上一篇咱们分析了 startup.bat 脚本 这一篇咱们来分析 ca ...
 
随机推荐
- .NET IL学习笔记(一)
			
参考资料: 1. <.NET IL Assembler> 2. NGEN代码产生器 3. NGEN的使用 4. IL编辑器下载 5. IL编辑器的使用 知识点: ● Common Lang ...
 - linux进程编程:子进程创建及执行函数简介
			
linux进程编程:子进程创建及执行函数简介 子进程创建及执行函数有三个: (1)fork();(2)exec();(3)system(); 下面分别做详细介绍.(1)fork() 函数定 ...
 - update
			
update `表名` set 字段名 =replace(字段名, '查找的内容','更改的内容') where 字段名 like '%查找的内容%'; update shangpin set cli ...
 - Android 如何解决数据库多线程锁的问题
			
防止多个线程又是读取又是写入 网上找到的方法: 对于这样的问题,解决的办法就是keep single sqlite connection,保持单个SqliteOpenHelper实例,同时对所有数据库 ...
 - C++  GPU && CPU
			
#include <amp.h> #include <iostream> #include <winbase.h> //操作系统的底层文件 using namesp ...
 - 并发编程 10—— 任务取消 之 关闭 ExecutorService
			
Java并发编程实践 目录 并发编程 01—— ThreadLocal 并发编程 02—— ConcurrentHashMap 并发编程 03—— 阻塞队列和生产者-消费者模式 并发编程 04—— 闭 ...
 - js实现继承
			
js是门灵活的语言,实现一种功能往往有多种做法,ECMAScript没有明确的继承机制,而是通过模仿实现的,根据js语言的本身的特性,js实现继承有以下通用的几种方式1.使用对象冒充实现继承(该种实现 ...
 - bzoj 3109: [cqoi2013]新数独
			
#include<cstdio> #include<iostream> using namespace std; ][],li[][],xi[][],a[][],bh[][], ...
 - 建筑行业如何用BPM替换OA?
			
2015年4月,K2正式与上海水石建筑规划设计有限公司签约. 为提高公司运作流程的效率,有效的对各流程的运作管理和优化,降低成本,同时提高公司的资金管理水平,水石公司利用K2系统作为整个公司流程的管理 ...
 - Struts1的核心对象
			
1.ActionServlet.ActionMapping.ActionForm.ActionForward 2.config = "/WEB-INF/struts-config.xml&q ...