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

How do I make it never "exit on failure"? #62

Open
Merith-TK opened this issue Aug 5, 2023 · 2 comments
Open

How do I make it never "exit on failure"? #62

Merith-TK opened this issue Aug 5, 2023 · 2 comments

Comments

@Merith-TK
Copy link

Merith-TK commented Aug 5, 2023

I am trying to use mittnite as an service manager on Termux, and I am running into the issue where code-server can, occasionally, time out when it tries to start, which causes it to count as an "attempt", but I have maxAttempts removed and canFail set to false, and yet it it is defaulting to 3 and true for some reason?

But because of this mittnite keeps exiting, is there a way I can force mittnite to NOT exit on failure?

/home $ mittnite up --api -c .mittnite/conf/
INFO[05-08-2023 02:06:24] looking for configuration files in .mittnite/conf/
INFO[05-08-2023 02:06:24] found config file: .mittnite/conf/code-server.hcl
INFO[05-08-2023 02:06:24] found config file: .mittnite/conf/sshd.hcl
INFO[05-08-2023 02:06:24] generating configuration files
INFO[05-08-2023 02:06:24] probeServer listens on port 9102
INFO[05-08-2023 02:06:24] waiting for probe readiness
INFO[05-08-2023 02:06:24] remote api listens on unix:///var/run/mittnite.sock
INFO[05-08-2023 02:06:25] initialization complete
INFO[05-08-2023 02:06:25] starting job                                  job.name=sshd
INFO[05-08-2023 02:06:25] starting job                                  job.name=code-server
INFO[05-08-2023 02:06:48] handling signal                               signal="child exited"
ERRO[05-08-2023 02:06:48] job exited with error                         error="exit status 1" job.name=code-server
ERRO[05-08-2023 02:06:48] job exited with error                         error="exit status 1" job.name=code-server
INFO[05-08-2023 02:06:48] remaining attempts                            job.maxAttempts=3 job.name=code-server job.usedAttempts=1
INFO[05-08-2023 02:06:48] starting job                                  job.name=code-server
ERRO[05-08-2023 02:07:13] job exited with error                         error="wait: no child processes" job.name=code-server
ERRO[05-08-2023 02:07:13] job exited with error                         error="wait: no child processes" job.name=code-server
INFO[05-08-2023 02:07:13] remaining attempts                            job.maxAttempts=3 job.name=code-server job.usedAttempts=2
INFO[05-08-2023 02:07:13] starting job                                  job.name=code-server
INFO[05-08-2023 02:07:13] reaped child                                  pid=8168 status=256
INFO[05-08-2023 02:07:37] reaped child                                  pid=8357 status=256
ERRO[05-08-2023 02:07:37] job exited with error                         error="wait: no child processes" job.name=code-server
ERRO[05-08-2023 02:07:37] job exited with error                         error="wait: no child processes" job.name=code-server
ERRO[05-08-2023 02:07:37] reached max retries for job code-server; last error: wait: no child processes
FATA[05-08-2023 02:07:37] service runner stopped with error             error="reached max retries for job code-server; last error: wait: no child processes"
INFO[05-08-2023 02:07:37] shutting down remote api
INFO[05-08-2023 02:07:37] sent SIGTERM to job's process group           job.name=sshd

/home $ cat .mittnite/conf/code-server.hcl
job "code-server" {
  command = "/data/data/com.termux/files/usr/bin/code-server"
  args = [""]
  env = []
  canFail = false
  controllable = true
  stdout = "/home/.mittnite/logs/code-server.log"
  stderr = "/home/.mittnite/logs/code-server.err"
}
@martin-helmich
Copy link
Member

I think this may be similar to #63 (which also has a proposed implementation in #64); would that satisfy your requirement?

@Merith-TK
Copy link
Author

That would be absolutely perfect!

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