Revision f7724dcd
Added by Lukas Zapletal about 10 years ago
Rakefile.dist | ||
---|---|---|
LOCALSTATEDIR = ENV['LOCALSTATEDIR'] || "#{PREFIX}/var"
|
||
SHAREDSTAREDIR = ENV['SHAREDSTAREDIR'] || "#{LOCALSTATEDIR}/lib"
|
||
DATAROOTDIR = DATADIR = ENV['DATAROOTDIR'] || "#{PREFIX}/share"
|
||
DEBUGDIR = ENV['DEBUGDIR'] || "#{DATAROOTDIR}/foreman/script/foreman-debug.d"
|
||
MANDIR = ENV['MANDIR'] || "#{DATAROOTDIR}/man"
|
||
|
||
def is_redhat; File.exist?("/etc/redhat-release"); end
|
||
def is_debian; File.exist?("/etc/debian-release"); end
|
||
|
||
file BUILDDIR do
|
||
mkdir BUILDDIR
|
||
end
|
||
... | ... | |
sh "gzip -f9 #{BUILDDIR}/foreman-debug.8"
|
||
end
|
||
|
||
file "#{BUILDDIR}/foreman-tail.8.gz" => "man/foreman-tail.8.asciidoc" do |t|
|
||
sh "a2x -d manpage -f manpage -D #{BUILDDIR}/ #{t.prerequisites[0]}"
|
||
sh "gzip -f9 #{BUILDDIR}/foreman-tail.8"
|
||
end
|
||
|
||
task :build => [
|
||
BUILDDIR,
|
||
"#{BUILDDIR}/foreman-rake.8.gz",
|
||
"#{BUILDDIR}/foreman-debug.8.gz",
|
||
"#{BUILDDIR}/foreman-tail.8.gz",
|
||
]
|
||
|
||
task :install => :build do |t|
|
||
mkdir_p "#{MANDIR}/man8"
|
||
cp "#{BUILDDIR}/foreman-rake.8.gz", "#{MANDIR}/man8/"
|
||
cp "#{BUILDDIR}/foreman-debug.8.gz", "#{MANDIR}/man8/"
|
||
mkdir_p "#{DEBUGDIR}"
|
||
cp "#{BUILDDIR}/foreman-tail.8.gz", "#{MANDIR}/man8/"
|
||
|
||
# foreman-tail
|
||
TAILDIR = ENV['TAILDIR'] || "script/foreman-tail.d"
|
||
mkdir_p "#{DATAROOTDIR}/foreman/#{TAILDIR}"
|
||
cp Dir.glob("#{TAILDIR}/common/*"), "#{DATAROOTDIR}/foreman/#{TAILDIR}/", :verbose => true
|
||
if is_redhat
|
||
cp Dir.glob("#{TAILDIR}/redhat/*"), "#{DATAROOTDIR}/foreman/#{TAILDIR}/", :verbose => true
|
||
elsif is_debian
|
||
cp Dir.glob("#{TAILDIR}/debian/*"), "#{DATAROOTDIR}/foreman/#{TAILDIR}/", :verbose => true
|
||
else
|
||
raise "Unsupported system"
|
||
end
|
||
|
||
# foreman-debug
|
||
DEBUGDIR = ENV['DEBUGDIR'] || "script/foreman-debug.d"
|
||
mkdir_p "#{DATAROOTDIR}/foreman/#{DEBUGDIR}"
|
||
end
|
||
|
||
task :default => :build
|
foreman.spec | ||
---|---|---|
install -d -m0750 %{buildroot}%{_localstatedir}/log/%{name}/plugins
|
||
install -Dp -m0755 script/%{name}-debug %{buildroot}%{_sbindir}/%{name}-debug
|
||
install -Dp -m0755 script/%{name}-rake %{buildroot}%{_sbindir}/%{name}-rake
|
||
install -Dp -m0755 script/%{name}-tail %{buildroot}%{_sbindir}/%{name}-tail
|
||
install -Dp -m0644 %{confdir}/%{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
||
install -Dp -m0755 %{confdir}/%{name}.init %{buildroot}%{_initrddir}/%{name}
|
||
install -Dp -m0644 %{confdir}/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
||
... | ... | |
cp -p Gemfile.in %{buildroot}%{_datadir}/%{name}/Gemfile.in
|
||
cp -p -r app bundler.d config config.ru extras lib locale Rakefile script %{buildroot}%{_datadir}/%{name}
|
||
rm -rf %{buildroot}%{_datadir}/%{name}/extras/{jumpstart,spec}
|
||
|
||
# remove all test units from produciton release
|
||
find %{buildroot}%{_datadir}/%{name} -type d -name "test" |xargs rm -rf
|
||
|
||
... | ... | |
%{_initrddir}/%{name}
|
||
%{_sbindir}/%{name}-debug
|
||
%{_sbindir}/%{name}-rake
|
||
%{_sbindir}/%{name}-tail
|
||
%{_mandir}/man8
|
||
%config(noreplace) %{_sysconfdir}/%{name}
|
||
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
man/foreman-tail.8.asciidoc | ||
---|---|---|
foreman\-tail(8)
|
||
================
|
||
:man source: foreman-tail
|
||
:man manual: Foreman Manual
|
||
|
||
NAME
|
||
----
|
||
foreman-tail - Tool for calling tail on Foreman logs
|
||
|
||
SYNOPSIS
|
||
--------
|
||
|
||
foreman-tail
|
||
|
||
foreman-tail rails
|
||
|
||
foreman-tail [component]
|
||
|
||
foreman-tail -l
|
||
|
||
foreman-tail -h
|
||
|
||
DESCRIPTION
|
||
-----------
|
||
|
||
The foreman-tail is an utility which calls tail with appropriate log files.
|
||
|
||
OPTIONS
|
||
-------
|
||
|
||
When used without any parameters, it tails all relevant Foreman log files.
|
||
|
||
When used with one or more parameters, it tails those provided.
|
||
|
||
Foreman plugins can extend foreman-tail, use this command to find all
|
||
possible components that are valid:
|
||
|
||
foreman-tail -l
|
||
|
||
Example components are "rails" for Rails production log or "proxy" for Foreman
|
||
Proxy production logs. There are components for Apache http daemon, Puppet
|
||
Master or cron available.
|
||
|
||
SEE ALSO
|
||
--------
|
||
|
||
*foreman-debug*(8)
|
||
|
||
GETTING HELP
|
||
------------
|
||
|
||
For support, please see http://theforeman.org/support.html, the
|
||
foreman-users@googlegroups.com mailing list or #theforeman on Freenode.
|
script/foreman-tail | ||
---|---|---|
#!/bin/bash
|
||
dir=/usr/share/foreman/script/foreman-tail.d
|
||
opts="-Fn100"
|
||
|
||
if [ "$1" == "-h" ]; then
|
||
man foreman-tail; exit 1
|
||
fi
|
||
if [ "$1" == "-l" ]; then
|
||
ls $dir | cut -d- -f2; exit 1
|
||
fi
|
||
|
||
if [ -z "$1" ]; then
|
||
tail $opts $(eval echo $(cat $dir/*))
|
||
else
|
||
if [ "$#" -eq 1 ]; then
|
||
tail $opts $(eval echo $(cat $dir/*-$1))
|
||
else
|
||
args=$(IFS=","; echo "$*")
|
||
tail $opts $(cat $(eval echo $dir/*-{$args}))
|
||
fi
|
||
fi
|
script/foreman-tail.d/common/05-foreman_cron | ||
---|---|---|
/var/log/foreman/cron.log
|
script/foreman-tail.d/common/10-foreman_seed | ||
---|---|---|
/var/log/foreman/db_{migrate,seed}.log
|
script/foreman-tail.d/common/60-puppetmaster | ||
---|---|---|
/var/log/puppet/masterhttp.log
|
script/foreman-tail.d/common/80-proxy | ||
---|---|---|
/var/log/foreman-proxy/{access,proxy}.log
|
script/foreman-tail.d/common/90-rails | ||
---|---|---|
/var/log/foreman/production.log
|
script/foreman-tail.d/debian/00-syslog | ||
---|---|---|
/var/log/syslog
|
||
/var/log/daemon.log
|
script/foreman-tail.d/debian/50-httpd | ||
---|---|---|
/var/log/apache2/*.log
|
script/foreman-tail.d/redhat/00-syslog | ||
---|---|---|
/var/log/messages
|
script/foreman-tail.d/redhat/30-named | ||
---|---|---|
/var/log/named/*.log
|
script/foreman-tail.d/redhat/50-httpd | ||
---|---|---|
/var/log/httpd/*.log
|
Also available in: Unified diff
fixes #4659 - added foreman-tail tool