Changeset 3504057


Ignore:
Timestamp:
06/19/15 07:35:49 (6 weeks ago)
Author:
Ken Moore <ken@…>
Branches:
master
Children:
577b95a, e3531ea
Parents:
b7726c4a
Message:

Add better handling of pc-updatemanager crashes. If no update process could be found and syscache is still stopped, restart syscache and tray again in a moment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt5/pc-updategui/mainUI.cpp

    rb7726c4a r3504057  
    8383  //Parse the system status to determine the  updates that are available 
    8484  QStringList info = pcbsd::Utils::runShellCommand("syscache needsreboot isupdating hasmajorupdates hassecurityupdates haspcbsdupdates \"pkg #system hasupdates\""); 
     85  if(info.length() < 6){ 
     86    if(0!=QProcess::execute("pgrep -F /tmp/.updateInProgress")){ 
     87      //Something went wrong with the update/syscache, restart syscache and try again 
     88      qDebug() << "System Error - no update process running, and syscache is still stopped"; 
     89      qDebug() << " -- restarting syscache"; 
     90      QProcess::startDetached("service syscache start"); 
     91      QTimer::singleShot(100, this, SLOT(UpdateUI()) ); 
     92      return; 
     93    } 
     94  }        
     95         
    8596  if(info.length() < 6){  
    8697    //Is syscache not running? 
     
    90101    info << "true" << "true" << "false" << "false" << "false" << "false"; 
    91102    if(!QFile::exists("/tmp/.rebootRequired")){ info[0] = "false"; } 
     103    if(0!=QProcess::execute("pgrep -F /tmp/.updateInProgress")){ info[1] = "false"; } 
    92104  } 
    93105  bool hasmajor = (info[2]=="true"); 
Note: See TracChangeset for help on using the changeset viewer.