summaryrefslogtreecommitdiffstats
path: root/lib/OpenSLX/DistroUtils/Ubuntu.pm
diff options
context:
space:
mode:
authorSebastian Schmelzer2010-09-02 17:50:49 +0200
committerSebastian Schmelzer2010-09-02 17:50:49 +0200
commit416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5 (patch)
tree4715f7d742fec50931017f38fe6ff0a89d4ceccc /lib/OpenSLX/DistroUtils/Ubuntu.pm
parentFix for the problem reported on the list (sed filter forgotten for the (diff)
downloadcore-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.gz
core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.tar.xz
core-416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5.zip
change dir structure
Diffstat (limited to 'lib/OpenSLX/DistroUtils/Ubuntu.pm')
-rw-r--r--lib/OpenSLX/DistroUtils/Ubuntu.pm172
1 files changed, 0 insertions, 172 deletions
diff --git a/lib/OpenSLX/DistroUtils/Ubuntu.pm b/lib/OpenSLX/DistroUtils/Ubuntu.pm
deleted file mode 100644
index 915c19c6..00000000
--- a/lib/OpenSLX/DistroUtils/Ubuntu.pm
+++ /dev/null
@@ -1,172 +0,0 @@
-# Copyright (c) 2008, 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/
-# -----------------------------------------------------------------------------
-# Ubuntu.pm
-# - provides ubuntu specific functions for distro based utils for OpenSLX
-# -----------------------------------------------------------------------------
-package OpenSLX::DistroUtils::Ubuntu;
-
-use strict;
-use warnings;
-use Switch;
-
-use base qw(OpenSLX::DistroUtils::Base);
-
-sub _getInitsystemIncludes
-{
- return ". /lib/lsb/init-functions\n\n";
-}
-
-sub _renderCasePrefix
-{
- return "";
-}
-
-sub _renderFooter
-{
- return "exit 0\n";
-}
-
-
-sub _renderHighlevelConfig {
- my $self = shift;
- my $initFile = shift;
-
- my $element;
- my $hlc = $initFile->{'configHash'}->{'highlevelConfig'};
-
- while ( $element = shift(@$hlc)){
- switch ($element->{type}) {
- case 'daemon' {
- $element->{binary} =~ m/\/([^\/]*)$/;
- my $shortname = $1;
- my $tpl = "export %s_PARAMS=\"%s\" \n";
- $tpl .= "if [ -f /etc/default/%s ]; then . /etc/default/%s; fi \n";
- $initFile->addToBlock('head',
- sprintf(
- $tpl,
- uc($shortname),
- $element->{parameters},
- $shortname,
- $shortname
- )
- );
-
-
- $tpl = "log_daemon_msg \"Starting %s\" \"%s\" \n";
- $tpl .= "start-stop-daemon --start --quiet --oknodo ";
- $tpl .= "--pidfile /var/run/%s.pid --exec %s -- \$%s_PARAMS \n";
- $tpl .= "log_end_msg \$?";
- $initFile->addToCase('start',
- sprintf(
- $tpl,
- $element->{description},
- $shortname,
- $shortname,
- $element->{binary},
- uc($shortname)
- )
- );
-
- $tpl = "start-stop-daemon --stop --quiet --oknodo ";
- $tpl .= "--pidfile /var/run/%s.pid \n";
- $tpl .= "log_end_msg \$?";
- $initFile->addToCase('stop',
- sprintf(
- $tpl,
- $shortname
- )
- );
-
- $tpl = "log_daemon_msg \"Restarting %s\" \"%s\"\n";
- $tpl .= "\$0 stop\n";
- $tpl .= "case \"\$?\" in\n";
- $tpl .= " 0|1)\n";
- $tpl .= " \$0 start\n";
- $tpl .= " case \"\$?\" in\n";
- $tpl .= " 0) log_end_msg 0 ;;\n";
- $tpl .= " 1) log_end_msg 1 ;; # Old process is still running\n";
- $tpl .= " *) log_end_msg 1 ;; # Failed to start\n";
- $tpl .= " esac\n";
- $tpl .= " ;;\n";
- $tpl .= " *)\n";
- $tpl .= " # Failed to stop\n";
- $tpl .= " log_end_msg 1\n";
- $tpl .= " ;;\n";
- $tpl .= "esac\n";
- $tpl .= ";;\n";
-
- $initFile->addToCase('restart',
- sprintf(
- $tpl,
- $shortname
- )
- );
-
-
- $tpl = "start-stop-daemon --stop --signal 1 --quiet ";
- $tpl .= "--pidfile /var/run/%s.pid --name \$s\n";
- $tpl .= "return 0\n";
- $initFile->addToCase('reload',
- sprintf(
- $tpl,
- $shortname,
- $element->{binary}
- )
- );
-
- $tpl = "status_of_proc -p /var/run/%s.pid %s_BIN %s && exit 0 || exit \$?";
- $initFile->addToCase('status',
- sprintf(
- $tpl,
- $element->{shortname},
- $element->{binary},
- $element->{shortname}
- )
- );
-
-
- }
- case 'function' {
- my $tpl;
- $tpl = "%s () { \n";
- $tpl .= "%s";
- $tpl .= "\n}\n";
- $initFile->addToBlock('functions',
- sprintf(
- $tpl,
- $element->{name},
- $element->{script}
- )
- );
-
- }
- case 'functionCall' {
- my $tpl;
- $tpl = "%s %s\n";
- #$tpl .= "%s\n ";
- $initFile->addToCase($element->{block},
- sprintf(
- $tpl,
- $element->{function},
- $element->{parameters},
- ""
- ),
- $element->{priority}
- );
-
- }
-
- }
- }
-
-}
-
-1; \ No newline at end of file