openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/systemd/1_242+AUTOINC+db2e367bfc-r0/git/src/shared/verbs.c
bool running_in_chroot_or_offline(void)
{
    int r;

    /* Added to support use cases like rpm-ostree, where from %post scripts we
     * only want to execute "preset", but not "start"/"restart" for example.
     *
     * See docs/ENVIRONMENT.md for docs.
     */
    r = getenv_bool("SYSTEMD_OFFLINE");
    if (r < 0 && r != -ENXIO)
        log_debug_errno(r, "Failed to parse $SYSTEMD_OFFLINE: %m");
    else if (r >= 0)
        return r > 0;

    /* We've had this condition check for a long time which basically checks for
     * legacy chroot case like Fedora's "mock", which is used for package
     * builds.  We don't want to try to start systemd services there, since
     * without --new-chroot we don't even have systemd running, and even if we
     * did, adding a concept of background daemons to builds would be an
     * enormous change, requiring considering things like how the journal output
     * is handled, etc.  And there's really not a use case today for a build
     * talking to a service.
     *
     * Note this call itself also looks for a different variable
     * SYSTEMD_IGNORE_CHROOT=1.
     */
    r = running_in_chroot();
    if (r < 0)
        log_debug_errno(r, "running_in_chroot(): %m");

    return r > 0;
}
/* Wraps running_in_chroot() which is used in various places, but also adds an
 * environment variable check so external processes can reliably force this on.
 */
Wraps running_in_chroot() which is used in various places, but also adds an
environment variable check so external processes can reliably force this on.
Wraps running_in_chroot () which is used in various places but also adds an environment variable check so external processes can reliably force this on .
bool running_in_chroot_or_offline(void)
{
    int r;
    r = getenv_bool("SYSTEMD_OFFLINE");
    if (r < 0 && r != -ENXIO)
        log_debug_errno(r, "Failed to parse $SYSTEMD_OFFLINE: %m");
    else if (r >= 0)
        return r > 0;
    r = running_in_chroot();
    if (r < 0)
        log_debug_errno(r, "running_in_chroot(): %m");
    return r > 0;
}
bool running_in_chroot_or_offline ( void ) { int r ; r = getenv_bool ( " " ) ; if ( r < 0 && r != - ENXIO ) log_debug_errno ( r , " " ) ; else if ( r >= 0 ) return r > 0 ; r = running_in_chroot ( ) ; if ( r < 0 ) log_debug_errno ( r , " " ) ; return r > 0 ; }
Wraps running_in_chroot() which is used in various places, but also adds an
 environment variable check so external processes can reliably force this on.
Wraps running_in_chroot () which is used in various places but also adds an environment variable check so external processes can reliably force this on .
/* Added to support use cases like rpm-ostree, where from %post scripts we
     * only want to execute "preset", but not "start"/"restart" for example.
     *
     * See docs/ENVIRONMENT.md for docs.
     */ /* We've had this condition check for a long time which basically checks for
     * legacy chroot case like Fedora's "mock", which is used for package
     * builds.  We don't want to try to start systemd services there, since
     * without --new-chroot we don't even have systemd running, and even if we
     * did, adding a concept of background daemons to builds would be an
     * enormous change, requiring considering things like how the journal output
     * is handled, etc.  And there's really not a use case today for a build
     * talking to a service.
     *
     * Note this call itself also looks for a different variable
     * SYSTEMD_IGNORE_CHROOT=1.
     */