Coder Social home page Coder Social logo

Comments (3)

jaymzh avatar jaymzh commented on April 26, 2024

The code to get both logs going to the same place is pretty gnarly, and I don't know the windows stuff well enough to debug this... any idea on the fix?

from chef-utils.

svmastersamurai avatar svmastersamurai commented on April 26, 2024

@natewalck Have you tried setting windows_subshell to false? The branch of code that writes to console and the log file is not hit unless this value is false:
https://github.com/facebook/chef-utils/blob/master/chefctl/src/chefctl.rb#L1017-L1038

FWIW I was able to see logs in both console and the app created a directory appropriately with this config:

PS> cat $env:temp\chefctl-test\chefctl-config.rb
## THIS FILE IS MANAGED BY CHEF
### LOCAL CHANGES WILL BE OVERRIDDEN
log_dir 'C:\Users\svmastersamurai\AppData\Local\Temp\chefctl-test\outputs'
lock_file "C:/chef/chefctl.lock"
default_chef_options ["--fatal-windows-admin-check"]
chef_client "C:/opscode/chef/bin/chef-client.bat"
lock_time 1800
max_retries 1
windows_subshell false

PS> C:\opscode\chef\embedded\bin\ruby.exe C:\Users\svmastersamurai\github\chef-utils\chefctl\src\chefctl.rb --config $env:temp\chefctl-test\chefctl-config.rb -i

PS> dir $env:temp\chefctl-test\outputs
    Directory: C:\Users\svmastersamurai\AppData\Local\Temp\chefctl-test\outputs
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         6/5/2019   2:45 PM         160361 chef.20190605.1444.1559771097.out
-a---l         6/5/2019   2:44 PM              0 chef.cur.out
-a---l         6/5/2019   2:45 PM              0 chef.last.out

PS> cat $env:temp\chefctl-test\outputs\chef.cur.out -first 10
INFO: Registering FB::CpeinfoReport as a handler for types: report, exception
INFO: Registering FB::TableauReport as a handler for types: report
INFO: Registering FB::ChefRunsReport as a handler for types: report, exception
INFO: Registering FB::FbagentReport as a handler for types: report, exception
INFO: Running on
[2019-06-05T14:45:05-07:00] INFO: *** Chef 14.12.9 ***
[2019-06-05T14:45:05-07:00] INFO: Platform: x64-mingw32
[2019-06-05T14:45:05-07:00] INFO: Chef-client pid: 15864
...

from chef-utils.

gleason86 avatar gleason86 commented on April 26, 2024

This issue can be closed; this issue was caused by plugin_path 'C:/chef/chefctl_hooks.rb' in chefctl-config.rb. More specifically, the function def pre_start was altering Chefctl::Config.path which should be set to nil when windows_subsystem is set to false.

from chef-utils.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.