Advertisement
Guest User

Untitled

a guest
May 25th, 2018
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. root@sfdpuppet01 ~
  2.  
  3. # echo $PATH
  4. /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/data/puppet/reductivelabs.git/puppet/bin:/data/puppet/reductivelabs.git/facter/bin
  5. root@sfdpuppet01
  6.  
  7.  
  8. # cat /etc/profile.d/puppet.sh
  9. PUPPET_PATH=/data/puppet/reductivelabs.git
  10. PATH=$PATH:$PUPPET_PATH/puppet/bin:$PUPPET_PATH/facter/bin
  11. RUBYLIB=$PUPPET_PATH/puppet/lib:$PUPPET_PATH/facter/lib
  12. export PATH RUBYLIB
  13.  
  14. THE INIT SCRIPT:
  15.  
  16.  
  17. #!/bin/bash
  18. # puppetmaster This shell script enables the puppetmaster server.
  19. #
  20. # Author: Duane Griffin <d.griffin@psenterprise.com>
  21. # Martin Vuk <martin.vuk@fri.uni-lj.si> (SuSE support)
  22. #
  23. # chkconfig: - 65 45
  24. #
  25. # description: Server for the puppet system management tool.
  26. # processname: puppetmaster
  27.  
  28. ### BEGIN INIT INFO
  29. # Provides: puppetmaster
  30. # Required-Start: $local_fs $network $syslog
  31. # Should-Start:
  32. # Required-Stop:
  33. # Default-Start: 3 4 5
  34. # Default-Stop: 0 1 2 6
  35. # Short-Description: puppetmaster
  36. # Description: Server for the puppet system management tool.
  37. ### END INIT INFO
  38.  
  39. #source /data/puppet/profile
  40. #source /etc/profile.d/puppet.sh
  41. #export PATH=/usr/bin:/sbin:/bin:/usr/sbin
  42.  
  43. #PUPPET_PATH=/data/puppet/reductivelabs.git
  44. #PATH=$PATH:$PUPPET_PATH/puppet/bin:$PUPPET_PATH/facter/bin
  45. #RUBYLIB=$PUPPET_PATH/puppet/lib:$PUPPET_PATH/facter/lib
  46. #export PATH RUBYLIB
  47.  
  48.  
  49.  
  50. #export PUPPET_PATH=/data/puppet/reductivelabs.git/puppet
  51. #export PATH=${PATH}:$PUPPET_PATH/bin
  52. #export FACTER_PATH=/data/puppet/reductivelabs.git/facter
  53. #export PATH=${PATH}:$FACTER_PATH/bin
  54. #. /data/puppet/profile
  55.  
  56.  
  57. # Redhat functions
  58. . /etc/rc.d/init.d/functions
  59.  
  60. RETVAL=0
  61.  
  62. # Run multiple puppetmasters on these ports
  63. PUPPETMASTERPORTS="8150 8151 8152 8153 8154"
  64.  
  65. # Locking and run stuff
  66. RUNDIR=/var/puppet/run
  67. LOCKDIR=/var/lock/subsys/
  68.  
  69. start() {
  70. local daemonargs=' --check $base --pidfile $pidfile'
  71.  
  72. for pmp in $PUPPETMASTERPORTS ; do
  73. local pmargs="--servertype mongrel --masterport $pmp --pidfile \$pidfile --daemonize"
  74. start_proc puppetmaster-$pmp $daemonargs puppetmasterd $pmargs
  75. done
  76.  
  77. #httpdargs="-f /etc/puppet/httpd.conf"
  78. #start_proc puppet-httpd $daemonargs httpd $httpdargs
  79. }
  80.  
  81. start_proc() {
  82. local base=$1
  83. local pidfile=$RUNDIR/$base.pid
  84. local lockfile=$LOCKDIR/$base
  85. shift
  86.  
  87. echo -n $"Starting $base: "
  88.  
  89. eval daemon $*
  90. RETVAL=$?
  91. [ $RETVAL = 0 ] && touch ${lockfile}
  92.  
  93. echo
  94. return $RETVAL
  95. }
  96.  
  97. stop() {
  98. #stop_proc puppet-httpd
  99.  
  100. for pmp in $PUPPETMASTERPORTS ; do
  101. stop_proc puppetmaster-$pmp
  102. done
  103. }
  104.  
  105. stop_proc() {
  106. local base=$1
  107. local pidfile=$RUNDIR/$base.pid
  108. local lockfile=$LOCKDIR/$base
  109.  
  110. echo -n $"Stopping $base: "
  111.  
  112. killproc -p $pidfile $base
  113. RETVAL=$?
  114. [ $RETVAL -eq 0 ] && rm -f "$lockfile"
  115.  
  116. echo
  117. return $RETVAL
  118. }
  119.  
  120. status_pm() {
  121. for pmp in $PUPPETMASTERPORTS ; do
  122. status_proc puppetmaster-$pmp
  123. done
  124.  
  125. status_proc puppet-httpd
  126. }
  127.  
  128. status_proc() {
  129. local base=$1
  130. local pidfile=$RUNDIR/$base.pid
  131. local lockfile=$LOCKDIR/$base
  132.  
  133. status -p $pidfile $base
  134. }
  135.  
  136. case "$1" in
  137. start)
  138. start
  139. ;;
  140.  
  141. stop)
  142. stop
  143. ;;
  144.  
  145. restart|reload|force-reload)
  146. stop
  147. start
  148. ;;
  149.  
  150. status)
  151. status_pm
  152. ;;
  153.  
  154. *)
  155. echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}"
  156. exit 1
  157. esac
  158.  
  159. exit $RETVAL
  160.  
  161.  
  162.  
  163.  
  164. BACKGROUND:
  165.  
  166. I had this all working fine with puppet installed from rpms. I wanted to move away from this and have our repo, and the puppet source pulling from a git pull so that its easier to merge, and give back. Since pulling down the repo from reductivelabs, and adding the new paths, it seems that its not finding things anymore. Not really sure why?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement