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

Stopping daemon log file error? #53

Open
pgouv opened this issue Feb 6, 2017 · 4 comments
Open

Stopping daemon log file error? #53

pgouv opened this issue Feb 6, 2017 · 4 comments

Comments

@pgouv
Copy link

pgouv commented Feb 6, 2017

When I am trying to stop I get this message written:
Config:

Daemons.run(
  MYD_PATH,
  app_name: 'my_daemon',
  dir_mode:          :normal,
  dir:                TMP_PIDS_DIR,
  backtrace:          true,
  monitor:            true,
  log_output:         true,
  logfilename:        'daemon.log',
  output_logfilename: 'outputfile.txt',
  mode:               :load
)

SIGTERM
["/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:56:in sleep'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:56:in block in watch'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:43:in loop'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:43:in watch'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:67:in block in start_with_pidfile'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:62:in fork'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:62:in start_with_pidfile'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/monitor.rb:93:in start'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/application_group.rb:147:in create_monitor'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/application.rb:284:in start'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/controller.rb:56:in run'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons.rb:148:in block in run'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons/cmdline.rb:92:in catch_exceptions'", "/usr/local/lib/ruby/gems/2.3/gems/daemons-1.2.4/lib/daemons.rb:147:in run'", "/usr/local/lib/ruby/gems/2.3/gems/xxxxxx-0.1.14/bin/daemonctl23:10:in <top (required)>'", "/usr/local/bin/daemonctl23:23:in load'", "/usr/local/bin/daemonctl23:23:in `

'"]

@thuehlinger
Copy link
Owner

Where do you get this output? STDOUT? STDERR?

Does your script get stopped as it should and is the .pid file correctly removed? Can you confirm that the monitor process terminates correctly?

@andreac92
Copy link

Hi,

We're getting the same exact SIGTERM errors.

Our .pid file gets removed correctly, and the monitor process and script terminate. Any ideas what could be causing this?

@thuehlinger
Copy link
Owner

So far, unfortunately, not. Any chance you can prepare a minimal example that shows this behaviour? This would be very helpful for me for testing.

@pgouv
Copy link
Author

pgouv commented Jun 25, 2017

I will create a repo with this. With little digging this error seems to occur with monitoring.
My guess is since watch is a never ending loop with sleep, when app is terminated due to SIGTERM , exception is caught and logged here
https://github.com/thuehlinger/daemons/blob/master/lib/daemons/monitor.rb#L65

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

3 participants