From 386ac7aa6bb5f1a75c622488674ffdb42596f4dd Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Fri, 7 Dec 2012 17:11:52 +0100 Subject: Added missing plugin files for RHEL, Scientific Linux and CentOS Linux. Removed deprecated SciLin files. postinit.local from the InitRamFS will be executed, if fetching of the tgz file fails. --- .../plugins/desktop/OpenSLX/Distro/Centos.pm | 31 +++++ .../plugins/desktop/OpenSLX/Distro/Rhel.pm | 132 +++++++++++++++++++++ .../plugins/desktop/OpenSLX/Distro/Scientific.pm | 31 +++++ .../plugins/desktop/OpenSLX/Distro/Scilin.pm | 132 --------------------- .../plugins/infoscreen/OpenSLX/Distro/Centos.pm | 29 +++++ .../plugins/infoscreen/OpenSLX/Distro/Rhel.pm | 29 +++++ .../infoscreen/OpenSLX/Distro/Scientific.pm | 29 +++++ .../plugins/infoscreen/OpenSLX/Distro/Scilin.pm | 32 ----- .../plugins/kiosk/OpenSLX/Distro/Centos.pm | 29 +++++ .../plugins/kiosk/OpenSLX/Distro/Rhel.pm | 28 +++++ .../plugins/kiosk/OpenSLX/Distro/Scientific.pm | 29 +++++ .../plugins/kiosk/OpenSLX/Distro/Scilin.pm | 32 ----- .../plugins/profile/OpenSLX/Distro/Centos.pm | 29 +++++ .../plugins/profile/OpenSLX/Distro/Rhel.pm | 29 +++++ .../plugins/profile/OpenSLX/Distro/Scientific.pm | 29 +++++ .../plugins/profile/OpenSLX/Distro/Scilin.pm | 32 ----- .../plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm | 2 +- 17 files changed, 455 insertions(+), 229 deletions(-) create mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm create mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm create mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm create mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm (limited to 'src/os-plugins') diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..8f726037 --- /dev/null +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm @@ -0,0 +1,31 @@ +# Copyright (c) 2006..2009 - 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/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# desktop plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Rhel); + +use File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..9a04afc4 --- /dev/null +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,132 @@ +# Copyright (c) 2006..2009 - 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/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Base); + +use File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub GDMPathInfo +{ + my $self = shift; + + my $pathInfo = $self->SUPER::GDMPathInfo(); + + # create gdm.conf-custom instead of gdm.conf + $pathInfo->{config} = '/etc/gdm/custom.conf'; + + return $pathInfo; +} + +sub setupGDMScript +{ + my $self = shift; + my $repoPath = shift; + + my $script = $self->SUPER::setupGDMScript($repoPath); + + my $configFile = $self->GDMPathInfo->{config}; + + # include common stuff (independent of display manager used) + $script = _setupCommonDmScript($script); + + $script .= unshiftHereDoc(<<' End-of-Here'); + echo "DISPLAYMANAGER=GNOME" \ + >/mnt/etc/sysconfig/desktop + # gdm does not like AUFS/UnionFS on its var directory + mkdir -m 1770 /mnt/var/lib/gdm + chown root:gdm /mnt/var/lib/gdm + End-of-Here + + return $script; +} + +sub GDMConfigHashForWorkstation +{ + my $self = shift; + + my $configHash = $self->SUPER::GDMConfigHashForWorkstation(); + $configHash->{'daemon'}->{SessionDesktopDir} = + '/etc/X11/session/:/usr/share/xsessions/:/usr/share/gdm/BuiltInSessions'; + $configHash->{'daemon'}->{Greeter} = + '/usr/libexec/gdmgreeter'; + + return $configHash; +} + +sub setupKDMScript +{ + my $self = shift; + my $repoPath = shift; + + # SUSE reads /var/adm/kdm/kdmrc.sysconfig, so we link that to + # our config file + my $pathInfo = $self->KDMPathInfo(); + my $configFile = $pathInfo->{config}; + mkpath("/etc/opt/kdm"); + mkpath("/var/adm/kdm"); + # maybe backup kdmrc.sysconfig sometimes + unlink("/var/adm/kdm/kdmrc.sysconfig"); + # the config file gets overwritten if this script is present + unlink("/opt/kde3/share/apps/kdm/read_sysconfig.sh"); + symlink("/etc/opt/kdm/kdmrc", "/var/adm/kdm/kdmrc.sysconfig"); + + my $script = $self->SUPER::setupKDMScript($repoPath); + + # include common stuff (independent of display manager used) + $script = _setupCommonDmScript($script); + + $script .= unshiftHereDoc(<<' End-of-Here'); + echo "DISPLAYMANAGER=KDE" \ + >/mnt/etc/sysconfig/desktop + End-of-Here + + return $script; +} + +sub _setupCommonDmScript +{ + my $script = shift; + + $script .= unshiftHereDoc(<<' End-of-Here'); + # cleanup after users Xorg session + sed 's,^#!.*,,' /mnt/etc/X11/xdm/Xreset \ + > /mnt/etc/X11/xdm/Xreset.system + echo -e '#!/bin/sh\n#\n# modified by desktop plugin in Stage3\n#\n + # remove safely any remaining files of the leaving user in /tmp + ( su -c "rm -rf /tmp/*" - $USER + echo "$USER files removed by $0" >/tmp/files.removed 2>/dev/null ) & + . /etc/X11/xdm/Xreset.system' >/mnt/etc/X11/xdm/Xreset + chmod a+x /mnt/etc/X11/xdm/Xreset* + + # enable the inittab entry again (incomplete) + # sed -e "s,# line deleted.*,x:5:respawn:/etc/X11/prefdm -nodaemon," \ + # -i /mnt/etc/inittab + End-of-Here + + return $script; +} + +1; diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..9f2eedbc --- /dev/null +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,31 @@ +# Copyright (c) 2006..2009 - 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/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# desktop plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Rhel); + +use File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index 1dc0482c..00000000 --- a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) 2006..2009 - 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/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the desktop -# plugin. -# ----------------------------------------------------------------------------- -package desktop::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(desktop::OpenSLX::Distro::Base); - -use File::Path; - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - -sub GDMPathInfo -{ - my $self = shift; - - my $pathInfo = $self->SUPER::GDMPathInfo(); - - # create gdm.conf-custom instead of gdm.conf - $pathInfo->{config} = '/etc/gdm/custom.conf'; - - return $pathInfo; -} - -sub setupGDMScript -{ - my $self = shift; - my $repoPath = shift; - - my $script = $self->SUPER::setupGDMScript($repoPath); - - my $configFile = $self->GDMPathInfo->{config}; - - # include common stuff (independent of display manager used) - $script = _setupCommonDmScript($script); - - $script .= unshiftHereDoc(<<' End-of-Here'); - echo "DISPLAYMANAGER=GNOME" \ - >/mnt/etc/sysconfig/desktop - # gdm does not like AUFS/UnionFS on its var directory - mkdir -m 1770 /mnt/var/lib/gdm - chown root:gdm /mnt/var/lib/gdm - End-of-Here - - return $script; -} - -sub GDMConfigHashForWorkstation -{ - my $self = shift; - - my $configHash = $self->SUPER::GDMConfigHashForWorkstation(); - $configHash->{'daemon'}->{SessionDesktopDir} = - '/etc/X11/session/:/usr/share/xsessions/:/usr/share/gdm/BuiltInSessions'; - $configHash->{'daemon'}->{Greeter} = - '/usr/libexec/gdmgreeter'; - - return $configHash; -} - -sub setupKDMScript -{ - my $self = shift; - my $repoPath = shift; - - # SUSE reads /var/adm/kdm/kdmrc.sysconfig, so we link that to - # our config file - my $pathInfo = $self->KDMPathInfo(); - my $configFile = $pathInfo->{config}; - mkpath("/etc/opt/kdm"); - mkpath("/var/adm/kdm"); - # maybe backup kdmrc.sysconfig sometimes - unlink("/var/adm/kdm/kdmrc.sysconfig"); - # the config file gets overwritten if this script is present - unlink("/opt/kde3/share/apps/kdm/read_sysconfig.sh"); - symlink("/etc/opt/kdm/kdmrc", "/var/adm/kdm/kdmrc.sysconfig"); - - my $script = $self->SUPER::setupKDMScript($repoPath); - - # include common stuff (independent of display manager used) - $script = _setupCommonDmScript($script); - - $script .= unshiftHereDoc(<<' End-of-Here'); - echo "DISPLAYMANAGER=KDE" \ - >/mnt/etc/sysconfig/desktop - End-of-Here - - return $script; -} - -sub _setupCommonDmScript -{ - my $script = shift; - - $script .= unshiftHereDoc(<<' End-of-Here'); - # cleanup after users Xorg session - sed 's,^#!.*,,' /mnt/etc/X11/xdm/Xreset \ - > /mnt/etc/X11/xdm/Xreset.system - echo -e '#!/bin/sh\n#\n# modified by desktop plugin in Stage3\n#\n - # remove safely any remaining files of the leaving user in /tmp - ( su -c "rm -rf /tmp/*" - $USER - echo "$USER files removed by $0" >/tmp/files.removed 2>/dev/null ) & - . /etc/X11/xdm/Xreset.system' >/mnt/etc/X11/xdm/Xreset - chmod a+x /mnt/etc/X11/xdm/Xreset* - - # enable the inittab entry again (incomplete) - # sed -e "s,# line deleted.*,x:5:respawn:/etc/X11/prefdm -nodaemon," \ - # -i /mnt/etc/inittab - End-of-Here - - return $script; -} - -1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..2f0ad7cd --- /dev/null +++ b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# infoscreen/OpenSLX/Distro/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# infoscreen plugin. +# ----------------------------------------------------------------------------- +package infoscreen::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(infoscreen::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..a5988166 --- /dev/null +++ b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# infoscreen/OpenSLX/Distro/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the infoscreen +# plugin. +# ----------------------------------------------------------------------------- +package infoscreen::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(infoscreen::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..5f791132 --- /dev/null +++ b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# infoscreen/OpenSLX/Distro/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# infoscreen plugin. +# ----------------------------------------------------------------------------- +package infoscreen::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(infoscreen::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index e89d6d88..00000000 --- a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2009 - 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/ -# ----------------------------------------------------------------------------- -# infoscreen/OpenSLX/Distro/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the infoscreen -# plugin. -# ----------------------------------------------------------------------------- -package infoscreen::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(infoscreen::OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - - - - -1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..68877fd7 --- /dev/null +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# kiosk/OpenSLX/Distro/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# kiosk plugin. +# ----------------------------------------------------------------------------- +package kiosk::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(kiosk::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..6c0f9c9f --- /dev/null +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,28 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# kiosk/OpenSLX/Distro/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the kiosk plugin. +# ----------------------------------------------------------------------------- +package kiosk::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(kiosk::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..4e664c76 --- /dev/null +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# kiosk/OpenSLX/Distro/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# kiosk plugin. +# ----------------------------------------------------------------------------- +package kiosk::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(kiosk::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index 7423a3b8..00000000 --- a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2009 - 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/ -# ----------------------------------------------------------------------------- -# kiosk/OpenSLX/Distro/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the kiosk -# plugin. -# ----------------------------------------------------------------------------- -package kiosk::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(kiosk::OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - - - - -1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..99d12703 --- /dev/null +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# profile/OpenSLX/Distro/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# profile plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..92d599d8 --- /dev/null +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# profile/OpenSLX/Distro/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the profile +# plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..e040e3f8 --- /dev/null +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,29 @@ +# Copyright (c) 2009 - 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/ +# ----------------------------------------------------------------------------- +# profile/OpenSLX/Distro/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# profile plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index de66f02a..00000000 --- a/src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (c) 2009 - 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/ -# ----------------------------------------------------------------------------- -# profile/OpenSLX/Distro/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the profile -# plugin. -# ----------------------------------------------------------------------------- -package profile::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(profile::OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - - - - -1; diff --git a/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm b/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm index 0965b482..0100d553 100644 --- a/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm +++ b/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm @@ -131,7 +131,7 @@ sub getAttrInfo comma separated list. first will be started first, second second, and so on, max. 4 VMs End-of-Here - content_descr => 'name of xml file e.g. scilin-5.4-wn(.xml)', + content_descr => 'name of xml file e.g. rhel-5-wn(.xml)', default => undef, }, 'vmgrid::vt' => { -- cgit v1.2.3-55-g7522 From e66413628d95f8c9d91a2080768501946c0d5514 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 11 Dec 2012 17:20:53 +0100 Subject: sysrqshutdown plugin changed. now there is a second script which does the sysrq requests which is started with nohup, so that one can logout from ssh first --- .../OpenSLX/OSPlugin/sysrqshutdown.pm | 3 +- .../plugins/sysrqshutdown/files/shutdown | 29 +++++----------- .../plugins/sysrqshutdown/files/sysrqshutdown.sh | 39 ++++++++++++++++++++++ 3 files changed, 50 insertions(+), 21 deletions(-) create mode 100644 src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh (limited to 'src/os-plugins') diff --git a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm index bfc274d4..c30ec5dc 100644 --- a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm +++ b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm @@ -78,7 +78,8 @@ sub installationPhase if (! -e "/sbin/shutdown.slxorig") { system("mv /sbin/shutdown /sbin/shutdown.slxorig"); system("cp -p $pluginBasePath/shutdown /sbin/; - cp -p $pluginBasePath/shutdown /opt/openslx/plugin-repo/$pluginName"); + cp -p $pluginBasePath/shutdown $pluginBasePath/sysrqshutdown.sh \ + /opt/openslx/plugin-repo/$pluginName"); chmod 0755, "/sbin/shutdown"; } # else assume reinstall diff --git a/src/os-plugins/plugins/sysrqshutdown/files/shutdown b/src/os-plugins/plugins/sysrqshutdown/files/shutdown index a27481d7..1866d516 100644 --- a/src/os-plugins/plugins/sysrqshutdown/files/shutdown +++ b/src/os-plugins/plugins/sysrqshutdown/files/shutdown @@ -1,7 +1,7 @@ #!/bin/bash # ----------------------------------------------------------------------------- # Copyright (c) 2010 - RZ Uni FR -# Copyright (c) 2010 - OpenSLX GmbH +# Copyright (c) 2010 - 2012 OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -12,7 +12,7 @@ # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # shutdown -# - Script for SYSRQ shutdown +# - Script which prepares for SYSRQ shutdown ################################################################################ . /etc/opt/openslx/openslx.conf @@ -22,30 +22,19 @@ ################################################################################ PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins -PLUGINCONFVMGRID=${PLUGINCONFROOT}/sysrqshutdown -# include general configuration from vmgrid -if [ -f ${PLUGINCONFVMGRID}/sysrqshutdown.conf ]; then - . ${PLUGINCONFVMGRID}/sysrqshutdown.conf +PLUGINCONFSYSRQ=${PLUGINCONFROOT}/sysrqshutdown +PLUGINDIR=${OPENSLX_DEFAULT_DIR}/plugin-repo/sysrqshutdown + +# include general configuration from sysrqshutdown +if [ -f ${PLUGINCONFSYSRQ}/sysrqshutdown.conf ]; then + . ${PLUGINCONFSYSRQ}/sysrqshutdown.conf else sysrqshutdown_active=0 fi if [ ${sysrqshutdown_active} -eq 1 ]; then - # check if reboot or halt - if echo "$@" | grep -qe '-r now'; then - for i in $(echo s u b); do - echo $i > /proc/sysrq-trigger & - done - exit 0 - elif echo "$@" | grep -qe '-h now'; then - for i in $(echo s u o); do - echo $i > /proc/sysrq-trigger & - done - exit 0 - fi + nohup ${PLUGINDIR}/sysrqshutdown.sh $@ 2>/dev/null & fi -# else use orig shutdown -shutdown.slxorig $@ exit 0 diff --git a/src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh b/src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh new file mode 100644 index 00000000..7e575ed3 --- /dev/null +++ b/src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# Copyright (c) 2010 - RZ Uni FR +# Copyright (c) 2010 - 2012 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/ +# ----------------------------------------------------------------------------- +# sysrqshutdown.sh +# - Script for SYSRQ shutdown +################################################################################ + +# check if reboot or halt, else use orig shutdown +if echo "$@" | grep -qe '-r now' + then + echo "Rebooting $(hostname) (sysrq)!" + rq_opt="b" +elif echo "$@" | grep -qe '-h now' + then + echo "Shutting down $(hostname) (sysrq)!" + rq_opt="o" +else + shutdown.slxorig $@ & + exit 0 +fi + +echo s >/proc/sysrq-trigger +sleep 1 +echo u >/proc/sysrq-trigger +(sleep 3 >/dev/null; echo ${rq_opt} >/proc/sysrq-trigger) & +killall sshd >/dev/null 2>&1 + +exit 0 + -- cgit v1.2.3-55-g7522 From 54ab8ee903941dab5d360fc9340b29e7439dce20 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 11 Dec 2012 17:29:05 +0100 Subject: changed path to meet standard --- src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm | 4 ++-- src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/os-plugins') diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm index 5588a177..57fc3a27 100644 --- a/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm @@ -62,7 +62,7 @@ sub getKdeHome { my $self = shift; - return ".openslx/unknown/kde"; + return ".openslx/general/kde"; } sub getGconfPathConfig @@ -77,7 +77,7 @@ sub getGconfHome { my $self = shift; - return ".openslx/unknown/gconf"; + return ".openslx/general/gconf"; } diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm index 3b288e97..0cee752d 100644 --- a/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm @@ -45,7 +45,7 @@ sub getKdeHome { my $self = shift; - return ".openslx/ubuntu-lucid.kde"; + return ".openslx/ubuntu-10/kde"; } sub getGconfPathConfig @@ -60,7 +60,7 @@ sub getGconfHome { my $self = shift; - return ".openslx.ubuntu-lucid.gconf"; + return ".openslx/ubuntu-10/gconf"; } 1; -- cgit v1.2.3-55-g7522 From c0feaa89cc0f28a149db7a02cd573b3815a33625 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 12 Dec 2012 18:59:34 +0100 Subject: minor sysrq changes, nohup is needed to log out from ssh session before halt or reboot --- .../sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/os-plugins') diff --git a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm index c30ec5dc..07630fcb 100644 --- a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm +++ b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm @@ -70,23 +70,20 @@ sub installationPhase { my $self = shift; my $info = shift; - my $openslxBasePath = $info->{'openslx-base-path'}; - my $pluginName = $self->{'name'}; + my $openslxBasePath = $info->{'openslx-base-path'}; + my $pluginName = $self->{'name'}; my $pluginBasePath = "$openslxBasePath/lib/plugins/$pluginName/files"; + my $pluginDirPath = "/opt/openslx/plugin-repo/$pluginName"; # copy files if (! -e "/sbin/shutdown.slxorig") { system("mv /sbin/shutdown /sbin/shutdown.slxorig"); - system("cp -p $pluginBasePath/shutdown /sbin/; - cp -p $pluginBasePath/shutdown $pluginBasePath/sysrqshutdown.sh \ - /opt/openslx/plugin-repo/$pluginName"); - chmod 0755, "/sbin/shutdown"; - } - # else assume reinstall - elsif (-e "/sbin/shutdown.slxorig") { - system("cp -p $pluginBasePath/shutdown /sbin/"); - chmod 0755, "/sbin/shutdown"; } + system("cp -p $pluginBasePath/shutdown /sbin/; + cp -p $pluginBasePath/shutdown $pluginDirPath; + cp -p $pluginBasePath/sysrqshutdown.sh $pluginDirPath"); + chmod 0755, "/sbin/shutdown", "$pluginDirPath/shutdown", + "$pluginDirPath/sysrqshutdown.sh"; return; } -- cgit v1.2.3-55-g7522