Sha256: 2a2b9c12e1226f732efca1bf874a65c15ba89c4480b38b730695ee86f967e2b7

Contents?: true

Size: 1.06 KB

Versions: 480

Compression:

Stored size: 1.06 KB

Contents

#!/sbin/sh

. /lib/svc/share/smf_include.sh

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

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

PUPPET=/opt/puppetlabs/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 30
    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

480 entries across 480 versions & 1 rubygems

Version Path
puppet-8.10.0 ext/solaris/smf/puppet
puppet-8.10.0-x86-mingw32 ext/solaris/smf/puppet
puppet-8.10.0-x64-mingw32 ext/solaris/smf/puppet
puppet-8.10.0-universal-darwin ext/solaris/smf/puppet
puppet-7.34.0 ext/solaris/smf/puppet
puppet-7.34.0-x86-mingw32 ext/solaris/smf/puppet
puppet-7.34.0-x64-mingw32 ext/solaris/smf/puppet
puppet-7.34.0-universal-darwin ext/solaris/smf/puppet
puppet-8.9.0 ext/solaris/smf/puppet
puppet-8.9.0-x86-mingw32 ext/solaris/smf/puppet
puppet-8.9.0-x64-mingw32 ext/solaris/smf/puppet
puppet-8.9.0-universal-darwin ext/solaris/smf/puppet
puppet-7.33.0 ext/solaris/smf/puppet
puppet-7.33.0-x86-mingw32 ext/solaris/smf/puppet
puppet-7.33.0-x64-mingw32 ext/solaris/smf/puppet
puppet-7.33.0-universal-darwin ext/solaris/smf/puppet
puppet-8.3.0 ext/solaris/smf/puppet
puppet-8.3.0-x86-mingw32 ext/solaris/smf/puppet
puppet-8.3.0-x64-mingw32 ext/solaris/smf/puppet
puppet-8.3.0-universal-darwin ext/solaris/smf/puppet