summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorOliver Tappe2008-04-06 15:40:09 +0200
committerOliver Tappe2008-04-06 15:40:09 +0200
commit5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d (patch)
tree036281d5a9b6d847c4bfc92f3c52f96a6ada2df0 /os-plugins
parent* Instead of passing all known attributes of the current system into each plu... (diff)
downloadcore-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')
-rw-r--r--os-plugins/OpenSLX/OSPlugin/Base.pm2
-rw-r--r--os-plugins/OpenSLX/OSPlugin/Engine.pm40
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm16
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/Debian.pm (renamed from os-plugins/plugins/desktop/OpenSLX/Distro/ubuntu.pm)11
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm (renamed from os-plugins/plugins/vmware/OpenSLX/Distro/debian.pm)15
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm30
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm39
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm (renamed from os-plugins/plugins/desktop/OpenSLX/Distro/debian.pm)12
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm48
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm58
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm2
-rw-r--r--os-plugins/plugins/syslog/OpenSLX/Distro/Base.pm63
-rw-r--r--os-plugins/plugins/syslog/OpenSLX/Distro/Suse.pm41
-rw-r--r--os-plugins/plugins/syslog/OpenSLX/OSPlugin/syslog.pm30
-rw-r--r--os-plugins/plugins/syslog/init-hooks/15-have-ip-config/syslog.sh11
-rw-r--r--os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm2
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm7
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm (renamed from os-plugins/plugins/vmware/OpenSLX/Distro/ubuntu.pm)11
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Fedora.pm (renamed from os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm)14
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm (renamed from os-plugins/plugins/vmware/OpenSLX/Distro/gentoo.pm)9
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm (renamed from os-plugins/plugins/vmware/OpenSLX/Distro/suse.pm)9
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Ubuntu.pm23
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/fedora.pm48
23 files changed, 295 insertions, 246 deletions
diff --git a/os-plugins/OpenSLX/OSPlugin/Base.pm b/os-plugins/OpenSLX/OSPlugin/Base.pm
index 9d4f6657..f974cdc0 100644
--- a/os-plugins/OpenSLX/OSPlugin/Base.pm
+++ b/os-plugins/OpenSLX/OSPlugin/Base.pm
@@ -303,7 +303,7 @@ sub copyRequiredFilesIntoInitramfs
{
my $self = shift;
my $targetPath = shift;
- my $attrs = shift;
+ my $attrs = shift;
my $makeInitRamFSEngine = shift;
return;
diff --git a/os-plugins/OpenSLX/OSPlugin/Engine.pm b/os-plugins/OpenSLX/OSPlugin/Engine.pm
index 6a587afd..091cd135 100644
--- a/os-plugins/OpenSLX/OSPlugin/Engine.pm
+++ b/os-plugins/OpenSLX/OSPlugin/Engine.pm
@@ -462,39 +462,13 @@ sub _loadPlugin
# if there's a distro folder, instantiate the most appropriate distro class
my $distro;
if (-d "$self->{'plugin-path'}/OpenSLX/Distro") {
- unshift @INC, $self->{'plugin-path'};
- my $distroName = $self->distroName();
- $distroName =~ tr{.-}{__};
- my @distroModules;
- while($distroName =~ m{^(.+)_[^_]*$}) {
- push @distroModules, $distroName;
- $distroName = $1;
- }
- push @distroModules, $distroName;
- push @distroModules, 'Base';
- for my $distroModule (@distroModules) {
- my $loaded = eval {
- vlog(1, "trying distro-module $distroModule...");
- $distro = instantiateClass(
- 'OpenSLX::Distro::' . $distroModule,
- {
- pathToClass => $self->{'plugin-path'},
- acceptMissing => 1,
- }
- );
- return 0 if !$distro;
- vlog(1, "using $distroModule.");
- 1;
- };
- last if $loaded;
- if (!defined $loaded) {
- vlog(0, _tr(
- "Error when trying to load distro module '%s':\n%s",
- $distroModule, $@
- ));
- }
- }
- shift @INC;
+ my $pluginBasePath = "$openslxConfig{'base-path'}/lib/plugins";
+ my $distroScope = $plugin->{name} . '::OpenSLX::Distro';
+ $distro = loadDistroModule({
+ distroName => $self->distroName(),
+ distroScope => $distroScope,
+ pathToClass => $pluginBasePath,
+ });
if (!$distro) {
die _tr(
'unable to load any distro module for vendor-OS %s in plugin %s',
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm
index 3764de39..dffa1850 100644
--- a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm
+++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm
@@ -8,11 +8,10 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# base.pm
-# - provides empty base of the OpenSLX OSPlugin Distro API for the desktop
-# plugin.
+# desktop/OpenSLX/Distro/Base.pm
+# - provides base implementation of the Distro API for the desktop plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::Base;
+package desktop::OpenSLX::Distro::Base;
use strict;
use warnings;
@@ -99,6 +98,15 @@ sub GDMPathInfo
return $pathInfo;
}
+sub GDMRunlevelLinks
+{
+ my $self = shift;
+
+ return unshiftHereDoc(<<" End-of-Here");
+ rllinker gdm 15 15
+ End-of-Here
+}
+
sub GDMConfigHashForWorkstation
{
my $self = shift;
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/ubuntu.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Debian.pm
index c932f87f..361543e9 100644
--- a/os-plugins/plugins/desktop/OpenSLX/Distro/ubuntu.pm
+++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Debian.pm
@@ -8,15 +8,16 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Ubuntu.pm
-# - provides Ubuntu-specific overrides of the OpenSLX OSSetup API.
+# desktop/OpenSLX/Distro/Debian.pm
+# - provides Debian-specific overrides of the Distro API for the desktop
+# plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::ubuntu;
+package desktop::OpenSLX::Distro::Debian;
use strict;
use warnings;
-use base qw(OpenSLX::Distro::Base);
+use base qw(desktop::OpenSLX::Distro::Base);
use OpenSLX::Basics;
use OpenSLX::Utils;
@@ -25,4 +26,6 @@ use OpenSLX::Utils;
### interface methods
################################################################################
+# TODO: implement!
+
1; \ No newline at end of file
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/debian.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm
index 32a3d4bd..f9428aab 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/debian.pm
+++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm
@@ -1,4 +1,4 @@
-# Copyright (c) 2008 - OpenSLX GmbH
+# Copyright (c) 2006, 2007 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -8,24 +8,23 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# debian.pm
-# - provides Debian-specific overrides of the OpenSLX Distro API for the
-# desktop plugin.
+# desktop/OpenSLX/Distro/Fedora.pm
+# - provides Fedora-specific overrides of the Distro API for the desktop
+# plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::debian;
+package desktop::OpenSLX::Distro::Fedora;
use strict;
use warnings;
-use base qw(OpenSLX::Distro::Base);
+use base qw(desktop::OpenSLX::Distro::Base);
use OpenSLX::Basics;
-use OpenSLX::Utils;
################################################################################
### interface methods
################################################################################
-### Erbe von Ubuntu!
+# TODO: implement!
1; \ No newline at end of file
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm
new file mode 100644
index 00000000..129f4d08
--- /dev/null
+++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm
@@ -0,0 +1,30 @@
+# Copyright (c) 2006, 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# desktop/OpenSLX/Distro/Gentoo.pm
+# - provides Gentoo-specific overrides of the Distro API for the desktop
+# plugin.
+# -----------------------------------------------------------------------------
+package desktop::OpenSLX::Distro::Gentoo;
+
+use strict;
+use warnings;
+
+use base qw(desktop::OpenSLX::Distro::Base);
+
+use OpenSLX::Basics;
+
+################################################################################
+### interface methods
+################################################################################
+
+# TODO: implement!
+
+1;
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm
new file mode 100644
index 00000000..2c3818cd
--- /dev/null
+++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm
@@ -0,0 +1,39 @@
+# Copyright (c) 2006, 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# desktop/OpenSLX/Distro/Suse.pm
+# - provides SUSE-specific overrides of the Distro API for the desktop
+# plugin.
+# -----------------------------------------------------------------------------
+package desktop::OpenSLX::Distro::Suse;
+
+use strict;
+use warnings;
+
+use base qw(desktop::OpenSLX::Distro::Base);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub GDMRunlevelLinks
+{
+ my $self = shift;
+
+ return unshiftHereDoc(<<" End-of-Here");
+ rllinker earlygdm 1 15
+ rllinker xdm 15 1
+ End-of-Here
+}
+
+1;
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/debian.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm
index 2d837629..7cd8ebc7 100644
--- a/os-plugins/plugins/desktop/OpenSLX/Distro/debian.pm
+++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm
@@ -8,16 +8,16 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# debian.pm
-# - provides Debian-specific overrides of the OpenSLX Distro API for the
-# desktop plugin.
+# desktop/OpenSLX/Distro/Ubuntu.pm
+# - provides Ubuntu-specific overrides of the distro API for the desktop
+# plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::debian;
+package desktop::OpenSLX::Distro::Ubuntu;
use strict;
use warnings;
-use base qw(OpenSLX::Distro::Base);
+use base qw(desktop::OpenSLX::Distro::Base);
use OpenSLX::Basics;
use OpenSLX::Utils;
@@ -26,4 +26,6 @@ use OpenSLX::Utils;
### interface methods
################################################################################
+# TODO: implement!
+
1; \ No newline at end of file
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm
deleted file mode 100644
index 0bc9ebdc..00000000
--- a/os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (c) 2006, 2007 - OpenSLX GmbH
-#
-# This program is free software distributed under the GPL version 2.
-# See http://openslx.org/COPYING
-#
-# If you have any feedback please consult http://openslx.org/feedback and
-# send your suggestions, praise, or complaints to feedback@openslx.org
-#
-# General information about OpenSLX can be found at http://openslx.org/
-# -----------------------------------------------------------------------------
-# Fedora.pm
-# - provides Fedora-specific overrides of the OpenSLX OSSetup API.
-# -----------------------------------------------------------------------------
-package OpenSLX::OSSetup::Distro::Fedora;
-
-use strict;
-use warnings;
-
-use base qw(OpenSLX::OSSetup::Distro::Base);
-
-use OpenSLX::Basics;
-
-################################################################################
-### interface methods
-################################################################################
-sub new
-{
- my $class = shift;
- my $self = {};
- return bless $self, $class;
-}
-
-sub initialize
-{
- my $self = shift;
- my $engine = shift;
-
- $self->SUPER::initialize($engine);
- $self->{'packager-type'} = 'rpm';
- $self->{'meta-packager-type'} = $ENV{SLX_META_PACKAGER} || 'yum';
- $self->{'stage1c-faked-files'} = [
- '/etc/fstab',
- '/etc/mtab',
- ];
- return;
-}
-
-1; \ No newline at end of file
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm
deleted file mode 100644
index c49ba5d6..00000000
--- a/os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 2006, 2007 - OpenSLX GmbH
-#
-# This program is free software distributed under the GPL version 2.
-# See http://openslx.org/COPYING
-#
-# If you have any feedback please consult http://openslx.org/feedback and
-# send your suggestions, praise, or complaints to feedback@openslx.org
-#
-# General information about OpenSLX can be found at http://openslx.org/
-# -----------------------------------------------------------------------------
-# SUSE.pm
-# - provides SUSE-specific overrides of the OpenSLX OSSetup API.
-# -----------------------------------------------------------------------------
-package OpenSLX::OSSetup::Distro::Gentoo;
-
-use strict;
-use warnings;
-
-use base qw(OpenSLX::OSSetup::Distro::Base);
-
-use OpenSLX::Basics;
-
-################################################################################
-### interface methods
-################################################################################
-sub new
-{
- my $class = shift;
- my $self = {};
- return bless $self, $class;
-}
-
-sub pickKernelFile
-{
- my $self = shift;
- my $kernelPath = shift;
-
- my $newestKernelFile;
- my $newestKernelFileSortKey = '';
- foreach my $kernelFile (glob("$kernelPath/kernel-genkernel-x86-*")) {
- next unless $kernelFile =~ m{
- x86-(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?-(\d+(?:\.\d+)?)
- }x;
- my $sortKey
- = sprintf("%02d.%02d.%02d.%02d-%2.1f", $1, $2, $3, $4||0, $5);
- if ($newestKernelFileSortKey lt $sortKey) {
- $newestKernelFile = $kernelFile;
- $newestKernelFileSortKey = $sortKey;
- }
- }
-
- if (!defined $newestKernelFile) {
- die _tr("unable to pick a kernel-file from path '%s'!", $kernelPath);
- }
- return $newestKernelFile;
-}
-
-1;
diff --git a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm
index 046d0759..70f8d71c 100644
--- a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm
+++ b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm
@@ -420,8 +420,8 @@ sub _setupGDMScript
# written by OpenSLX-plugin 'desktop'
mkdir -p $paths 2>/dev/null
ln -sf $repoPath/gdm/\$desktop_mode/gdm.conf /mnt$configFile
- rllinker gdm 1 15
End-of-Here
+ $script .= $self->{distro}->GDMRunlevelLinks();
spitFile("$repoPath/gdm/desktop.sh", $script);
return;
}
diff --git a/os-plugins/plugins/syslog/OpenSLX/Distro/Base.pm b/os-plugins/plugins/syslog/OpenSLX/Distro/Base.pm
new file mode 100644
index 00000000..dd599404
--- /dev/null
+++ b/os-plugins/plugins/syslog/OpenSLX/Distro/Base.pm
@@ -0,0 +1,63 @@
+# Copyright (c) 2008 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# syslog/OpenSLX/Distro/Base.pm
+# - provides base implementation of the Distro API for the syslog plugin.
+# -----------------------------------------------------------------------------
+package syslog::OpenSLX::Distro::Base;
+
+use strict;
+use warnings;
+
+our $VERSION = 1.01; # API-version . implementation-version
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+sub new
+{
+ my $class = shift;
+ my $self = {};
+ return bless $self, $class;
+}
+
+sub initialize
+{
+ my $self = shift;
+ $self->{engine} = shift;
+
+ return 1;
+}
+
+sub runlevelInfo
+{
+ my $self = shift;
+ my $attrs = shift;
+
+ # most distros (well: Debian & Ubuntu) use a different initscript depending
+ # on which version of syslog is installed ('syslogd' or 'syslog-ng')
+ my $kind = lc($attrs->{'syslog::kind'});
+ my %nameMap = (
+ 'syslogd' => 'sysklogd',
+ 'syslog-ng' => 'syslog-ng',
+ );
+ my $rlInfo = {
+ scriptName => $nameMap{$kind},
+ startAt => 2,
+ stopAt => 15,
+ };
+
+ return $rlInfo;
+}
+
+1;
diff --git a/os-plugins/plugins/syslog/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/syslog/OpenSLX/Distro/Suse.pm
new file mode 100644
index 00000000..7255d6f5
--- /dev/null
+++ b/os-plugins/plugins/syslog/OpenSLX/Distro/Suse.pm
@@ -0,0 +1,41 @@
+# Copyright (c) 2006, 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# syslog/OpenSLX/Distro/Suse.pm
+# - provides SUSE-specific overrides of the Distro API for the syslog plugin.
+# -----------------------------------------------------------------------------
+package syslog::OpenSLX::Distro::Suse;
+
+use strict;
+use warnings;
+
+use base qw(syslog::OpenSLX::Distro::Base);
+
+use OpenSLX::Basics;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub runlevelInfo
+{
+ my $self = shift;
+ my $attrs = shift;
+
+ my $rlInfo = $self->SUPER::runlevelInfo($attrs);
+
+ # SUSE uses a script named 'syslog', no matter if syslogd or syslog-ng
+ # is installed
+ $rlInfo->{scriptName} = 'syslog';
+
+ return $rlInfo;
+}
+
+1;
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);
diff --git a/os-plugins/plugins/syslog/init-hooks/15-have-ip-config/syslog.sh b/os-plugins/plugins/syslog/init-hooks/15-have-ip-config/syslog.sh
index 4003a0a4..3c3a1d13 100644
--- a/os-plugins/plugins/syslog/init-hooks/15-have-ip-config/syslog.sh
+++ b/os-plugins/plugins/syslog/init-hooks/15-have-ip-config/syslog.sh
@@ -1,8 +1,13 @@
if [ -e /initramfs/plugin-conf/syslog.conf ]; then
. /initramfs/plugin-conf/syslog.conf
- if [ $syslog_active -ne 0 ] && [ -n "$syslog_host" ]; then
- echo "syslogd -R ${syslog_host}:${syslog_port}..."
- syslogd -R "${syslog_host}:${syslog_port}" & >/dev/null 2>&1
+ if [ $syslog_active -ne 0 ]; then
+ # TODO: maybe limit the maximum log file size via rotation?
+ params="-s 0"
+ if [ -n "$syslog_host" ]; then
+ params="$params -R ${syslog_host}:${syslog_port}"
+ fi
+ echo "syslogd $params ..."
+ syslogd $params >/dev/null 2>&1
klogd >/dev/null 2>&1
fi
fi
diff --git a/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
index 1de80d93..28cc943b 100644
--- a/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
+++ b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
@@ -126,7 +126,7 @@ sub suggestAdditionalKernelModules
# Ubuntu needs vesafb and fbcon (which drags along some others)
if ($makeInitRamFSEngine->{'distro-name'} =~ m{^ubuntu}i) {
- push @suggestedModules, qw( vesafb fbcon )
+ push @suggestedModules, qw( vesafb fbcon )
}
return @suggestedModules;
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm
index 317bd13f..3c128f14 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm
@@ -8,11 +8,10 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# base.pm
-# - provides empty base of the OpenSLX OSPlugin Distro API for the vmware
-# plugin.
+# vmware/OpenSLX/Distro/Base.pm
+# - provides base implementation of the Distro API for the vmware plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::Base;
+package vmware::OpenSLX::Distro::Base;
use strict;
use warnings;
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/ubuntu.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm
index 7346918c..e8f40c16 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/ubuntu.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2007 - OpenSLX GmbH
+# Copyright (c) 2008 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -8,15 +8,16 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Ubuntu.pm
-# - provides Ubuntu-specific overrides of the OpenSLX OSSetup API.
+# vmware/OpenSLX/Distro/debian.pm
+# - provides Debian-specific overrides of the Distro API for the vmware
+# plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::ubuntu;
+package vmware::OpenSLX::Distro::Debian;
use strict;
use warnings;
-use base qw(OpenSLX::Distro::Base);
+use base qw(vmware::OpenSLX::Distro::Base);
use OpenSLX::Basics;
use OpenSLX::Utils;
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Fedora.pm
index e360e1b5..1a68a286 100644
--- a/os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Fedora.pm
@@ -8,16 +8,16 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# SUSE.pm
-# - provides SUSE-specific overrides of the OpenSLX Distro API for the desktop
-# plugin.
+# vmware/OpenSLX/Distro/Fedora.pm
+# - provides Fedora-specific overrides of the Distro API for the vmware
+# plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::suse;
+package vmware::OpenSLX::Distro::Fedora;
use strict;
use warnings;
-use base qw(OpenSLX::Distro::Base);
+use base qw(vmware::OpenSLX::Distro::Base);
use OpenSLX::Basics;
@@ -25,4 +25,6 @@ use OpenSLX::Basics;
### interface methods
################################################################################
-1;
+# TODO: implement!
+
+1; \ No newline at end of file
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/gentoo.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm
index 924c2fc2..594a55cd 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/gentoo.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm
@@ -8,15 +8,16 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# SUSE.pm
-# - provides SUSE-specific overrides of the OpenSLX OSSetup API.
+# vmware/OpenSLX/Distro/Gentoo.pm
+# - provides Gentoo-specific overrides of the Distro API for the vmware
+# plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::OSSetup::Distro::Gentoo;
+package vmware::OpenSLX::Distro::Gentoo;
use strict;
use warnings;
-use base qw(OpenSLX::OSSetup::Distro::Base);
+use base qw(vmware::OpenSLX::Distro::Base);
use OpenSLX::Basics;
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/suse.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
index b3a39df5..9c380cb6 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/suse.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
@@ -8,16 +8,15 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# SUSE.pm
-# - provides SUSE-specific overrides of the OpenSLX Distro API for the desktop
-# plugin.
+# vmware/OpenSLX/Distro/Suse.pm
+# - provides SUSE-specific overrides of the Distro API for the vmware plugin.
# -----------------------------------------------------------------------------
-package OpenSLX::Distro::suse;
+package vmware::OpenSLX::Distro::Suse;
use strict;
use warnings;
-use base qw(OpenSLX::Distro::Base);
+use base qw(vmware::OpenSLX::Distro::Base);
use OpenSLX::Basics;
use OpenSLX::Utils;
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/Ubuntu.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Ubuntu.pm
new file mode 100644
index 00000000..02b44b5c
--- /dev/null
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Ubuntu.pm
@@ -0,0 +1,23 @@
+# Copyright (c) 2006, 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# vmware/OpenSLX/Distro/Ubuntu.pm
+# - provides Ubuntu-specific overrides of the Distro API for the vmware
+# plugin.
+# -----------------------------------------------------------------------------
+package vmware::OpenSLX::Distro::Ubuntu;
+
+use strict;
+use warnings;
+
+# inherit everything from Debian (as Ubuntu is based on it anyway)
+use base qw(vmware::OpenSLX::Distro::Debian);
+
+1; \ No newline at end of file
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/fedora.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/fedora.pm
deleted file mode 100644
index 0bc9ebdc..00000000
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/fedora.pm
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (c) 2006, 2007 - OpenSLX GmbH
-#
-# This program is free software distributed under the GPL version 2.
-# See http://openslx.org/COPYING
-#
-# If you have any feedback please consult http://openslx.org/feedback and
-# send your suggestions, praise, or complaints to feedback@openslx.org
-#
-# General information about OpenSLX can be found at http://openslx.org/
-# -----------------------------------------------------------------------------
-# Fedora.pm
-# - provides Fedora-specific overrides of the OpenSLX OSSetup API.
-# -----------------------------------------------------------------------------
-package OpenSLX::OSSetup::Distro::Fedora;
-
-use strict;
-use warnings;
-
-use base qw(OpenSLX::OSSetup::Distro::Base);
-
-use OpenSLX::Basics;
-
-################################################################################
-### interface methods
-################################################################################
-sub new
-{
- my $class = shift;
- my $self = {};
- return bless $self, $class;
-}
-
-sub initialize
-{
- my $self = shift;
- my $engine = shift;
-
- $self->SUPER::initialize($engine);
- $self->{'packager-type'} = 'rpm';
- $self->{'meta-packager-type'} = $ENV{SLX_META_PACKAGER} || 'yum';
- $self->{'stage1c-faked-files'} = [
- '/etc/fstab',
- '/etc/mtab',
- ];
- return;
-}
-
-1; \ No newline at end of file