From 65b9869362cd39f20609abb93729cb0c3977f0cf Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Tue, 15 Jul 2008 17:15:05 +1000 Subject: Further moves from the examples directory and ext directory --- CHANGELOG | 2 + examples/etc/init.d/sleeper | 72 ++++++++++++++++++++++++++++++++++ examples/etc/otherfile | 0 examples/etc/puppet/fileserver.conf | 13 ++++++ examples/etc/puppet/namespaceauth.conf | 20 ++++++++++ examples/etc/puppet/puppet.conf | 10 +++++ examples/etc/puppet/tagmail.conf | 1 + ext/bin/sleeper | 67 +++++++++++++++++++++++++++++++ ext/root/bin/sleeper | 67 ------------------------------- ext/root/etc/configfile | 0 ext/root/etc/debian-passwd | 29 -------------- ext/root/etc/debian-syslog.conf | 71 --------------------------------- ext/root/etc/init.d/sleeper | 72 ---------------------------------- ext/root/etc/otherfile | 0 ext/root/etc/puppet/fileserver.conf | 13 ------ ext/root/etc/puppet/namespaceauth.conf | 20 ---------- ext/root/etc/puppet/puppet.conf | 10 ----- ext/root/etc/puppet/tagmail.conf | 1 - 18 files changed, 185 insertions(+), 283 deletions(-) create mode 100755 examples/etc/init.d/sleeper create mode 100644 examples/etc/otherfile create mode 100644 examples/etc/puppet/fileserver.conf create mode 100644 examples/etc/puppet/namespaceauth.conf create mode 100644 examples/etc/puppet/puppet.conf create mode 100644 examples/etc/puppet/tagmail.conf create mode 100755 ext/bin/sleeper delete mode 100755 ext/root/bin/sleeper delete mode 100644 ext/root/etc/configfile delete mode 100644 ext/root/etc/debian-passwd delete mode 100644 ext/root/etc/debian-syslog.conf delete mode 100755 ext/root/etc/init.d/sleeper delete mode 100644 ext/root/etc/otherfile delete mode 100644 ext/root/etc/puppet/fileserver.conf delete mode 100644 ext/root/etc/puppet/namespaceauth.conf delete mode 100644 ext/root/etc/puppet/puppet.conf delete mode 100644 ext/root/etc/puppet/tagmail.conf diff --git a/CHANGELOG b/CHANGELOG index 70c542118..a3d96323d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ 0.24.5 + Further moves from the examples directory and ext directory + Fixed #1397 One line fix, fail instead of log Moved debian to conf and updated examples directory diff --git a/examples/etc/init.d/sleeper b/examples/etc/init.d/sleeper new file mode 100755 index 000000000..6da5eae32 --- /dev/null +++ b/examples/etc/init.d/sleeper @@ -0,0 +1,72 @@ +#!/bin/bash + +# $Id$ + +script=$0 +path=`echo $script | sed 's/etc..*/bin/'` + +PATH=$PATH:$path + +ps=`facter ps` + +if [ -z "$ps" ]; then + ps="ps -ef" +fi + +function start +{ + cd $path + ./sleeper +} + +function stop +{ + #if [ -n `which pgrep` ]; then + # pid=`pgrep sleeper` + #else + pid=`$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'` + #fi + if [ -n "$pid" ]; then + kill $pid + fi +} + +function restart +{ + stop + start +} + +function status +{ + #if [ -n `which pgrep` ]; then + # cmd="pgrep sleeper" + #else + #cmd="$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'" + #fi + #$cmd + $ps | grep -v grep | grep sleeper | grep ruby +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop; start + ;; + status) + output=`status` + #status + exit $? + ;; + *) + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/examples/etc/otherfile b/examples/etc/otherfile new file mode 100644 index 000000000..e69de29bb diff --git a/examples/etc/puppet/fileserver.conf b/examples/etc/puppet/fileserver.conf new file mode 100644 index 000000000..32dfcdd5c --- /dev/null +++ b/examples/etc/puppet/fileserver.conf @@ -0,0 +1,13 @@ +# $Id$ + +[dist] + path /dist + allow *.madstop.com + +[plugins] + path /var/puppet/plugins + allow *.madstop.com + +[facts] + path /var/puppet/facts + allow *.madstop.com diff --git a/examples/etc/puppet/namespaceauth.conf b/examples/etc/puppet/namespaceauth.conf new file mode 100644 index 000000000..fb08d428b --- /dev/null +++ b/examples/etc/puppet/namespaceauth.conf @@ -0,0 +1,20 @@ +# This file is only necessary if your clients listen. +# Note that it affects all puppet daemons, including puppetmasterd, +# which is why puppetmaster is in there. +[fileserver] + allow *.madstop.com + +[puppetmaster] + allow *.madstop.com + +[pelementserver] + allow puppet.madstop.com + +[puppetrunner] + allow culain.madstop.com + +[puppetbucket] + allow *.madstop.com + +[puppetreports] + allow *.madstop.com diff --git a/examples/etc/puppet/puppet.conf b/examples/etc/puppet/puppet.conf new file mode 100644 index 000000000..151364ebd --- /dev/null +++ b/examples/etc/puppet/puppet.conf @@ -0,0 +1,10 @@ +[puppetd] +report = true +factsync = true +pluginsync = true + +[puppetmasterd] +reports = store,rrdgraph,tagmail,log +node_terminus = ldap +ldapserver = culain.madstop.com +ldapbase = dc=madstop,dc=com diff --git a/examples/etc/puppet/tagmail.conf b/examples/etc/puppet/tagmail.conf new file mode 100644 index 000000000..31c77f4bc --- /dev/null +++ b/examples/etc/puppet/tagmail.conf @@ -0,0 +1 @@ +all: user@domain.com diff --git a/ext/bin/sleeper b/ext/bin/sleeper new file mode 100755 index 000000000..980d66ac1 --- /dev/null +++ b/ext/bin/sleeper @@ -0,0 +1,67 @@ +#!/usr/bin/env ruby -w + +### +# sleep indefinitely as a debug + +require 'getoptlong' + +#----------------------------------------------------------------- +def daemonize + outfile = "/tmp/sleeperout" + if pid = fork() + Process.detach(pid) + sleep 1 + # verify that we didn't have any problems starting the daemon + if FileTest.exists?(outfile) + $stderr.puts "Sleeper failed: %s" % File.read(outfile) + File.unlink(outfile) + exit(14) + else + exit(0) + end + end + Process.setsid + Dir.chdir("/") + begin + $stdin.reopen "/dev/null" + $stdout.reopen "/dev/null", "a" + $stderr.reopen $stdin + rescue => detail + File.open(outfile, "w") { |f| + f.puts detail + } + exit(12) + end +end +#----------------------------------------------------------------- + +debug = false + +result = GetoptLong.new( + [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], + [ "--help", "-h", GetoptLong::NO_ARGUMENT ] +) + +result.each { |opt,arg| + case opt + when "--help" + puts "There is no help yet" + exit + when "--debug" + debug = true + else + raise "Invalid option '#{opt}'" + end +} + +trap(:INT) { + exit +} + +unless debug + daemonize() +end + +# Sleep for no more than two minutes +sleep 120 +exit diff --git a/ext/root/bin/sleeper b/ext/root/bin/sleeper deleted file mode 100755 index 980d66ac1..000000000 --- a/ext/root/bin/sleeper +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env ruby -w - -### -# sleep indefinitely as a debug - -require 'getoptlong' - -#----------------------------------------------------------------- -def daemonize - outfile = "/tmp/sleeperout" - if pid = fork() - Process.detach(pid) - sleep 1 - # verify that we didn't have any problems starting the daemon - if FileTest.exists?(outfile) - $stderr.puts "Sleeper failed: %s" % File.read(outfile) - File.unlink(outfile) - exit(14) - else - exit(0) - end - end - Process.setsid - Dir.chdir("/") - begin - $stdin.reopen "/dev/null" - $stdout.reopen "/dev/null", "a" - $stderr.reopen $stdin - rescue => detail - File.open(outfile, "w") { |f| - f.puts detail - } - exit(12) - end -end -#----------------------------------------------------------------- - -debug = false - -result = GetoptLong.new( - [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--help", "-h", GetoptLong::NO_ARGUMENT ] -) - -result.each { |opt,arg| - case opt - when "--help" - puts "There is no help yet" - exit - when "--debug" - debug = true - else - raise "Invalid option '#{opt}'" - end -} - -trap(:INT) { - exit -} - -unless debug - daemonize() -end - -# Sleep for no more than two minutes -sleep 120 -exit diff --git a/ext/root/etc/configfile b/ext/root/etc/configfile deleted file mode 100644 index e69de29bb..000000000 diff --git a/ext/root/etc/debian-passwd b/ext/root/etc/debian-passwd deleted file mode 100644 index 59cdf4acf..000000000 --- a/ext/root/etc/debian-passwd +++ /dev/null @@ -1,29 +0,0 @@ -root:x:0:0:root:/root:/bin/bash -daemon:x:1:1:daemon:/usr/sbin:/bin/sh -bin:x:2:2:bin:/bin:/bin/sh -sys:x:3:3:sys:/dev:/bin/sh -sync:x:4:65534:sync:/bin:/bin/sync -games:x:5:60:games:/usr/games:/bin/sh -man:x:6:12:man:/var/cache/man:/bin/sh -lp:x:7:7:lp:/var/spool/lpd:/bin/sh -mail:x:8:8:mail:/var/mail:/bin/sh -news:x:9:9:news:/var/spool/news:/bin/sh -uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh -proxy:x:13:13:proxy:/bin:/bin/sh -postgres:x:31:32:postgres:/var/lib/postgres:/bin/sh -www-data:x:33:33:www-data:/var/www:/bin/sh -backup:x:34:34:backup:/var/backups:/bin/sh -operator:x:37:37:Operator:/var:/bin/sh -list:x:38:38:Mailing List Manager:/var/list:/bin/sh -irc:x:39:39:ircd:/var/run/ircd:/bin/sh -gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh -nobody:x:65534:65534:nobody:/nonexistent:/bin/sh -sshd:x:102:65534::/var/run/sshd:/bin/false -gdm:x:101:101:Gnome Display Manager:/var/lib/gdm:/bin/false -telnetd:x:103:103::/usr/lib/telnetd:/bin/false -nagios:x:1000:1001::/home/nagios: -messagebus:x:104:107::/var/run/dbus:/bin/false -saned:x:109:109::/home/saned:/bin/false -ganglia:x:105:110:Ganglia Monitor:/var/lib/ganglia:/bin/false -zope:x:106:111::/var/lib/zope2.7/var:/bin/false -fbgetty:x:112:112::/home/fbgetty:/bin/false diff --git a/ext/root/etc/debian-syslog.conf b/ext/root/etc/debian-syslog.conf deleted file mode 100644 index 8f2925960..000000000 --- a/ext/root/etc/debian-syslog.conf +++ /dev/null @@ -1,71 +0,0 @@ -# /etc/syslog.conf Configuration file for syslogd. -# -# For more information see syslog.conf(5) -# manpage. - -# -# First some standard logfiles. Log by facility. -# - -auth,authpriv.* /var/log/auth.log -*.*;auth,authpriv.none -/var/log/syslog -#cron.* /var/log/cron.log -daemon.* -/var/log/daemon.log -kern.* -/var/log/kern.log -lpr.* -/var/log/lpr.log -mail.* -/var/log/mail.log -user.* -/var/log/user.log -uucp.* /var/log/uucp.log - -# -# Logging for the mail system. Split it up so that -# it is easy to write scripts to parse these files. -# -mail.info -/var/log/mail.info -mail.warn -/var/log/mail.warn -mail.err /var/log/mail.err - -# Logging for INN news system -# -news.crit /var/log/news/news.crit -news.err /var/log/news/news.err -news.notice -/var/log/news/news.notice - -# -# Some `catch-all' logfiles. -# -*.=debug;\ - auth,authpriv.none;\ - news.none;mail.none -/var/log/debug -*.=info;*.=notice;*.=warn;\ - auth,authpriv.none;\ - cron,daemon.none;\ - mail,news.none -/var/log/messages - -# -# Emergencies are sent to everybody logged in. -# -*.emerg * - -# -# I like to have messages displayed on the console, but only on a virtual -# console I usually leave idle. -# -#daemon,mail.*;\ -# news.=crit;news.=err;news.=notice;\ -# *.=debug;*.=info;\ -# *.=notice;*.=warn /dev/tty8 - -# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, -# you must invoke `xconsole' with the `-file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -# NOTE: adjust the list below, or you'll go crazy if you have a reasonably -# busy site.. -# -daemon.*;mail.*;\ - news.crit;news.err;news.notice;\ - *.=debug;*.=info;\ - *.=notice;*.=warn |/dev/xconsole - diff --git a/ext/root/etc/init.d/sleeper b/ext/root/etc/init.d/sleeper deleted file mode 100755 index 6da5eae32..000000000 --- a/ext/root/etc/init.d/sleeper +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -# $Id$ - -script=$0 -path=`echo $script | sed 's/etc..*/bin/'` - -PATH=$PATH:$path - -ps=`facter ps` - -if [ -z "$ps" ]; then - ps="ps -ef" -fi - -function start -{ - cd $path - ./sleeper -} - -function stop -{ - #if [ -n `which pgrep` ]; then - # pid=`pgrep sleeper` - #else - pid=`$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'` - #fi - if [ -n "$pid" ]; then - kill $pid - fi -} - -function restart -{ - stop - start -} - -function status -{ - #if [ -n `which pgrep` ]; then - # cmd="pgrep sleeper" - #else - #cmd="$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'" - #fi - #$cmd - $ps | grep -v grep | grep sleeper | grep ruby -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop; start - ;; - status) - output=`status` - #status - exit $? - ;; - *) - echo "Usage: $N {start|stop|restart|force-reload}" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/ext/root/etc/otherfile b/ext/root/etc/otherfile deleted file mode 100644 index e69de29bb..000000000 diff --git a/ext/root/etc/puppet/fileserver.conf b/ext/root/etc/puppet/fileserver.conf deleted file mode 100644 index 32dfcdd5c..000000000 --- a/ext/root/etc/puppet/fileserver.conf +++ /dev/null @@ -1,13 +0,0 @@ -# $Id$ - -[dist] - path /dist - allow *.madstop.com - -[plugins] - path /var/puppet/plugins - allow *.madstop.com - -[facts] - path /var/puppet/facts - allow *.madstop.com diff --git a/ext/root/etc/puppet/namespaceauth.conf b/ext/root/etc/puppet/namespaceauth.conf deleted file mode 100644 index fb08d428b..000000000 --- a/ext/root/etc/puppet/namespaceauth.conf +++ /dev/null @@ -1,20 +0,0 @@ -# This file is only necessary if your clients listen. -# Note that it affects all puppet daemons, including puppetmasterd, -# which is why puppetmaster is in there. -[fileserver] - allow *.madstop.com - -[puppetmaster] - allow *.madstop.com - -[pelementserver] - allow puppet.madstop.com - -[puppetrunner] - allow culain.madstop.com - -[puppetbucket] - allow *.madstop.com - -[puppetreports] - allow *.madstop.com diff --git a/ext/root/etc/puppet/puppet.conf b/ext/root/etc/puppet/puppet.conf deleted file mode 100644 index 151364ebd..000000000 --- a/ext/root/etc/puppet/puppet.conf +++ /dev/null @@ -1,10 +0,0 @@ -[puppetd] -report = true -factsync = true -pluginsync = true - -[puppetmasterd] -reports = store,rrdgraph,tagmail,log -node_terminus = ldap -ldapserver = culain.madstop.com -ldapbase = dc=madstop,dc=com diff --git a/ext/root/etc/puppet/tagmail.conf b/ext/root/etc/puppet/tagmail.conf deleted file mode 100644 index 31c77f4bc..000000000 --- a/ext/root/etc/puppet/tagmail.conf +++ /dev/null @@ -1 +0,0 @@ -all: user@domain.com -- cgit