>> Btw, why is the whole Dovecot system shutting down due to a bug in the
>> 'imap' subprocess? It's rather annoying for the rest of the users...
> 
> It shouldnt' be.
> 
>> May 20 15:16:32 ifm.liu.se dovecot: [ID 107833 mail.info] IMAP(inand):
>> Server shutting down
> 
> Do you mean you didn't cause this manually?

Right.

Hmm.. I wonder if it might be due to the Solaris SMF system seeing the
coredump (and/or signals) and deciding that the system
it is monitoring has failed and thus shuts it down. (I use SMF to handle
Dovecot).

Ah! Yes, that's why!


# tail -18 /var/svc/log/network-dovecot:default.log
[ May 20 15:16:32 Stopping because process dumped core. ]
[ May 20 15:16:32 Executing stop method (:kill) ]
[ May 20 15:17:02 Method or service exit timed out.  Killing contract 6893 ]
[ May 20 15:24:03 Leaving maintenance because clear requested. ]
[ May 20 15:24:03 Enabled. ]
[ May 20 15:24:04 Executing start method ("/ifm/sbin/start_dovecot") ]
[ May 20 15:24:04 Method "start" exited with status 0 ]
[ May 20 19:42:25 Stopping because process dumped core. ]
[ May 20 19:42:25 Executing stop method (:kill) ]
[ May 20 19:42:56 Method or service exit timed out.  Killing contract 7854 ]
[ May 20 21:26:45 Leaving maintenance because clear requested. ]
[ May 20 21:26:45 Enabled. ]
[ May 20 21:26:46 Executing start method ("/ifm/sbin/start_dovecot") ]
[ May 20 21:26:46 Method "start" exited with status 0 ]
[ May 21 08:35:34 Stopping because process dumped core. ]
[ May 21 08:35:34 Executing stop method (:kill) ]
[ May 21 08:35:34 Executing start method ("/ifm/sbin/start_dovecot") ]
[ May 21 08:35:34 Method "start" exited with status 0 ]

Hmm...

Ah! The Solaris SMF FAQ 4.5 has a good answer on how to fix that.
Add the following to the Solaris SMF manifest that controls Dovecot:

<property_group name='startd' type='framework'>
        <propval name='ignore_error' type='astring'
                value='core,signal' />
</property_group>

Please find enclosed an updated Solaris SMF manifest that others might
be interested in using on Solaris 10/OpenSolaris systems...

- Peter
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<!--
	Author 2008-05-21 Peter Eriksson ([EMAIL PROTECTED])

	This manifest can be used to manage the Dovecot daemon using the 
	Solaris SMF subsystem.

	Import this manifest using: 

		svccfg -v import dovecot.xml
	
        Then activate the daemon with:

		svcadm enable network/dovecot:default
-->

<service_bundle type='manifest' name='dovecot'>

<service
	name='network/dovecot'
	type='service'
	version='1'>

	<!-- Need / & /usr filesystems mounted, /var mounted read/write -->
	<dependency
		name='fs-local'
		type='service'
		grouping='require_all'
		restart_on='none'>
		<service_fmri value='svc:/system/filesystem/local' />
	</dependency>

	<!-- Need remote filesystems available, uncomment if using local mail store -->
        <dependency
                name='fs-autofs'
                type='service'
                grouping='require_all'
                restart_on='none'>
                <service_fmri value='svc:/system/filesystem/autofs' />
        </dependency>

	<!-- Need network services running -->
        <dependency
            name='network-service'
            grouping='require_all'
            restart_on='none'
            type='service'>
                <service_fmri value='svc:/network/service' />
        </dependency>

	<!-- Need name services running -->
        <dependency
            name='name-services'
            grouping='require_all'
            restart_on='refresh'
            type='service'>
                <service_fmri value='svc:/milestone/name-services' />
        </dependency>

        <exec_method
                type='method'
                name='stop'
                exec=':kill'
                timeout_seconds='30'>
        </exec_method>

	<!-- Do not fail the service if a subprocess (like imapd) coredumps -->
	<property_group name='startd' type='framework'>
        	<propval name='ignore_error' type='astring'
                	value='core,signal' />
	</property_group>

        <instance name='default' enabled='false'>

	<exec_method
		type='method'
		name='start'
		exec='/ifm/sbin/dovecot -c /etc/dovecot.conf'
		timeout_seconds='60'>
	</exec_method>

	</instance>

	<stability value='Evolving' />

	<template>
		<common_name>
			<loctext xml:lang='C'>
			Dovecot IMAP/POP3 server
			</loctext>
		</common_name>
		<documentation>
			<manpage title='dovecot' section='1' manpath='/usr/share/man' />
		</documentation>
	</template>
</service>

</service_bundle>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to