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

Optimization when starting services when their dependencies fails to start #720

Open
stacyharper opened this issue Jul 22, 2024 · 0 comments
Assignees

Comments

@stacyharper
Copy link

As you can see in the next example, service1 get restarted 4 times:

$ cat /etc/init.d/service1
#!/sbin/openrc-run

start() {
	echo "SERVICE 1 FAILED"
	exit 1
}
$ cat /etc/init.d/service2
#!/sbin/openrc-run

start() {
	echo "SERVICE 2 FAILED"
	exit 1
}
$ cat /etc/init.d/service3
#!/sbin/openrc-run

start() {
	echo "SERVICE 3 FAILED"
	exit 1
}
$ cat /etc/init.d/service4
#!/sbin/openrc-run

start() {
	echo "SERVICE 4 FAILED"
	exit 1
}
$ cat /etc/conf.d/service2
rc_need="service1"
$ cat /etc/conf.d/service3
rc_need="service2"
$ cat /etc/conf.d/service4
rc_need="service3"

$ doas rc-service service4 start
SERVICE 1 FAILED
 * ERROR: service1 failed to start
SERVICE 1 FAILED
 * ERROR: service1 failed to start
 * ERROR: cannot start service2 as service1 would not start
SERVICE 1 FAILED
 * ERROR: service1 failed to start
SERVICE 1 FAILED
 * ERROR: service1 failed to start
 * ERROR: cannot start service2 as service1 would not start
 * ERROR: cannot start service3 as service1 would not start
 * ERROR: cannot start service4 as service1 would not start

I would expect for OpenRc to try to start it once, and fail immediately, and for the stderr message to look like:

$ doas rc-service service4 start
SERVICE 1 FAILED
 * ERROR: service1 failed to start
 * ERROR: cannot start service2 as service1 would not start
 * ERROR: cannot start service3 as service2 can not start
 * ERROR: cannot start service4 as service3 can not start
@navi-desu navi-desu self-assigned this Sep 22, 2024
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