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

nssm resource is not idempotent #41

Open
jugatsu opened this issue Aug 12, 2018 · 2 comments
Open

nssm resource is not idempotent #41

jugatsu opened this issue Aug 12, 2018 · 2 comments

Comments

@jugatsu
Copy link

jugatsu commented Aug 12, 2018

* execute[Set parameter Application to C:\Program Files\Wireshark\dumpcap.exe] action run
             - execute C:\Windows\nssm-2.24-94-g9c88bc1.exe set Sniff Application C:\Program Files\Wireshark\dumpcap.exe
* execute[Reset parameter AppExit to default with default subparameter] action run
             - execute C:\Windows\nssm-2.24-94-g9c88bc1.exe reset Sniff AppExit default

It always sets Application and AppExit parameter.

nssm 'Sniff' do
  program 'C:\Program Files\Wireshark\dumpcap.exe'
  args "-i 1 -w C:\\gs\\gs.pcap -b filesize:20480 -b files:250 -f \"port http\" -q"
  parameters(
    Description: 'Service for capturing HTTP trafic from service.',
    AppDirectory: 'C:\Program Files\Wireshark',
    AppStdout: "#{ENV['ProgramData']}/gs.log",
    AppStderr: "#{ENV['ProgramData']}/gs-error.log",
    AppRotateFiles: 1
  )
  start false
  action :install
end
@saltukhov
Copy link

AppExit still has a problems
* execute[Set parameter AppExit to Default Exit] action run
- execute C:\Windows\nssm-2.24-101-g897c7ad.exe set logstash AppExit Default Exit
and next
* execute[Reset parameter AppExit to default with default subparameter] action run
- execute C:\Windows\nssm-2.24-101-g897c7ad.exe reset logstash AppExit default

nssm logstash['service_name'] do
program "#{logstash['bin_dir']}\logstash.bat"
args "agent --config #{logstash['conf_dir']}"
parameters(
AppDirectory: logstash['install_dir'],
AppExit: 'Default Exit'
)
action :install
end

@saltukhov
Copy link

       * ruby_block[Configure service binary path to C:\Windows\nssm-2.24-101-g897c7ad.exe] action run (skipped due to only_if)
       * execute[Set parameter AppDirectory to C:\logstash] action run (skipped due to not_if)
       * execute[Set parameter AppStdout to C:\logstash\nssm\stdout.log] action run (skipped due to not_if)
       * execute[Set parameter AppStderr to C:\logstash\nssm\stderr.log] action run (skipped due to not_if)
       * execute[Set parameter AppStdoutCreationDisposition to 2] action run (skipped due to not_if)
       * execute[Set parameter AppStderrCreationDisposition to 2] action run (skipped due to not_if)
       * execute[Set parameter AppRotateFiles to 1] action run (skipped due to not_if)
       * execute[Set parameter AppRotateOnline to 1] action run (skipped due to not_if)
       * execute[Set parameter AppRotateBytes to 100000000] action run (skipped due to not_if)
       * execute[Set parameter AppStopMethodSkip to 6] action run (skipped due to not_if)
       * execute[Set parameter Description to 2.4.1] action run (skipped due to not_if)
       * execute[Set parameter AppExit to Default Exit] action run
         - execute C:\Windows\nssm-2.24-101-g897c7ad.exe set logstash AppExit Default Exit
       * execute[Set parameter Application to C:\logstash\logstash-2.4.1\bin\logstash.bat] action run (skipped due to not_if)
       * execute[Set parameter AppParameters to agent --config C:\logstash\conf] action run (skipped due to not_if)
       * execute[Reset parameter Application to default] action run (skipped due to not_if)
       * execute[Reset parameter Application to default with default subparameter] action run (skipped due to only_if)
       * execute[Reset parameter AppParameters to default] action run (skipped due to not_if)
       * execute[Reset parameter AppParameters to default with default subparameter] action run (skipped due to only_if)
       * execute[Reset parameter AppDirectory to default] action run (skipped due to not_if)
       * execute[Reset parameter AppDirectory to default with default subparameter] action run (skipped due to only_if)
       * execute[Reset parameter AppExit to default] action run (skipped due to not_if)
       * execute[Reset parameter AppExit to default with default subparameter] action run
         - execute C:\Windows\nssm-2.24-101-g897c7ad.exe reset logstash AppExit default
       * execute[Reset parameter AppStdout to default] action run (skipped due to not_if)
       * execute[Reset parameter AppStdout to default with default subparameter] action run (skipped due to only_if)
       * execute[Reset parameter AppStdoutCreationDisposition to default] action run (skipped due to not_if)
       * execute[Reset parameter AppStdoutCreationDisposition to default with default subparameter] action run (skipped due to only_if)
       * execute[Reset parameter AppStderr to default] action run (skipped due to not_if)
       * execute[Reset parameter AppStderr to default with default subparameter] action run (skipped due to only_if)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants