sqlite problem
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?
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.
Setting
chroot-dir = "/var/db/postsrsd"
does not change anything.
Of course chroot syscall is supported in FreeBSD.
Settings
envelope-database = "sqlite:/var/db/postsrsd/senders.db"
chroot-dir = ""
allowed to workaround problem.