Skip to content
This repository was archived by the owner on Feb 20, 2020. It is now read-only.

WIP: Implement 1459203 (remove NSSM), 1436274 (use eventlog)#210

Closed
milescrabill wants to merge 21 commits intotaskcluster:masterfrom
milescrabill:no-more-nssm-merge-20190619
Closed

WIP: Implement 1459203 (remove NSSM), 1436274 (use eventlog)#210
milescrabill wants to merge 21 commits intotaskcluster:masterfrom
milescrabill:no-more-nssm-merge-20190619

Conversation

@milescrabill
Copy link
Copy Markdown
Contributor

@milescrabill milescrabill commented Jul 2, 2019

There's a ton here. Too much!

  • adds dependency on gopkg.in/natefinch/lumberjack.v2 for logfile management

  • removes NSSM and modifies docs, userdata in worker_types, etc. as such

  • changes the way the main RunWorker function is called for flexibility, it now accepts a signal chan

  • split out config handling and exit code handling into functions

  • adds debug logic for panic scenario exits including writing out a crash log in scenarios where other logging might be failing

  • support for installing/removing the generic worker service using native go

  • support for specifying configuration location at install time

  • support for windows event log when run as a service

  • logging to logfile by default in windows

  • remove need for a bat script wrapper to change the service working directory, cwd is set to parent dir of worker exe

Usage testing:

  • verify: starting the service in interactive mode [x]
  • verify: starting the service as a service works properly [x]
  • verify: under expected use, can ctrl-c to properly exit from interactive mode []
    • caveat: not running as LocalUser sticks us into a loop that cannot be broken by interrupts!

TODO:

  • fix CI
  • actually write tests
  • niceify commits
  • test: install the service, verify the service exists, verify the event log source exists, remove the service
  • test: starting the service without the event log source in non-interactive mode should fail with exit code 78
  • test: adding a broken io.Writer to the logWriter MultiWriter will be caught (worth testing?)
  • should logfile location be configurable? (currently: generic-worker.log, rotated by lumberjack)
  • should logfile management be in scope or is that an infra concern?

Weird things:

  • running in interactive mode prints an extra blank newline in between log entries

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 2, 2019

Coverage Status

Coverage decreased (-45.9%) to 31.164% when pulling 41bcfbc on milescrabill:no-more-nssm-merge-20190619 into 73bc174 on taskcluster:master.

Comment thread usage.go Outdated
@petemoore
Copy link
Copy Markdown
Member

Nice work so far!

@milescrabill
Copy link
Copy Markdown
Contributor Author

Closing in favor of a branch on this repo for proper testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants