Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916051 - www-apps/invidious-2023.09.27::guru the init service should require postgresql
Summary: www-apps/invidious-2023.09.27::guru the init service should require postgresql
Status: RESOLVED FIXED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: GURU project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-20 16:19 UTC by benoit.dufour
Modified: 2023-11-04 00:13 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.dufour 2023-10-20 16:19:15 UTC
Hello,
I added the invidious OpenRC service to the run level default, but it always fails to start because it tries to start before PostgreSQL has started.
See those logs :
Caused by: Error connecting to 'localhost:5432': Connection refused (Socket::ConnectError)
  from /usr/bin/invidious in '??'
  from /usr/bin/invidious in '??'
  from /usr/bin/invidious in '??'
  from /usr/bin/invidious in '??'
  from /usr/bin/invidious in '??'
  from /usr/bin/invidious in '__crystal_main'
  from /usr/bin/invidious in 'main'
  from /lib64/libc.so.6 in '??'
  from /lib64/libc.so.6 in '__libc_start_main'
  from /usr/bin/invidious in '_start'
  from ???

So could you fix the invidious init file so it would requires PostgreSQL to be started?
https://github.com/gentoo-mirror/guru/blob/1caf9ef5c1266bffd7ba26a608d6ef38d747d9ee/www-apps/invidious/files/invidious.initd#L16

So basically :
depend() {
	use logger net postgresql-15
}

Or something like :
postgresql-service="$(find /etc/init.d/ -name "*postgresql*" | rev | cut -d '/' -f -1 | rev)"
depend() {
	use logger net "${postgresql-service}"
}

Instead of :
depend() {
	use logger net
}