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

Allow foreground execution for s6 style service #35

Closed
3 tasks done
diginc opened this issue May 6, 2017 · 4 comments
Closed
3 tasks done

Allow foreground execution for s6 style service #35

diginc opened this issue May 6, 2017 · 4 comments
Assignees

Comments

@diginc
Copy link
Contributor

diginc commented May 6, 2017

In raising this issue, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your issue:

  • I have read and understood the contributors guide.
  • The issue I am reporting can be replicated
  • The issue I am reporting isn't a duplicate

How familiar are you with the codebase?:

6


Simple request: since backgrounding/daemonizing is the default of pihole-FTL, please provide a -f argument to run it in the foreground to provide some more versatility with other supervisor style service managers like s6.

I just converted the pi-hole docker image to use s6-overlay, all my other services for the docker-pi-hole container have a option to run them int he foreground so that s6-supervisor can properly watch the long running process (also intake logs) and restart it if something goes wrong.

More details on s6 services: http://www.skarnet.org/software/s6/servicedir.html see the bullet points, the 5th in particular:

execute into the long-lived process that is to be supervised by s6-supervise, i.e. the real foo daemon. That process must not "background itself": being run by a supervision tree already makes it a "background" task.

s6 will just restart a service over and over when the process goes into background mode (learned this with php-fpm) since it is a supervisor style service manager, the exit of the run script means the service stopped in s6's mind and it triggers another run unless it was just told to stop the service.

I can work around this for now with something silly like while pgrep pihole-FTL ; do sleep 5 ; done at the end of my s6 service run script, so no rush.

@dschaper
Copy link
Member

dschaper commented May 6, 2017

So you need a no-daemon mode to get things working correctly? I could see this helping out with debugging and possibly with some of the test in the Travis build matrix to smoke test builds in the x86 platform.

@technicalpyro
Copy link
Contributor

technicalpyro commented May 6, 2017

starting FTL with the command pihole-FTL debug should prevent it from going into daemon mode

EDIT taken from https://github.com/pi-hole/FTL#command-line-arguments

@diginc
Copy link
Contributor Author

diginc commented May 6, 2017

ah yup pihole-FTL debug is what I need, thanks. Next time I'll RTFM. I tried pihole-FTL -h but there was no help there :(

@diginc diginc closed this as completed May 6, 2017
@DL6ER
Copy link
Member

DL6ER commented May 6, 2017

Although you have been able to achieve what you need using debug this also enabled the ultra-verbose mode (your log file will grow quickly). I'll reopen this issue to remind myself to implement

  • a no-daemon, -f, and
  • a help, -h flag

@DL6ER DL6ER reopened this May 6, 2017
@DL6ER DL6ER self-assigned this May 6, 2017
@DL6ER DL6ER mentioned this issue May 10, 2017
5 tasks
@diginc diginc closed this as completed May 12, 2017
DL6ER pushed a commit that referenced this issue Oct 14, 2019
Update Dependencies, and Update Rust to nightly-2018-06-20
@jens1205 jens1205 mentioned this issue Dec 21, 2020
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

4 participants