/[cvs]/nfo/perl/scripts/umltools/uml_setup.pl
ViewVC logotype

Diff of /nfo/perl/scripts/umltools/uml_setup.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Tue Oct 22 02:25:56 2002 UTC revision 1.2 by joko, Sun Nov 3 01:20:19 2002 UTC
# Line 75  if ($bool_argsInvalid) { Line 75  if ($bool_argsInvalid) {
75    usage();    usage();
76  }  }
77    
78  if ($glbl_ask) { our $DEBUG_STEP; $DEBUG_STEP = 1; }  if ($glbl_ask) {
79      our $DEBUG_STEP;
80      $DEBUG_STEP = 1;
81      $UML::Config::DEBUG_STEP = 1;
82    }
83    
84  my $vhost = get_host_cfg($vhost_name);  my $vhost = get_host_cfg($vhost_name);
85  my %vhost = %{$vhost};  my %vhost = %{$vhost};
# Line 171  if ($bool_daemonize) { Line 175  if ($bool_daemonize) {
175    my $initscript_path = "/etc/init.d/$daemon";    my $initscript_path = "/etc/init.d/$daemon";
176    my $runlevel_base = "/etc/init.d/rc$runlevel.d";    my $runlevel_base = "/etc/init.d/rc$runlevel.d";
177    
178      my $owner = $vhost->{main}{owner};
179    
180      # TODO: handle if above determined parameters are not set
181      #       try not to write out invalid shell scripts!
182    
183    # main init script    # main init script
184    $content = "#!/usr/bin/perl    $content = "#!/usr/bin/perl
185    
186  use strict;  use strict;
187  use warnings;  use warnings;
188  my \$action = shift;  my \$action = shift;
189  if (!\$action) {  if (!\$action) {
190    print \"no action!\", \"\\n\";    print \"\$0 called without action argument!\", \"\\n\";
191    exit;    exit;
192  }  }
193  if (\$action eq \"start\") {  if (\$action eq \"start\") {
194    system(\"$uml_boot --start --vhost=$vhost_name\");    system(\"$uml_boot --prepare --vhost=$vhost_name\");
195      system(\"$sudo -u $owner $uml_boot --start --vhost=$vhost_name\");
196  }  }
197  if (\$action eq \"stop\") {  if (\$action eq \"stop\") {
198    system(\"$uml_boot --stop --vhost=$vhost_name\");    system(\"$uml_boot --stop --vhost=$vhost_name\");
# Line 195  if (\$action eq \"stop\") { Line 206  if (\$action eq \"stop\") {
206    # runlevel init scripts    # runlevel init scripts
207    $filename = "$runlevel_base/S30$daemon";    $filename = "$runlevel_base/S30$daemon";
208    $cmd = "rm $filename; ln $initscript_path -s $filename";    $cmd = "rm $filename; ln $initscript_path -s $filename";
209    askCmd("do it?", $cmd, "unmounting datafs");    askCmd("do it?", $cmd, "create $filename");
210    chmod S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH, $filename;    chmod S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH, $filename;
211    
212    $filename = "$runlevel_base/K01$daemon";    $filename = "$runlevel_base/K01$daemon";
213    $cmd = "rm $filename; ln $initscript_path -s $filename";    $cmd = "rm $filename; ln $initscript_path -s $filename";
214    askCmd("do it?", $cmd, "unmounting datafs");    askCmd("do it?", $cmd, "create $filename");
215    chmod S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH, $filename;    chmod S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH, $filename;
216    
217  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed