Changeset ed5367b in mainline for uspace/srv/sysman/sm_task.c


Ignore:
Timestamp:
2019-08-07T10:01:13Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
a097c50
Parents:
68ae40a
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-11-05 01:52:07)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-07 10:01:13)
Message:

sysman: Implement stopping units

Currently fails service monitoring because of taskman flawed event flags.
However, job closure works well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/sm_task.c

    r68ae40a red5367b  
    101101        sysman_log(LVL_DEBUG2, "%s, %s(%i)@%" PRIu64 " %i",
    102102            __func__, unit_name(u), u->state, tev->task_id, tev->flags);
    103         assert(u->state == STATE_STARTING);
    104103
    105104        if (tev->flags & TASK_WAIT_EXIT) {
    106105                // TODO maybe call unit_fail (would be nice to contain reason)
    107                 u->state = STATE_FAILED;
    108         } else {
     106                //      or move this whole logic to unit_svc.c
     107                if (u->state == STATE_STOPPING) {
     108                        u->state = STATE_STOPPED;
     109                } else {
     110                        // if it has also retval == 0 then it's not fail
     111                        u->state = STATE_FAILED;
     112                }
     113        }
     114        if (tev->flags & TASK_WAIT_RETVAL) {
     115                assert(u->state == STATE_STARTING);
    109116                u->state = STATE_STARTED;
    110117        }
Note: See TracChangeset for help on using the changeset viewer.