Thu Jul 23 17:12:16 2015 UTC ()
Implement "status" command for postfix - makes tools like ansible
happier.


(riz)
diff -r1.16 -r1.17 src/etc/rc.d/postfix

cvs diff -r1.16 -r1.17 src/etc/rc.d/postfix (expand / switch to unified diff)

--- src/etc/rc.d/postfix 2009/04/15 22:11:32 1.16
+++ src/etc/rc.d/postfix 2015/07/23 17:12:16 1.17
@@ -1,34 +1,35 @@ @@ -1,34 +1,35 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# $NetBSD: postfix,v 1.16 2009/04/15 22:11:32 perry Exp $ 3# $NetBSD: postfix,v 1.17 2015/07/23 17:12:16 riz Exp $
4# 4#
5 5
6# PROVIDE: mail 6# PROVIDE: mail
7# REQUIRE: LOGIN 7# REQUIRE: LOGIN
8# we make mail start late, so that things like .forward's are not 8# we make mail start late, so that things like .forward's are not
9# processed until the system is fully operational 9# processed until the system is fully operational
10 10
11$_rc_subr_loaded . /etc/rc.subr 11$_rc_subr_loaded . /etc/rc.subr
12 12
13name="postfix" 13name="postfix"
14rcvar=$name 14rcvar=$name
15postfix_command="/usr/sbin/${name}" 15postfix_command="/usr/sbin/${name}"
16required_files="/etc/${name}/main.cf" 16required_files="/etc/${name}/main.cf"
17start_precmd="postfix_precmd" 17start_precmd="postfix_precmd"
18start_cmd="postfix_op" 18start_cmd="postfix_op"
19stop_cmd="postfix_op" 19stop_cmd="postfix_op"
20reload_cmd="postfix_op" 20reload_cmd="postfix_op"
21extra_commands="reload" 21status_cmd="postfix_op"
 22extra_commands="reload status"
22spooletcdir="/var/spool/${name}/etc" 23spooletcdir="/var/spool/${name}/etc"
23postconf="/usr/sbin/postconf" 24postconf="/usr/sbin/postconf"
24required_dirs=$spooletcdir 25required_dirs=$spooletcdir
25 26
26_rebuild() { 27_rebuild() {
27 echo "${name}: rebuilding ${1} ($2 ${1}.db)" 28 echo "${name}: rebuilding ${1} ($2 ${1}.db)"
28 $($postconf -h newaliases_path) 29 $($postconf -h newaliases_path)
29} 30}
30 31
31postfix_precmd() 32postfix_precmd()
32{ 33{
33 # As this is called after the is_running and required_dir checks 34 # As this is called after the is_running and required_dir checks
34 # are made in run_rc_command(), we can safely assume ${spooletcdir} 35 # are made in run_rc_command(), we can safely assume ${spooletcdir}