diff options
author | Sebastian Schmelzer | 2008-10-14 23:07:15 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2008-10-14 23:07:15 +0200 |
commit | 1d927e87ad5183c56e3b24e403c1a1c6e53795d7 (patch) | |
tree | 982fdffcf64e4eab02a11383844d8df645a36fe3 /os-plugins/plugins/x11vnc/OpenSLX/Distro | |
parent | removed bug where kdmrc.sysconfig is not replaced (diff) | |
download | core-1d927e87ad5183c56e3b24e403c1a1c6e53795d7.tar.gz core-1d927e87ad5183c56e3b24e403c1a1c6e53795d7.tar.xz core-1d927e87ad5183c56e3b24e403c1a1c6e53795d7.zip |
* added distro specific runlevel scripts
* fixed bug #281
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2300 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/x11vnc/OpenSLX/Distro')
-rw-r--r-- | os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm | 91 | ||||
-rw-r--r-- | os-plugins/plugins/x11vnc/OpenSLX/Distro/Debian.pm | 88 | ||||
-rw-r--r-- | os-plugins/plugins/x11vnc/OpenSLX/Distro/Fedora.pm | 30 | ||||
-rw-r--r-- | os-plugins/plugins/x11vnc/OpenSLX/Distro/Gentoo.pm | 30 | ||||
-rw-r--r-- | os-plugins/plugins/x11vnc/OpenSLX/Distro/Suse.pm | 91 | ||||
-rw-r--r-- | os-plugins/plugins/x11vnc/OpenSLX/Distro/Ubuntu.pm | 23 |
6 files changed, 353 insertions, 0 deletions
diff --git a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm new file mode 100644 index 00000000..fb69f97a --- /dev/null +++ b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Base.pm @@ -0,0 +1,91 @@ +# 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/ +# ----------------------------------------------------------------------------- +# x11vnc/OpenSLX/Distro/Base.pm +# - provides base implementation of the Distro API for the x11vnc plugin. +# ----------------------------------------------------------------------------- +package x11vnc::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; + my $engine = shift; + + return 1; +} + +sub fillRunlevelScript +{ + my $self = shift; + + my $script = unshiftHereDoc(<<" End-of-Here"); + #! /bin/sh + # completely generic start/stop script, generated via stage1 'x11vnc' plugin + # install + # + # This script manages the services needed to run x11vnc software + + # Basic support for the Linux Standard Base Specification 1.3 + ### BEGIN INIT INFO + # Provides: x11vnc + # Required-Start: + # Required-Stop: + # Default-Start: + # Default-Stop: + # Short-Description: Manages the services needed to run x11vnc software + # Description: Manages the services needed to run x11vnc software + ### END INIT INFO + + [ -f /opt/openslx/plugin-repo/x11vnc/x11vnc-init ] \\ + && CMD="/opt/openslx/plugin-repo/x11vnc/x11vnc-init" + + case \$1 in + start) + echo "Starting x11vnc ..." + \$CMD start + ;; + stop) + # message output should match the given vendor-os + echo "Stopping x11vnc ..." + \$CMD stop + ;; + #status) + # echo "Say something useful here ..." + #;; + restart) + "\$0" stop + "\$0" start + ;; + esac + exit 0 + End-of-Here + return $script; +} + +1; diff --git a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Debian.pm b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Debian.pm new file mode 100644 index 00000000..6623d22f --- /dev/null +++ b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Debian.pm @@ -0,0 +1,88 @@ +# 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/ +# ----------------------------------------------------------------------------- +# x11vnc/OpenSLX/Distro/debian.pm +# - provides Debian-specific overrides of the Distro API for the x11vnc +# plugin. +# ----------------------------------------------------------------------------- +package x11vnc::OpenSLX::Distro::Debian; + +use strict; +use warnings; + +use base qw(x11vnc::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub fillRunlevelScript +{ + my $self = shift; + + my $script = unshiftHereDoc(<<" End-of-Here"); + #!/bin/sh + # Ubuntu/Debian specific start/stop script, generated via stage1 'x11vnc' + # plugin install + # inspiration taken from x11vnc start script: + # Copyright 1998-2007 x11vnc, Inc. All rights reserved. + # + # This script manages the services needed to run x11vnc software + + # Basic support for the Linux Standard Base Specification 1.3 + ### BEGIN INIT INFO + # Provides: x11vnc + # Required-Start: \$syslog + # Required-Stop: + # Default-Start: 2 3 5 + # Default-Stop: 0 6 + # Short-Description: Manages the services needed to run x11vnc software + # Description: Manages the services needed to run x11vnc software + ### END INIT INFO + + # initialize the lsb status messages + . /lib/lsb/init-functions + + [ -f /opt/openslx/plugin-repo/x11vnc/x11vnc-init ] \\ + && CMD="/opt/openslx/plugin-repo/x11vnc/x11vnc-init" + + case \$1 in + start) + log_daemon_msg "Starting x11vnc background services ..." "x11vnc" + \$CMD start + log_end_msg \$? + ;; + stop) + log_daemon_msg "Stopping x11vnc background services ..." "x11vnc" + \$CMD stop + log_end_msg \$? + ;; + #status) + # log_daemon_msg "Say something useful here ..." + #;; + restart) + \$0 stop + \$0 start + exit $? + ;; + *) + log_success_msg "Usage: \$0 {start|stop|restart}" + exit 2 + ;; + esac + exit 0 + End-of-Here + return $script; +} + +1; diff --git a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Fedora.pm b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Fedora.pm new file mode 100644 index 00000000..a1678912 --- /dev/null +++ b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Fedora.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/ +# ----------------------------------------------------------------------------- +# x11vnc/OpenSLX/Distro/Fedora.pm +# - provides Fedora-specific overrides of the Distro API for the x11vnc +# plugin. +# ----------------------------------------------------------------------------- +package x11vnc::OpenSLX::Distro::Fedora; + +use strict; +use warnings; + +use base qw(x11vnc::OpenSLX::Distro::Base); + +use OpenSLX::Basics; + +################################################################################ +### interface methods +################################################################################ + +# TODO: implement! + +1; diff --git a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Gentoo.pm b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Gentoo.pm new file mode 100644 index 00000000..1bacf1d8 --- /dev/null +++ b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Gentoo.pm @@ -0,0 +1,30 @@ +# 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/ +# ----------------------------------------------------------------------------- +# x11vnc/OpenSLX/Distro/Gentoo.pm +# - provides Gentoo-specific overrides of the Distro API for the x11vnc +# plugin. +# ----------------------------------------------------------------------------- +package x11vnc::OpenSLX::Distro::Gentoo; + +use strict; +use warnings; + +use base qw(x11vnc::OpenSLX::Distro::Base); + +use OpenSLX::Basics; + +################################################################################ +### interface methods +################################################################################ + +# TODO: implement! + +1; diff --git a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Suse.pm new file mode 100644 index 00000000..f43a3893 --- /dev/null +++ b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Suse.pm @@ -0,0 +1,91 @@ +# 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/ +# ----------------------------------------------------------------------------- +# x11vnc/OpenSLX/Distro/Suse.pm +# - provides SUSE-specific overrides of the Distro API for the x11vnc plugin. +# ----------------------------------------------------------------------------- +package x11vnc::OpenSLX::Distro::Suse; + +use strict; +use warnings; + +use base qw(x11vnc::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub fillRunlevelScript +{ + my $self = shift; + + my $script = unshiftHereDoc(<<" End-of-Here"); + #!/bin/sh + # SuSE compatible start/stop script, generated via stage1 'x11vnc' plugin + # installation + # + # inspiration taken from x11vnc start script: + # Copyright 1998-2007 x11vnc, Inc. All rights reserved. + # + # This script manages the services needed to run x11vnc software + + # Basic support for the Linux Standard Base Specification 1.3 + ### BEGIN INIT INFO + # Provides: x11vnc + # Required-Start: \$syslog + # Required-Stop: + # Default-Start: 2 3 5 + # Default-Stop: 0 6 + # Short-Description: Manages the services needed to run x11vnc software + # Description: Manages the services needed to run x11vnc software + ### END INIT INFO + + # load the helper stuff + . /etc/rc.status + # reset the script status + rc_reset + + [ -f /opt/openslx/plugin-repo/x11vnc/x11vnc-init ] \\ + && CMD="/opt/openslx/plugin-repo/x11vnc/x11vnc-init" + + case \$1 in + start) + echo -n "Starting x11vnc background services ..." + \$CMD start + rc_status -v + ;; + stop) + # message output should match the given vendor-os + echo -n "Stopping x11vnc background services ..." + rc_reset + \$CMD stop + rc_status -v + ;; + #status) + # echo -n "Say something useful here ..." + #;; + restart) + "\$0" stop + "\$0" start + ;; + *) + echo "Usage: `basename "\$0"` {start|stop|restart}" + exit 1 + ;; + esac + exit 0 + End-of-Here + return $script; +} + +1; diff --git a/os-plugins/plugins/x11vnc/OpenSLX/Distro/Ubuntu.pm b/os-plugins/plugins/x11vnc/OpenSLX/Distro/Ubuntu.pm new file mode 100644 index 00000000..3379f14d --- /dev/null +++ b/os-plugins/plugins/x11vnc/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/ +# ----------------------------------------------------------------------------- +# x11vnc/OpenSLX/Distro/Ubuntu.pm +# - provides Ubuntu-specific overrides of the Distro API for the x11vnc +# plugin. +# ----------------------------------------------------------------------------- +package x11vnc::OpenSLX::Distro::Ubuntu; + +use strict; +use warnings; + +# inherit everything from Debian (as Ubuntu is based on it anyway) +use base qw(x11vnc::OpenSLX::Distro::Debian); + +1; |