diff options
author | Sebastian Schmelzer | 2009-04-14 14:59:13 +0200 |
---|---|---|
committer | Sebastian Schmelzer | 2009-04-14 14:59:13 +0200 |
commit | 40723717042782953fc94985b1d63802259e77af (patch) | |
tree | 9c82e356ea7b59c81f94b4712cbe4f1ba38e8b88 /lib/OpenSLX/DistroUtils/Ubuntu.pm | |
parent | Removed non-uclibc busyboxes as no longer needed (hopefully :)) (diff) | |
download | core-40723717042782953fc94985b1d63802259e77af.tar.gz core-40723717042782953fc94985b1d63802259e77af.tar.xz core-40723717042782953fc94985b1d63802259e77af.zip |
current state of work on runlevel generator.. (still not fully useable)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2813 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/DistroUtils/Ubuntu.pm')
-rw-r--r-- | lib/OpenSLX/DistroUtils/Ubuntu.pm | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/lib/OpenSLX/DistroUtils/Ubuntu.pm b/lib/OpenSLX/DistroUtils/Ubuntu.pm index dceae7e4..b2526828 100644 --- a/lib/OpenSLX/DistroUtils/Ubuntu.pm +++ b/lib/OpenSLX/DistroUtils/Ubuntu.pm @@ -1,4 +1,4 @@ -# Copyright (c) 2008 - OpenSLX GmbH +# Copyright (c) 2008, 2009 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -19,6 +19,22 @@ 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; @@ -32,7 +48,7 @@ sub _renderHighlevelConfig { $element->{binary} =~ m/\/([^\/]*)$/; my $shortname = $1; my $tpl = "export %s_PARAMS=\"%s\" \n"; - $tpl .= "[ -f /etc/default/%s ] . /etc/default/%s \n"; + $tpl .= "if [ -f /etc/default/%s ]; then . /etc/default/%s; fi \n"; $initFile->addToBlock('head', sprintf( $tpl, @@ -44,12 +60,15 @@ sub _renderHighlevelConfig { ); - $tpl = "start-stop-daemon --start --quiet --oknodo "; + $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->addToBlock('start', + $initFile->addToCase('start', sprintf( $tpl, + $element->{description}, + $shortname, $shortname, $element->{binary}, uc($shortname) @@ -59,7 +78,7 @@ sub _renderHighlevelConfig { $tpl = "start-stop-daemon --stop --quiet --oknodo "; $tpl .= "--pidfile /var/run/%s.pid \n"; $tpl .= "log_end_msg \$?"; - $initFile->addToBlock('stop', + $initFile->addToCase('stop', sprintf( $tpl, $shortname @@ -73,16 +92,4 @@ sub _renderHighlevelConfig { } -sub generateInitFile -{ - my $self = shift; - my $initFile = shift; - - $initFile->addToBlock('head', '#ubuntu test'); - - $self->_renderHighlevelConfig($initFile); - - return $self->SUPER::generateInitFile($initFile); -} - 1;
\ No newline at end of file |