Граф коммитов

1317 Коммитов

Автор SHA1 Сообщение Дата
Aaron Meihm 73f85ef52e [medium/bug] ignore offline agents in ActiveAgentsByQueue
avoids returning offline agent information to killDupAgents, in
circumstances where the returned data includes only one online agent
with several offline agents, we could end up sending a kill notice to
the only online agent.
2016-04-20 16:47:47 -05:00
Aaron Meihm b23ba0969e [minor] fix a few comment typos for detectMultiAgents 2016-04-20 16:47:47 -05:00
Aaron Meihm 461163a032 [medium] add console loader management operations 2016-04-20 16:47:47 -05:00
Aaron Meihm f1ff92681c [minor] dup agent manual inspect notice, include agent names
When indicating manual inspection is required for duplicate agents, also
include the names of the agents in addition to the queue.
2016-04-20 16:47:47 -05:00
Aaron Meihm 649f852ad1 [minor] display UTC timestamp in manifest search
Use a UTC timestamp here to be more consistent with other time output.
2016-04-20 16:47:47 -05:00
Aaron Meihm da8bbb2ee5 [minor] add loader search to console 2016-04-20 16:47:47 -05:00
Aaron Meihm 81fa03c320 [minor/bug] dont try to send heartbeat if marshal fails 2016-04-20 16:47:47 -05:00
Aaron Meihm 8e6b7ce436 [minor] only hold agent context lock to build the heartbeat 2016-04-20 16:47:47 -05:00
Aaron Meihm a0a4494426 [minor/bug] make Terminate channel buffered
There are a number of areas in the agent go-routines write to Terminate
to tell the agent to shut down. Depending on ordering, there are
circumstances where one go-routine will become blocked writing to
Terminate if there is no listener on the unbuffered channel, such as:

- publish is called, which picks up the publication lock
- while publish is running, another go-routine detects an error and
  notifies Terminate
- the agent stops listening on Terminate, and attempts to pick up the
  publication lock to try to exit, but blocks as it's held in publish
- publish detects a failure, and tries to write to Terminate before
  releasing the publication lock, but blocks as there is no listener
  on the channel anymore
2016-04-20 16:47:47 -05:00
Aaron Meihm e90fc2e556 Merge pull request #207 from ameihm0912/loader-fixups1
various fixes related to loader testing
2016-04-19 10:40:51 -05:00
Aaron Meihm b02d545e86 [medium] new agent queue location format
The previous agent queue location included the hostname which could
potentially change while the agent is running. Exclude dynamic values
and add an additional random component to the queue location.
2016-04-18 23:05:12 -05:00
Aaron Meihm a84474ad9e [medium] introduce periodic agent environment refresh
It's possible over the course of the process lifetime on a workstation
that address or other environment information can change. This adds
support for periodic refreshes of current environment information from
the system.

This commit also requires modifying the way we pass the Context around
the agent, from a copy to using a pointer so the changes made in the
refresh routine are visible.

Closes #205
2016-04-18 23:04:50 -05:00
Aaron Meihm 46a23de6b6 [minor] fixes to agent/loader packaging, primarily for lintian errors
This fixes lintian errors reported for deb packages, which cause the
package installation to fail in some cases where frontends to dpkg are
being used to install.

Changes primarily applied to loader/agent packages. deb-server package
was not modified as the target installs to /opt, which is reported as an
error by the linter. Since a change to the install path is required to
fix this just leave as is for that target for now.

Closes #197
2016-04-18 21:59:28 -05:00
Aaron Meihm a7195549fd [minor/bug] fix issue which can occur after installCron failure
err was not being reset, which can lead to the cron installation error
being returned later in the daemonize function and cause the agent to
fail.

Closes #200
2016-04-18 21:59:28 -05:00
Aaron Meihm b1e0d075ec [minor] return an installer error if user cancels key entry
Closes #201
2016-04-18 21:59:28 -05:00
Aaron Meihm 038ddc2623 [minor] set correct file mode on loader installed files
Closes #196
2016-04-18 21:59:28 -05:00
Aaron Meihm c88b83a1e1 [minor] if the AMQP channels closes in getCommands, terminate
If the AMQP channel used in getCommands is closed due to an underlying
error in the AMQP connection, the goroutine exits. The heartbeat process
will also encounter the connection error during publish, and this will
result in termination of the agent.

Depending on the configured heartbeat time, this can take a while to
occur. Rather than wait for the heartbeat publish to fail, if we are
unable to recieve messages from AMQP also send a termination note here.
2016-04-18 21:59:28 -05:00
Aaron Meihm cb4fdac8d7 [minor] add log file rotation for file output mode
Closes #204
2016-04-18 21:59:28 -05:00
Aaron Meihm 82230198ed [minor] add better logging for loader operations
This just uses the mig logging framework, as a second part to this we
need to implement rotation for file output in the logging framework.

Related to #204
2016-04-18 21:59:28 -05:00
Aaron Meihm 2007961ce4 [minor] deploy interval based launchd service in loader (darwin)
Rather then have the installer create the launchd interval job, just do
it in the loader which simplifies the installation process and makes the
job installation operate similar to other mig components.
2016-04-18 21:59:28 -05:00
Aaron Meihm 54553f7d09 [minor] revendor service-go 2016-04-18 21:59:28 -05:00
Aaron Meihm 8e5f4809a0 Merge pull request #208 from ameihm0912/scheduler-fixes
fixes to scheduler
2016-04-15 20:36:38 -05:00
Aaron Meihm d5bf8854b8 [medium] don't conditionally run killDupAgents routine
We need to make sure we are actively draining the DetectDupAgents
channel, otherwise routines writing here will end up blocking. We
check the ctx.Agent.KillDupAgents setting inside killDupAgents, so just
send the queue location here and it will be handled according to the
configuration value.
2016-04-13 21:41:02 -05:00
Aaron Meihm ce85886a8e [major] remove old upgrade module code from scheduler 2016-04-13 21:41:02 -05:00
Julien Vehent [:ulfr] 5aac4769b0 Merge pull request #206 from ameihm0912/scheduler-periodic
resolve deadlock in scheduler periodic run
2016-04-11 13:48:55 -04:00
Aaron Meihm c60af25206 [minor/bug] QueuesCleanup bare return can return invalid result
ensure we set err to nil before we continue on an error condition to
avoid returning the error from the function. this issue was causing the
QueuesCleanup routine to exit under certain circumstances.
2016-04-11 10:40:58 -05:00
Aaron Meihm d5456a6d10 [minor/bug] use sync.WaitGroup in computeAgentsStats()
previous implementation had potential to deadlock function, as it was
possible to enter the wait loop before routines had been incremented,
since routines was being incremented inside the goroutine. this would
result in the function never exiting the loop comparing completed to
routines, as on the first iteration routines would be 0 and completed
would be 1.
2016-04-05 14:39:25 -05:00
Aaron Meihm 299c55aafb [minor/bug] missing error checks in cleanDir() 2016-04-05 14:11:16 -05:00
Aaron Meihm 19b54f8901 Merge pull request #203 from ameihm0912/master
[minor/bug] add stub functions for HasSeenIP for darwin and windows
2016-03-27 13:38:28 -05:00
Aaron Meihm 9b96dc19a0 [minor/bug] add stub functions for HasSeenIP for darwin and windows
These functions need to be implemented, but this fixes current build
errors on these platforms.

Closes #199
2016-03-24 19:00:32 -05:00
Aaron Meihm f9cee409a1 Merge pull request #183 from ameihm0912/mig-loader
Integration of mig loader
2016-03-24 17:16:59 -05:00
Aaron Meihm 0d4f61164c [minor] add a variable to control darwin package signing 2016-03-24 17:08:14 -05:00
Aaron Meihm 2de6b0171a [minor] better file name for osx loader package 2016-03-24 17:08:14 -05:00
Aaron Meihm 54ce65e4b1 [minor] fix path issue in dmg agent target 2016-03-24 17:08:14 -05:00
Aaron Meihm 7a4e51a25e [minor] modify agent package targets, change install path for dmg pkg 2016-03-24 17:08:14 -05:00
Aaron Meihm 4e7fda4c30 [minor] remove some debug lines that shouldnt be here 2016-03-24 17:08:14 -05:00
Aaron Meihm 02fa5e746d [minor] do some basic path initialization in the loader
Service initialization depending on the operating system may call
programs such as initctl and expect them to be in the path.
2016-03-24 17:08:14 -05:00
Aaron Meihm 253d89fa29 [minor/bug] amqp transform should work for amqp and amqps 2016-03-24 17:08:14 -05:00
Aaron Meihm 0f4d8f6c4b [minor/bug] fix an issue during verify of multiple manifest signatures 2016-03-24 17:08:14 -05:00
Aaron Meihm 2ab5d36abc [minor] add a makefile target for loader deb package 2016-03-24 17:08:14 -05:00
Aaron Meihm d056b5b4fb [minor] make api required signatures a config option 2016-03-24 17:08:14 -05:00
Aaron Meihm 4aa0a228e1 [doc] additional loader doc updates 2016-03-24 17:08:14 -05:00
Aaron Meihm 85110fae48 [doc] update loader docs 2016-03-24 17:08:14 -05:00
Aaron Meihm ea4cb57e6d [minor] validate loadername is present in manifest response 2016-03-24 17:08:14 -05:00
Aaron Meihm 793215fc20 [minor] use loader_name instead of name in ManifestResponse json 2016-03-24 17:08:14 -05:00
Aaron Meihm f3e60cb772 [minor] return a better error response in manifestLoaders list fail 2016-03-24 17:08:14 -05:00
Aaron Meihm 3e54d93cf4 [minor] allow loader lookup for staged manifests 2016-03-24 17:08:14 -05:00
Aaron Meihm 410ba77d3a [minor] include status field in manifest record validation 2016-03-24 17:08:14 -05:00
Aaron Meihm 50dbe215b4 [minor] force loader run on darwin installation 2016-03-24 17:08:14 -05:00
Aaron Meihm dfceec521e [minor] remove agt serviceInstall flag and add agent check in loader
Remove the service install flag to the agent as it's not really
neccessary; the standard daemon invocation will achieve the same result.

Also add a check in loader runs to see if the agent is running even if
no changes were needed. If not, try to start the agent. This handles
cases where the loader doesnt need to make changes, but the agent is not
running for some reason, and prior the loader would not attempt to
recover this scenario.
2016-03-24 17:08:14 -05:00