Project

General

Profile

Bug #7292

smf log message could be clearer when stop method exits with processes running

Added by David Pacheco almost 4 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Start date:
2016-08-11
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Here's the manifest for a simple service:

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!-- 
    Manifest automatically generated by smfgen.
 -->
<service_bundle type="manifest" name="application-daptest" >
    <service name="application/daptest" type="service" version="1" >
        <create_default_instance enabled="true" />
        <dependency name="dep0" grouping="require_all" restart_on="error" type="service" >
            <service_fmri value="svc:/milestone/multi-user:default" />
        </dependency>
        <exec_method type="method" name="start" exec="sleep 300 &amp;" timeout_seconds="10" />
        <exec_method type="method" name="stop" exec="echo nope" timeout_seconds="30" />
        <template >
            <common_name >
                <loctext xml:lang="C" >dap testing service</loctext>
            </common_name>
        </template>
    </service>
</service_bundle>

The start method invokes "sleep 300" in the background, and the stop method essentially does nothing but echo "nope" to stdout.

I can import this, and the log says:

[ Aug 11 00:01:34 Enabled. ]
[ Aug 11 00:01:34 Rereading configuration. ]
[ Aug 11 00:01:34 Executing start method ("sleep 300 &"). ]
[ Aug 11 00:01:34 Method "start" exited with status 0. ]

Now if I disable the service, this eventually times out because the stop method didn't actually kill all processes in the contract:

[ Aug 11 00:01:42 Stopping because service disabled. ]
[ Aug 11 00:01:42 Executing stop method ("echo nope"). ]
nope
[ Aug 11 00:01:42 Method "stop" exited with status 0. ]
[ Aug 11 00:02:13 Method or service exit timed out.  Killing contract 1946678. ]

That's basically all fine, but it would be nice if the final log message was a little more specific about what happened. What I think it's saying is that "either the method or the service exit has timed out". But it knows the stop method has already exited (which is what I found confusing). What actually happened was that the stop method exited, and processes were still running when the timeout was reached.

Also available in: Atom PDF