You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be helpful if the community.windows.win_nssm module can expose NSSM's AppStdoutCreationDisposition and AppStderrCreationDisposition properties so that logs can be preserved when a service restarts. See "File Rotation Tab" on the NSSM usage page for a small amount of extra information.
ISSUE TYPE
Feature Idea
COMPONENT NAME
community.windows.win_nssm
ADDITIONAL INFORMATION
This would pass an integer (2 or 4 are known valid options) directly to NSSM's service configuration. AppStdoutCreationDisposition and AppStderrCreationDisposition can be set independently, but follow similar logic. They should default to the current behavior of setting the -value to 2 (replace log files on restart).
tasks:
- name: My Servicecommunity.windows.win_nssm:
name: MyNssmServicedisplay_name: My NSSM Serviceapplication: C:\MyFolder\MyExecutable.exeapp_directory: C:\MyFolder\arguments: --silentstdout_file: C:\MyFolder\Logs\stdout.logstderr_file: C:\MyFolder\Logs\stderr.logapp_rotate_online: 1app_stdout_creation_disposition: 2# replace file on every service restartapp_stderr_creation_disposition: 4# append to file instead of deleting filestate: restartedapp_environment:
PORT: 3001
The text was updated successfully, but these errors were encountered:
drfuzzyness
changed the title
Allow configuring NSSM to preserve log files on service restart/crash
win_nssm: Configure NSSM to preserve log files on service restart/crash
Oct 16, 2023
+1 for this suggestion please. I'm using nssm to install hashicorp vault agent which requires redirection of stdout and stderr to get logging. If the service crashes and restarts, the previous logs are lost which makes debugging very hard.
SUMMARY
It would be helpful if the
community.windows.win_nssm
module can expose NSSM'sAppStdoutCreationDisposition
andAppStderrCreationDisposition
properties so that logs can be preserved when a service restarts. See "File Rotation Tab" on the NSSM usage page for a small amount of extra information.ISSUE TYPE
COMPONENT NAME
community.windows.win_nssm
ADDITIONAL INFORMATION
This would pass an integer (2 or 4 are known valid options) directly to NSSM's service configuration.
AppStdoutCreationDisposition
andAppStderrCreationDisposition
can be set independently, but follow similar logic. They should default to the current behavior of setting the -value to2
(replace log files on restart).Current behavior:
community.windows/plugins/modules/win_nssm.ps1
Lines 494 to 495 in 03e3af7
Proposed configuration example:
The text was updated successfully, but these errors were encountered: