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

greyhole service won't start with containerd mariadb (greyhole.service) #327

Open
kedvsk opened this issue May 19, 2024 · 1 comment
Open

Comments

@kedvsk
Copy link

kedvsk commented May 19, 2024

Greyhole service depends on startup on:
Requires=mysqld.service smbd.service
Removing "mysqld.service" is a workaround but results in errors on startup because mysql is not right up now:

Mai 19 10:47:34 testserver CRON[871]: (root) CMD ( /usr/bin/greyhole --boot-init)
Mai 19 10:47:34 testserver CRON[870]: (root) CMD ( /usr/bin/greyhole --create-mem-spool >/dev/null)
Mai 19 10:47:35 testserver systemd[1]: Starting greyhole.service - Greyhole...
░░ Subject: A start job for unit greyhole.service has begun execution
░░ A start job for unit greyhole.service has begun execution.
Mai 19 10:47:35 testserver greyhole[1104]: ERROR: Can't connect to database: SQLSTATE[HY000] [2002] Connection refused
Mai 19 10:47:35 testserver greyhole[1104]: May 19 08:47:35 CRITICAL test-config: Can't connect to database: SQLSTATE[HY000] [2002] Connection refused
Mai 19 10:47:35 testserver systemd[1]: greyhole.service: Control process exited, code=exited, status=1/FAILURE
░░ An ExecStartPre= process belonging to unit greyhole.service has exited.
Mai 19 10:47:35 testserver greyhole[1250]: ERROR: Can't connect to database: SQLSTATE[HY000] [2002] Connection refused
Mai 19 10:47:35 testserver systemd[1]: greyhole.service: Control process exited, code=exited, status=1/FAILURE
░░ An ExecStopPost= process belonging to unit greyhole.service has exited.
Mai 19 10:47:35 testserver systemd[1]: greyhole.service: Failed with result 'exit-code'.
░░ The unit greyhole.service has entered the 'failed' state with result 'exit-code'.
Mai 19 10:47:35 testserver systemd[1]: Failed to start greyhole.service - Greyhole.
░░ Subject: A start job for unit greyhole.service has failed
░░ A start job for unit greyhole.service has finished with a failure.
Mai 19 10:47:41 testserver systemd[1]: greyhole.service: Scheduled restart job, restart counter is at 1.
░░ Automatic restarting of the unit greyhole.service has been scheduled, as the result for
Mai 19 10:47:41 testserver systemd[1]: Starting greyhole.service - Greyhole...
░░ Subject: A start job for unit greyhole.service has begun execution
░░ A start job for unit greyhole.service has begun execution.
Mai 19 10:47:41 testserver greyhole[2350]: Config is OK
Mai 19 10:47:41 testserver systemd[1]: Started greyhole.service - Greyhole.
░░ Subject: A start job for unit greyhole.service has finished successfully
░░ A start job for unit greyhole.service has finished successfully.

My question (maybe the wrong place here): how to tell greyhole.service to wait for mariadb container?

@gboudreau
Copy link
Owner

Hi,

You could run Greyhole (and Samba) as a Docker container, using https://hub.docker.com/r/gboudreau/samba-greyhole
And declare a dependency on a mariadb container using docker-compose depends_on, or docker link.
(The documented way to run the contained, using a sample samba-greyhole.service, will result in the same problem you're having).

Also: why do you care that the Greyhole service fails to start if mariadb is down? systemd will simply retry until it works, no? (But yeah, you'll need to remove the mysqld.service from the .service 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

2 participants