summaryrefslogtreecommitdiffstats
path: root/lib/OpenSLX/DistroUtils/Ubuntu.pm
diff options
context:
space:
mode:
authorSebastian Schmelzer2009-08-11 14:06:52 +0200
committerSebastian Schmelzer2009-08-11 14:06:52 +0200
commit1a05343d41fb6d7fb4c3f6a1b2cdc9522bb035ce (patch)
tree63bbf06fba7ee341c0003a70f2f32452577af1b0 /lib/OpenSLX/DistroUtils/Ubuntu.pm
parentDo nothing if no partition found ... (diff)
downloadcore-1a05343d41fb6d7fb4c3f6a1b2cdc9522bb035ce.tar.gz
core-1a05343d41fb6d7fb4c3f6a1b2cdc9522bb035ce.tar.xz
core-1a05343d41fb6d7fb4c3f6a1b2cdc9522bb035ce.zip
distroutils update
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3069 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/DistroUtils/Ubuntu.pm')
-rw-r--r--lib/OpenSLX/DistroUtils/Ubuntu.pm77
1 files changed, 77 insertions, 0 deletions
diff --git a/lib/OpenSLX/DistroUtils/Ubuntu.pm b/lib/OpenSLX/DistroUtils/Ubuntu.pm
index b2526828..915c19c6 100644
--- a/lib/OpenSLX/DistroUtils/Ubuntu.pm
+++ b/lib/OpenSLX/DistroUtils/Ubuntu.pm
@@ -84,9 +84,86 @@ sub _renderHighlevelConfig {
$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}
+ );
+
}
+
}
}