postsrsd icon indicating copy to clipboard operation
postsrsd copied to clipboard

sqlite problem

Open iHeadRu opened this issue 8 months ago • 3 comments

Hi!

FreeBSD 14.2 postsrsd-2.0.11 from ports with SQLITE support.

File /var/db/postsrsd/senders.db is automatically created by postsrsd on daemon start. Table kv is created. But postsrsd can not access database. There are errors in syslog: failed to connect to 'sqlite:./senders.db'

Adding sqlite3_errmsg() after call sqlite3_connect() in src/database.c returns "unable to open database file". Permissions and owner of file /var/db/postsrsd/senders.db and parent dir are correct.

What can cause the problem?

iHeadRu avatar May 02 '25 15:05 iHeadRu

The default config assumes the daemon is chroot()ed (which is why the ./ is in the sqlite path, it needs to be relative the the chroot directory.

I'm not sure if chroot is supported in FreeBSD (IIRC they have a separate jail() syscall), so you probably need to fix that part of the configuration.

roehling avatar May 03 '25 10:05 roehling

Setting chroot-dir = "/var/db/postsrsd" does not change anything. Of course chroot syscall is supported in FreeBSD.

iHeadRu avatar May 03 '25 10:05 iHeadRu

Settings

envelope-database = "sqlite:/var/db/postsrsd/senders.db"
chroot-dir = ""

allowed to workaround problem.

iHeadRu avatar May 04 '25 11:05 iHeadRu