Skip to content
  • Zygmunt Krynicki's avatar
    f5146759
    cmd/sysotad: persist system state · f5146759
    Zygmunt Krynicki authored
    
    
    The state of SystemOTA, as represented by ota.SystemState is loaded on
    startup of the service and saved when the service exits.
    
    As with ota.LoadState, the state file can be absent without causing
    problems. To support "ephemeral" mode, the state is only saved if the
    directory where it resides in already exists. If the directory
    /var/lib/sysota does not exist, state is discarded and the service will
    run without any state present.
    
    Add SIGTERM to the list of signals handled gracefully. Before this we
    were only handling SIGINT but systemd is actually sending SIGTERM, which
    abruptly ends the process.
    
    Add tests measuring syscalls used by SaveState, behavior of the service
    when the state file is corrupted, when the state directory is on a
    read-only file system and when the state directory is on a file system
    with no disk space left.
    
    The state is not used for anything yet.
    
    Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
    f5146759
    cmd/sysotad: persist system state
    Zygmunt Krynicki authored
    
    
    The state of SystemOTA, as represented by ota.SystemState is loaded on
    startup of the service and saved when the service exits.
    
    As with ota.LoadState, the state file can be absent without causing
    problems. To support "ephemeral" mode, the state is only saved if the
    directory where it resides in already exists. If the directory
    /var/lib/sysota does not exist, state is discarded and the service will
    run without any state present.
    
    Add SIGTERM to the list of signals handled gracefully. Before this we
    were only handling SIGINT but systemd is actually sending SIGTERM, which
    abruptly ends the process.
    
    Add tests measuring syscalls used by SaveState, behavior of the service
    when the state file is corrupted, when the state directory is on a
    read-only file system and when the state directory is on a file system
    with no disk space left.
    
    The state is not used for anything yet.
    
    Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
Loading