diff options
| author | Oliver Tappe | 2008-04-06 15:40:09 +0200 |
|---|---|---|
| committer | Oliver Tappe | 2008-04-06 15:40:09 +0200 |
| commit | 5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d (patch) | |
| tree | 036281d5a9b6d847c4bfc92f3c52f96a6ada2df0 /os-plugins/plugins/syslog/OpenSLX/OSPlugin | |
| parent | * Instead of passing all known attributes of the current system into each plu... (diff) | |
| download | core-5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d.tar.gz core-5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d.tar.xz core-5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d.zip | |
* made names of distro module consistent across OpenSLX - now the always start with
a capital letter followed by all lowercase (Debian, Fedora, Gentoo, Suse, Ubuntu)
* refactored loading of distro modules into a separate function (loadDistroModule()
in Basics.pm)
* finished support to logging to a file in syslog plugin
* worked at desktop plugin (still not working, though)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1721 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/syslog/OpenSLX/OSPlugin')
| -rw-r--r-- | os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm b/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm index 9220d3ab..e5e63c29 100644 --- a/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm +++ b/os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm @@ -92,6 +92,16 @@ sub getAttrInfo content_descr => 'a port number', default => 514, }, + 'syslog::file' => { + applies_to_systems => 1, + applies_to_clients => 1, + description => unshiftHereDoc(<<' End-of-Here'), + name of file where all log messages shall be written + End-of-Here + content_regex => undef, + content_descr => 'a complete file path', + default => undef, + }, }; } @@ -170,7 +180,9 @@ sub _setupSyslogNG my $repoPath = $self->{pluginRepositoryPath}; - my $conf = unshiftHereDoc(<<' End-of-Here'); + my $rlInfo = $self->{distro}->runlevelInfo($attrs); + + my $conf = unshiftHereDoc(<<" End-of-Here"); #!/bin/ash # written by OpenSLX-plugin 'syslog' @@ -190,11 +202,11 @@ sub _setupSyslogNG }; END - if [ -n "${syslog_host}" ]; then - [ -z ${syslog_port} ] && syslog_port=514 + if [ -n "\${syslog_host}" ]; then + [ -z \${syslog_port} ] && syslog_port=514 cat >>/mnt/etc/syslog-ng/syslog-ng.conf <<END destination loghost { - udp( "${syslog_host}" port(${syslog_port}) ); + udp( "\${syslog_host}" port(\${syslog_port}) ); }; log { source(all); @@ -203,10 +215,10 @@ sub _setupSyslogNG END fi - if [ -n "${syslog_file}" ]; then + if [ -n "\${syslog_file}" ]; then cat >>/mnt/etc/syslog-ng/syslog-ng.conf <<END destination allmessages { - file("/var/log/allmessages"); + file("\${syslog_file}"); }; log { source(all); @@ -215,7 +227,7 @@ sub _setupSyslogNG END fi - rllinker syslog-ng 1 15 + rllinker $rlInfo->{scriptName} $rlInfo->{startAt} $rlInfo->{stopAt} End-of-Here spitFile("$repoPath/syslog.sh", $conf); @@ -230,6 +242,8 @@ sub _setupSyslogd my $repoPath = $self->{pluginRepositoryPath}; + my $rlInfo = $self->{distro}->runlevelInfo($attrs); + # TODO: implement! my $conf = unshiftHereDoc(<<' End-of-Here'); @@ -237,7 +251,7 @@ sub _setupSyslogd # written by OpenSLX-plugin 'syslog' - rllinker syslogd 1 15 + rllinker $rlInfo->{scriptName} $rlInfo->{startAt} $rlInfo->{stopAt} End-of-Here spitFile("$repoPath/syslog.sh", $conf); |
