Comments (4)
I think in general the better approach is to have your surrounding Chef recipes invoke the service restart after setting the Python scripts in place, but it isn't clear to me how to allow the notification to go through without being skipped and still not stop the service every time you run Chef (which would be highly undesirable in general).
The only thing I can think of to accomplish that is for your own Chef recipies to have something like:
windows_service my_name do
action :nothing
service_name node['signalfx_agent']['service_name']
end
cookbook_file ... do
...
notifies :restart, "windows_service[my_name]", :delayed
end
Where you just make a distinct resource name pointing to the same service.
You could also try invoking a restart on the plain service[#{node['signalfx_agent']['service_name']}"
resource that gets used even on windows.
Let me know if either of those two things helps.
from signalfx-agent.
The first suggestion seems pretty dirty, it will result in multiple restarts of the service for each definition.
I gave the 2nd one a try, it does work although it seems like more of a bug in chef than anything else. It still refers to it as windows_service
and still detects that it's defined, but it ignores the guards around it.
cookbook_file "#{integration_directory}\\bitlocker.py" do
source 'integrations/bitlocker.py'
action :create
notifies :restart, "service[#{node['signalfx_agent']['service_name']}]", :delayed
end
[2019-04-16T13:37:52+00:00] INFO: cookbook_file[\Program Files\SignalFx\\integrations\bitlocker.py] sending restart acti
on to windows_service[signalfx-agent] (delayed)
Recipe: signalfx_agent::default
* windows_service[signalfx-agent] action restart[2019-04-16T13:37:52+00:00] INFO: Processing windows_service[signalfx-
agent] action restart (signalfx_agent::default line 56)
[2019-04-16T13:37:54+00:00] INFO: windows_service[signalfx-agent] configured.
[2019-04-16T13:37:57+00:00] INFO: windows_service[signalfx-agent] restarted
- restart service windows_service[signalfx-agent]
[2019-04-16T13:37:57+00:00] INFO: Chef Run complete in 15.556592 seconds
The latter technically solves the issue, although it seems like something that may be patched in the future. It's not immediately urgent to do this, but I'd be interested in a better solution where the service resource can be managed properly. A way to do this would be to separate the download & unzip actions, so the process would read more as: download package -> notify service to stop -> unzip package -> notify service to start
from signalfx-agent.
Yeah that is weird how it refers to windows_service
...maybe service
is just an alias for that on Windows or something.
Ok, yeah that makes sense about how to handle the service stop/start on initial install/upgrades. I'll look into doing that.
from signalfx-agent.
Closing this issue as inactive. Please reopen if this issue is still occurring.
from signalfx-agent.
Related Issues (20)
- how to get the sfx metric details and its complete description. HOT 3
- SignalFx agent installation on proxy based server HOT 3
- package doesn't include libnss_resolve HOT 2
- From where we can download the signalfx agent latest rpm file to install.
- Signalfx agent is unable to pick the proxy configurations
- how to run a powershell script from exec plugin HOT 2
- Deprecation notice doesn't make sense to me HOT 2
- Issue regarding metric sf.org.num.mutingactive HOT 1
- Error: " Unable to collect username for process " from SignalFx agent HOT 1
- Signalfx agent making IMDSv1 request HOT 1
- StatsD parser doesn't handle tag values that contain colons
- API to get the list of CI reporting to console from any cloud native like EC2 instances HOT 1
- logLevel is not working in signalfx helm chart HOT 1
- Agent Occasionally Drops HTTP POST Connections HOT 1
- Helm chart version 1.9.4 does not work with App version 5.21.0 (error retrieving resource lock during leaderelection) HOT 2
- What is the upcoming release schedule? HOT 2
- Monitor never create with discoveryRule HOT 2
- metrics monitor `container_cpu_utilization` is seconds not percentages HOT 2
- Bump issue in k8s deployment files HOT 1
- check_links action should ignore SQL link HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from signalfx-agent.