Compare commits
	
		
			4 Commits
		
	
	
		
			11_0_0-62_
			...
			11_0_0-65_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 82ff48e641 | |||
| c5d863b3a0 | |||
| 4f00dfbdb1 | |||
| f9bf8cf064 | 
							
								
								
									
										9
									
								
								root/usr/lib/systemd/system/bootsequence.service
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								root/usr/lib/systemd/system/bootsequence.service
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
[Unit]
 | 
			
		||||
Description=Koozali SME Server boot diagnostic tool
 | 
			
		||||
After=sme-server.target
 | 
			
		||||
PartOf=sme-server.target
 | 
			
		||||
 | 
			
		||||
[Service]
 | 
			
		||||
Type=oneshot
 | 
			
		||||
ExecStart=/bin/sh -c "/usr/bin/systemd-analyze plot > /usr/share/smanager/themes/default/public/images/boot.svg"
 | 
			
		||||
RemainAfterExit=yes
 | 
			
		||||
@@ -526,13 +526,13 @@ sub do_update {
 | 
			
		||||
 | 
			
		||||
    # common part for all functions
 | 
			
		||||
    if ($res ne 'OK') {
 | 
			
		||||
 | 
			
		||||
        if ($res eq 'NEXT') {
 | 
			
		||||
            $dest = 'back_' . $bac_datas{"function"};
 | 
			
		||||
        } else {
 | 
			
		||||
            $c->stash(error => $result);
 | 
			
		||||
            $dest = "back_$function";
 | 
			
		||||
        }
 | 
			
		||||
        $bac_datas{vfstype}        = $c->param('VFSType');
 | 
			
		||||
        $c->stash(title => $title, bac_datas => \%bac_datas);
 | 
			
		||||
        return $c->render($dest);
 | 
			
		||||
    } ## end if ($res ne 'OK')
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,9 @@ use File::Basename;
 | 
			
		||||
use SrvMngr qw( gen_locale_date_string );
 | 
			
		||||
our $cdb = esmith::ConfigDB->open or die "Couldn't open ConfigDB\n";
 | 
			
		||||
 | 
			
		||||
use constant FALSE => 0;
 | 
			
		||||
use constant TRUE  => 1;
 | 
			
		||||
 | 
			
		||||
# Get some basic info on the current SME install
 | 
			
		||||
our $sysconfig          = $cdb->get('sysconfig');
 | 
			
		||||
our $systemmode         = $cdb->get('SystemMode')->value;
 | 
			
		||||
@@ -78,7 +81,7 @@ sub create_configuration_report {
 | 
			
		||||
    # create the reporting template
 | 
			
		||||
    my $configreport_template = Text::Template->new(
 | 
			
		||||
        TYPE    => 'FILE',
 | 
			
		||||
        SOURCE  => '/etc/e-smith/web/common/configuration_report.tmpl',
 | 
			
		||||
        SOURCE  => '/usr/share/smanager/themes/default/public/configuration_report.tmpl',
 | 
			
		||||
        UNTAINT => 1
 | 
			
		||||
    );
 | 
			
		||||
    my $report_creation_time = gen_locale_date_string;
 | 
			
		||||
@@ -114,13 +117,40 @@ sub create_configuration_report {
 | 
			
		||||
 | 
			
		||||
    # prcess template
 | 
			
		||||
    my $result = $configreport_template->fill_in(HASH => \%vars);
 | 
			
		||||
    
 | 
			
		||||
    #take out any multiple blank lines
 | 
			
		||||
    #$result =~ s/\n{3,}/\n/g;
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    # write processed template to file
 | 
			
		||||
    open(my $cfgrep, '>', $configreportfile) or die "Could not create temporary file for config report!";
 | 
			
		||||
    print $cfgrep $result;
 | 
			
		||||
    close $cfgrep;
 | 
			
		||||
    
 | 
			
		||||
    #check if boot phase has completed.
 | 
			
		||||
	if (wait_for_boot_completion()) {
 | 
			
		||||
		#And create boot analysis image - now run externally following boot.
 | 
			
		||||
		$result = `/usr/bin/systemctl start bootsequence.service`;
 | 
			
		||||
		if (!$? == 0) {
 | 
			
		||||
			warn "/usr/bin/systemd-analyze plot Command failed \n";
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
  
 | 
			
		||||
} ## end sub create_configuration_report
 | 
			
		||||
 | 
			
		||||
sub wait_for_boot_completion {
 | 
			
		||||
    my $timeout = 60;  # 1-minute timeout
 | 
			
		||||
    my $end_time = time() + $timeout;
 | 
			
		||||
    while (time() < $end_time) {
 | 
			
		||||
        if (`systemctl list-jobs 2>&1` =~ /No jobs running/) {
 | 
			
		||||
            return TRUE;  # Success
 | 
			
		||||
        }
 | 
			
		||||
        sleep 5;
 | 
			
		||||
    }
 | 
			
		||||
    warn "Boot did not complete within $timeout seconds.\n";
 | 
			
		||||
    return FALSE;  # Failure
 | 
			
		||||
} ## end wait_for_boot_completion
 | 
			
		||||
 | 
			
		||||
sub show_config_report {
 | 
			
		||||
    my $c   = shift;
 | 
			
		||||
    my $out = '';
 | 
			
		||||
@@ -143,4 +173,4 @@ sub download_config_report {
 | 
			
		||||
        'cleanup'             => 1,
 | 
			
		||||
    );
 | 
			
		||||
} ## end sub download_config_report
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
Configuration report created {$report_creation_time}
 | 
			
		||||
 | 
			
		||||
==================
 | 
			
		||||
Base configuration
 | 
			
		||||
==================
 | 
			
		||||
SME server version: 	  {$releaseversion}
 | 
			
		||||
SME server mode:    	  {$systemmode}
 | 
			
		||||
SME server previous mode: {$previoussystemmode }
 | 
			
		||||
Running Kernel:     	  {$curkernel}
 | 
			
		||||
===========================
 | 
			
		||||
New RPMs not in base system
 | 
			
		||||
===========================     
 | 
			
		||||
{ foreach $i (@newrpms) {
 | 
			
		||||
            $OUT .= "$i";
 | 
			
		||||
          }    
 | 
			
		||||
} 
 | 
			
		||||
===========================
 | 
			
		||||
Custom and modified templates
 | 
			
		||||
===========================
 | 
			
		||||
{ foreach $i (@templates) {
 | 
			
		||||
            $OUT .= "$i";
 | 
			
		||||
          }
 | 
			
		||||
}
 | 
			
		||||
===========================
 | 
			
		||||
Modified events
 | 
			
		||||
===========================
 | 
			
		||||
{ foreach $i (@events) {
 | 
			
		||||
            $OUT .= "$i";
 | 
			
		||||
          }
 | 
			
		||||
}
 | 
			
		||||
=======================
 | 
			
		||||
Additional repositories
 | 
			
		||||
=======================
 | 
			
		||||
{ foreach $r (@repositories) {
 | 
			
		||||
            $OUT .= "$r";
 | 
			
		||||
          }
 | 
			
		||||
}   		
 | 
			
		||||
DONE!
 | 
			
		||||
@@ -18,9 +18,16 @@
 | 
			
		||||
    <% my $btn = l('bugr_Download this report'); %>
 | 
			
		||||
 | 
			
		||||
    %= form_for 'bugreportD' => (method => 'POST') => begin
 | 
			
		||||
	%= submit_button "$btn", class => 'action'
 | 
			
		||||
	%= hidden_field 'trt' => $bugr_datas->{trt}
 | 
			
		||||
    % end    
 | 
			
		||||
		%= submit_button "$btn", class => 'action'
 | 
			
		||||
		%= hidden_field 'trt' => $bugr_datas->{trt}
 | 
			
		||||
    % end   
 | 
			
		||||
    
 | 
			
		||||
    % my $out = "================== <br />";
 | 
			
		||||
    % $out .= "Boot anaysis image (right click and save image to download)<br />";
 | 
			
		||||
    % $out .= "================== <br />";
 | 
			
		||||
    % $out .= "<img src='images/boot.svg' alt='boot timing image' width=95% >";
 | 
			
		||||
    
 | 
			
		||||
   <br><%= $c->render_to_string(inline=>$out) %><br>
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ Summary: Sme server  navigation module : manager 2
 | 
			
		||||
%define name smeserver-manager
 | 
			
		||||
Name: %{name}
 | 
			
		||||
%define version 11.0.0
 | 
			
		||||
%define release 62
 | 
			
		||||
%define release 65
 | 
			
		||||
Version: %{version}
 | 
			
		||||
Release: %{release}%{?dist}
 | 
			
		||||
License: GPL
 | 
			
		||||
@@ -143,8 +143,19 @@ true
 | 
			
		||||
%defattr(-,root,root)
 | 
			
		||||
 | 
			
		||||
%changelog
 | 
			
		||||
* Sun Mar 09 2025 Brian Read <brianr@koozali.org> 11.0.0-65.sme
 | 
			
		||||
- Sort out missing hostname on nfs and cifs workstation backup on error [SME: 12948]
 | 
			
		||||
 | 
			
		||||
* Sat Mar 08 2025 Brian Read <brianr@koozali.org> 11.0.0-64.sme
 | 
			
		||||
- Add code to check for boot phase completion [SME: 12953]
 | 
			
		||||
 | 
			
		||||
* Thu Mar 06 2025 Brian Read <brianr@koozali.org> 11.0.0-63.sme
 | 
			
		||||
- Add boot.svg image to Bug Report panel [SME: 12953]
 | 
			
		||||
- Move report template to inside smanager tree
 | 
			
		||||
- Add one-off systemd task to create boot.svg run from panel
 | 
			
		||||
 | 
			
		||||
* Tue Mar 04 2025 Brian Read <brianr@koozali.org> 11.0.0-62.sme
 | 
			
		||||
- Update .lex files to conform to standard english punctuation  [SME: 11809]
 | 
			
		||||
- Update *_en.lex files to conform to standard english punctuation  [SME: 11809]
 | 
			
		||||
 | 
			
		||||
* Tue Mar 04 2025 Brian Read <brianr@koozali.org> 11.0.0-61.sme
 | 
			
		||||
- Arrange for the version in the footer to be suppressed if non admin login  [SME: 12887]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user