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

frequently spawned and exited #1671

Closed
Cola5173 opened this issue Jan 7, 2025 · 1 comment
Closed

frequently spawned and exited #1671

Cola5173 opened this issue Jan 7, 2025 · 1 comment
Labels

Comments

@Cola5173
Copy link

Cola5173 commented Jan 7, 2025

below is my conf to run a JAVA service:
···
[program:logplatform_service]
command=/bin/sh /data/service/st-logplatform-service/run.sh start
autostart=true
autorestart=true
startsecs=10
startretries=3
user=root
···
but the log in supervisord.log is like:
....
[root@log_service supervisord.d]# tail -f /var/log/supervisor/supervisord.log
2025-01-06 14:53:21,619 INFO supervisord started with pid 923709
2025-01-06 14:53:22,624 INFO spawned: 'logplatform_service' with pid 923739
2025-01-06 14:53:24,500 INFO exited: logplatform_service (exit status 0; not expected)
2025-01-06 14:53:25,505 INFO spawned: 'logplatform_service' with pid 923871
2025-01-06 14:53:27,343 INFO exited: logplatform_service (exit status 0; not expected)
2025-01-06 14:53:29,349 INFO spawned: 'logplatform_service' with pid 924035
2025-01-06 14:53:31,278 INFO exited: logplatform_service (exit status 0; not expected)
2025-01-06 14:53:34,285 INFO spawned: 'logplatform_service' with pid 924243
2025-01-06 14:53:36,131 INFO exited: logplatform_service (exit status 0; not expected)
.....
does anyone know how to fix it, how can i run my java service?
i can start my java service well just run:

/bin/sh /data/service/st-logplatform-service/run.sh start
@mnaberez
Copy link
Member

mnaberez commented Jan 8, 2025

2025-01-06 14:53:22,624 INFO spawned: 'logplatform_service' with pid 923739
2025-01-06 14:53:24,500 INFO exited: logplatform_service (exit status 0; not expected)
2025-01-06 14:53:25,505 INFO spawned: 'logplatform_service' with pid 923871
2025-01-06 14:53:27,343 INFO exited: logplatform_service (exit status 0; not expected)
2025-01-06 14:53:29,349 INFO spawned: 'logplatform_service' with pid 924035
2025-01-06 14:53:31,278 INFO exited: logplatform_service (exit status 0; not expected)
2025-01-06 14:53:34,285 INFO spawned: 'logplatform_service' with pid 924243
2025-01-06 14:53:36,131 INFO exited: logplatform_service (exit status 0; not expected)

supervisord is trying to start the program but every time it does so, the program exits quickly. The configuration above has startsecs=10, which means the program must stay running for 10 seconds to be considered a successful start. It does not, so supervisord says the exit is not expected. Since startretries and autorestart are also configured, supervisord tried to start the program again when it exits unexpectedly.

Either the program is running into some error that is causing it to exit quickly, in which case it may have printed something to stdout or stderr that may have been captured in the logs, or the program is daemonizing.

i can start my java service well just run:

/bin/sh /data/service/st-logplatform-service/run.sh start

If you run this command and your shell prompt returns, but your program is now running in the background, it means that your program has daemonized. For a program to run under supervisord, it must not daemonize. The program must run in the foreground.

The Supervisor developers do not have enough bandwidth to assist with running individual programs under supervisord. This issue tracker is used mainly for bugs in supervisord itself.

@mnaberez mnaberez closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants