supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* run script for postfix..
@ 2006-05-05 23:17 Jack Cummings
  2006-05-06  0:54 ` Charlie Brady
  0 siblings, 1 reply; 3+ messages in thread
From: Jack Cummings @ 2006-05-05 23:17 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 720 bytes --]


Here's a condensed version of the run script from:

http://www-dt.e-technik.uni-dortmund.de/~ma/postfix/daemontools.html                                                               

Notes:

    - the postfix 'master' process needs to run under a process supervisor

---
#!/bin/sh -e

export PATH=$(postconf -h command_directory):$(postconf -h daemon_directory):${PATH}

master -t || postfix stop 
postfix check 
exec master  >/dev/null 2>&1
---


--
Jack (John) Cummings                           http://mudshark.org/
PGP fingerprint: 0774 D073 E386 B70B 6B16  2D2B 1DD8 F8B0 CCF0 FAEE
Now playing on Prime:    Summer -- Alien Ant Farm
Now playing on Remedial: Learning to Fly -- Pink Floyd

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: run script for postfix..
  2006-05-05 23:17 run script for postfix Jack Cummings
@ 2006-05-06  0:54 ` Charlie Brady
  2006-05-06 17:33   ` Jack Cummings
  0 siblings, 1 reply; 3+ messages in thread
From: Charlie Brady @ 2006-05-06  0:54 UTC (permalink / raw)
  Cc: supervision


On Fri, 5 May 2006, Jack Cummings wrote:

> ---
> #!/bin/sh -e
>
> export PATH=$(postconf -h command_directory):$(postconf -h daemon_directory):${PATH}
>
> master -t || postfix stop
> postfix check
> exec master  >/dev/null 2>&1
                ***************

Those bits are likely unwise. Throwing away error output is always a bad 
idea.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: run script for postfix..
  2006-05-06  0:54 ` Charlie Brady
@ 2006-05-06 17:33   ` Jack Cummings
  0 siblings, 0 replies; 3+ messages in thread
From: Jack Cummings @ 2006-05-06 17:33 UTC (permalink / raw)
  Cc: supervision

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

On Fri, May 05, 2006 at 08:54:34PM -0400, Charlie Brady wrote:
 
> Those bits are likely unwise. Throwing away error output is always a 
> bad idea.

Agreed. Here's a better version:

--- 
#!/bin/sh -e

export PATH=$(postconf -h command_directory):$(postconf -h daemon_directory):${PATH}

master -t || postfix stop 
postfix check 
exec master 

# Notes:
#
#  - use ksh for versions of sh that don't support $()
#
#  - master does a setsid(). This will fail if it already is a process leader ;
#  if it is run from a shell 
#
#  - postfix is not intended to run from daemotools, and as such "postfix stop"
#  no longer works as intended by the author. 
--- 

--
Jack (John) Cummings                           http://mudshark.org/
PGP fingerprint: 0774 D073 E386 B70B 6B16  2D2B 1DD8 F8B0 CCF0 FAEE
Now playing on Prime:    Egg -- Mr. Bungle
Now playing on Remedial: Life Beyond the Minimum Safe Distance -- Matthew Good Band

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-06 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-05 23:17 run script for postfix Jack Cummings
2006-05-06  0:54 ` Charlie Brady
2006-05-06 17:33   ` Jack Cummings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).