Skip to content

OSUpdateNotifier: refreshSoftwareUpdateList() issue in Monterey (M1) machine issue 1 #39

@phu-ngo

Description

@phu-ngo

In case machine are updating, when script running and require refreshSUL, original function will kickstart the softwareupdated service it also will stop all current update process, we need add another function to check if there no update going on before kickstart the service

# pngo 1/5/22 include check UpdateBrainService process, to avoid restart softwareupdated when user are updating
function checkingUpdateProcess(){
    if ps aux | grep -e com.apple.MobileSoftwareUpdate.UpdateBrainService$ >/dev/null; then
        debug "com.apple.MobileSoftwareUpdate.UpdateBrainService is running, potental Update in process, exit"
        exit 0
    fi
}

include the function on on top of current refreshSoftwareUpdateList()

refreshSoftwareUpdateList(){
    debug "Refresh Software Update list"
    # check update process, make sure there not update running
    checkingUpdateProcess
    
........
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions