Sha256: 1c1f89e4552e1aec15d1788105db92e23e533927475549a1387cfd44feb53ded

Contents?: true

Size: 1.04 KB

Versions: 289

Compression:

Stored size: 1.04 KB

Contents

#!/sbin/sh

. /lib/svc/share/smf_include.sh

[[ -z "${SMF_FMRI}" ]] && exit $SMF_EXIT_ERR

typeset -r CONF_FILE=/etc/puppet/puppet.conf
[[ ! -f "${CONF_FILE}" ]] && exit $SMF_EXIT_ERR_CONFIG

typeset -r PUPPET=/usr/bin/puppet

case "$1" in
start)
  exec $PUPPET agent
  ;;

stop)
  # stop sends sigterm first followed by sigkill
  # smf_kill_contract <CTID> TERM 1 30
  # sends sigterm to all process in ctid and will continue
  # to do so for 30 seconds with interval of 5 seconds
  # smf_kill_contract <CTID> KILL 1
  # continues until all processes are killed.
  # svcs -p <fmri> lists all processes in the contract.
  # http://bnsmb.de/solaris/My_Little_SMF_FAQ.html
  ctid=`svcprop -p restarter/contract $SMF_FMRI`
  if [ -n "$ctid" ]; then
    smf_kill_contract $ctid TERM 1 5
    ret=$?
    [ $ret -eq 1 ] && exit $SMF_EXIT_ERR_FATAL

    if [ $ret -eq 2 ] ; then
      smf_kill_contract $ctid KILL 1
      [ $? -ne 0 ] && exit $SMF_EXIT_ERR_FATAL
    fi
  fi
  ;;
*)
  echo "Usage: $0 {start|stop}";
  exit $SMF_EXIT_ERR_FATAL
  ;;
esac
exit $SMF_EXIT_OK

Version data entries

289 entries across 289 versions & 3 rubygems

Version Path
puppet-5.3.7 ext/ips/puppet-agent
puppet-5.3.7-x86-mingw32 ext/ips/puppet-agent
puppet-5.3.7-x64-mingw32 ext/ips/puppet-agent
puppet-5.3.7-universal-darwin ext/ips/puppet-agent
puppet-4.10.12 ext/ips/puppet-agent
puppet-4.10.12-x86-mingw32 ext/ips/puppet-agent
puppet-4.10.12-x64-mingw32 ext/ips/puppet-agent
puppet-4.10.12-universal-darwin ext/ips/puppet-agent
puppet-4.10.11 ext/ips/puppet-agent
puppet-4.10.11-x86-mingw32 ext/ips/puppet-agent
puppet-4.10.11-x64-mingw32 ext/ips/puppet-agent
puppet-4.10.11-universal-darwin ext/ips/puppet-agent
puppet-5.3.6 ext/ips/puppet-agent
puppet-5.3.6-x86-mingw32 ext/ips/puppet-agent
puppet-5.3.6-x64-mingw32 ext/ips/puppet-agent
puppet-5.3.6-universal-darwin ext/ips/puppet-agent
puppet-5.3.5 ext/ips/puppet-agent
puppet-5.3.5-x86-mingw32 ext/ips/puppet-agent
puppet-5.3.5-x64-mingw32 ext/ips/puppet-agent
puppet-5.3.5-universal-darwin ext/ips/puppet-agent