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

Modeling the flow of the daemon #85

Closed
fxfactorial opened this issue Sep 24, 2019 · 1 comment
Closed

Modeling the flow of the daemon #85

fxfactorial opened this issue Sep 24, 2019 · 1 comment

Comments

@fxfactorial
Copy link

fxfactorial commented Sep 24, 2019

Great package, thank you.

I was wondering about the flow of the daemonization, hoping to see if my thought process is accurate.

Going off of: https://github.com/takama/daemon/blob/master/examples/cron/cron_job.go#L50

Is the idea then that:

  1. call service.Install only once needed
  2. call service.Start, this causes the usual daemonization double fork which creates its own instance but this time calling itself without a flag and hence going into the Cron working ?

Not entirely clear about 2 because I'm using cobra as a wrapper, so will that work nicely with the command line flags, arguments used by the double fork? Or should I expliclty control the commands used?

Example, I want to have it be: h-watchdog service start where I'm grouping all the daemon related commands under service subcommand.

@fxfactorial
Copy link
Author

Nvm, figured it out. Key was to understand the passing of params to .Install and using systemctl list-unit-files and systemctl show -p FragmentPath <SERVICE_NAME> to see the generated file.

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

1 participant