Project

General

Profile

Bug #3454

SMF should log actions performed

Added by Nate Fitch almost 8 years ago.

Status:
New
Priority:
Normal
Category:
cmd - userland programs
Start date:
2013-01-09
Due date:
% Done:

0%

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

Description

SMF needs commands executed and reasons for execution logged for historical debugging. For example, given this manifest:

$ svccfg export net/haproxy
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
  <service name='net/haproxy' type='service' version='0'>
    <create_default_instance enabled='false'/>
    <single_instance/>
    <dependency name='network' grouping='require_all' restart_on='error' type='service'>
      <service_fmri value='svc:/milestone/network:default'/>
    </dependency>
    <dependency name='filesystem' grouping='require_all' restart_on='error' type='service'>
      <service_fmri value='svc:/system/filesystem/local'/>
    </dependency>
    <exec_method name='start' type='method' exec='/opt/local/sbin/haproxy -f %{config_file} -D' timeout_seconds='60'/>
    <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'/>
    <property_group name='startd' type='framework'>
      <propval name='duration' type='astring' value='contract'/>
      <propval name='ignore_error' type='astring' value='core,signal'/>
    </property_group>
    <property_group name='application' type='application'>
      <propval name='config_file' type='astring' value='/opt/local/etc/haproxy.cfg'/>
    </property_group>
    <stability value='Evolving'/>
    <template>
      <common_name>
        <loctext xml:lang='C'>HAProxy</loctext>
      </common_name>
    </template>
  </service>
</service_bundle>

When running svcadm enable haproxy, smf would log something like:

Jan 08 06:20:28/236: net/haproxy executing: /opt/local/sbin/haproxy -f /opt/local/etc/haproxy.cfg -D
Other helpful log entries:
  1. Log when SMF detects that a process has died (exit code, etc) and what it is doing.</li>
  2. Log when SMF puts a service in maintenance.</li>
  3. Log when SMF kills a process.</li>
  4. When SMF configuration has changed.</li>

No data to display

Also available in: Atom PDF