Changeset 63a3276 in mainline for uspace/srv/sysman/units/unit_svc.c


Ignore:
Timestamp:
2019-08-06T19:20:35Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
3f05ef7
Parents:
72c8f77
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-06-17 23:02:03)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-06 19:20:35)
Message:

sysman: Instrumented locsrv for autostart

  • also refactored unit name derivation in other brokers
  • exposee creation is not used in unit's lifecycle (failed assertion)

Conflicts:

uspace/lib/c/generic/loc.c
uspace/srv/devman/driver.c
uspace/srv/devman/drv_conn.c
uspace/srv/hid/compositor/compositor.c
uspace/srv/locsrv/locsrv.c
uspace/srv/vfs/vfs.h
uspace/srv/vfs/vfs_ops.c
uspace/srv/vfs/vfs_register.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/units/unit_svc.c

    r72c8f77 r63a3276  
    9393        }
    9494
     95        unit->state = STATE_STARTING;
     96
    9597        /*
    9698         * This is temporary workaround, until proper reporting from brokers
    9799         * about exposees will work. We assume the service succesfully starts
    98          * in a moment.
     100         * in a moment. Applies to naming service only.
    99101         */
    100         unit->state = STATE_STARTING;
    101         async_usleep(20000);
    102         unit->state = STATE_STARTED;
     102        // TODO this is even hack in the workaround, exposees doesn't work properly
     103        if (true || str_cmp(unit->name, "devman.svc") == 0 ||
     104            str_cmp(unit->name, "logger.svc") == 0 ||
     105            str_cmp(unit->name, "irc.svc") == 0) {
     106                async_usleep(100000);
     107                unit->state = STATE_STARTED;
     108        }
    103109
    104110        /*
    105111         * Workaround to see log output even after devman starts (and overrides
    106          * kernel's frame buffer. It's here since devman is started as a
    107          * service (however not all services are devman...).
     112         * kernel's frame buffer.
    108113         */
    109         if (console_kcon()) {
    110                 sysman_log(LVL_DEBUG2, "%s: Kconsole grabbed.", __func__);
    111         } else {
    112                 sysman_log(LVL_DEBUG2, "%s: no kconsole.", __func__);
     114        if (str_cmp(unit->name, "devman.svc") == 0) {
     115                async_usleep(100000);
     116                if (console_kcon()) {
     117                        sysman_log(LVL_DEBUG2, "%s: Kconsole grabbed.", __func__);
     118                } else {
     119                        sysman_log(LVL_DEBUG2, "%s: no kconsole.", __func__);
     120                }
    113121        }
    114122
     
    118126static void unit_svc_exposee_created(unit_t *unit)
    119127{
    120         // TODO implement
     128        assert(CAST_SVC(unit));
     129        assert(unit->state == STATE_STOPPED || unit->state == STATE_STARTING || unit->state==STATE_STARTED);
     130
     131        unit->state = STATE_STARTED;
     132        unit_notify_state(unit);
    121133}
    122134
Note: See TracChangeset for help on using the changeset viewer.