Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable healthcheck #263

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/agent/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1465,13 +1465,15 @@ int main(int argc, char** argv)
return 1;
}

#ifndef ADUC_UBUNTU_CORE_SNAP_ONLY
// Switch to specified agent.runas user.
// Note: it's important that we do this only when we're not performing any
// high-privileged tasks, such as, registering agent's extension(s).
if (!RunAsDesiredUser())
{
return 0;
}
#endif

Log_Info("Agent (%s; %s) starting.", ADUC_PLATFORM_LAYER, ADUC_VERSION);
#ifdef ADUC_GIT_INFO
Expand All @@ -1483,6 +1485,7 @@ int main(int argc, char** argv)
SUPPORTED_UPDATE_MANIFEST_VERSION_MIN,
SUPPORTED_UPDATE_MANIFEST_VERSION_MAX);

#ifndef ADUC_UBUNTU_CORE_SNAP_ONLY
_Bool healthy = HealthCheck(&launchArgs);
if (launchArgs.healthCheckOnly || !healthy)
{
Expand All @@ -1496,6 +1499,7 @@ int main(int argc, char** argv)
}
return healthy ? 0 : 1;
}
#endif

// Ensure that the ADU data folder exists.
// Normally, ADUC_DATA_FOLDER is created by install script.
Expand Down