* Sat Mar 08 2025 Brian Read <brianr@koozali.org> 11.0.0-64.sme
- Add code to check for boot phase completion [SME: 12953]
This commit is contained in:
		@@ -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;
 | 
			
		||||
@@ -124,15 +127,30 @@ sub create_configuration_report {
 | 
			
		||||
    print $cfgrep $result;
 | 
			
		||||
    close $cfgrep;
 | 
			
		||||
    
 | 
			
		||||
    #And create boot analysis image - now run externally by systemd, only run once per boot.
 | 
			
		||||
    $result = `/usr/bin/systemctl start bootsequence.service`;
 | 
			
		||||
    if (!$? == 0) {
 | 
			
		||||
		warn "/usr/bin/systemd-analyze plot Command failed \n";
 | 
			
		||||
    #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 = '';
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ Summary: Sme server  navigation module : manager 2
 | 
			
		||||
%define name smeserver-manager
 | 
			
		||||
Name: %{name}
 | 
			
		||||
%define version 11.0.0
 | 
			
		||||
%define release 63
 | 
			
		||||
%define release 64
 | 
			
		||||
Version: %{version}
 | 
			
		||||
Release: %{release}%{?dist}
 | 
			
		||||
License: GPL
 | 
			
		||||
@@ -143,6 +143,9 @@ true
 | 
			
		||||
%defattr(-,root,root)
 | 
			
		||||
 | 
			
		||||
%changelog
 | 
			
		||||
* 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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user