Skip to content

hissqlite: Initialize a fresh database at install#361

Closed
kev009 wants to merge 1 commit into
InterNetNews:mainfrom
kev009:hissqlite-init
Closed

hissqlite: Initialize a fresh database at install#361
kev009 wants to merge 1 commit into
InterNetNews:mainfrom
kev009:hissqlite-init

Conversation

@kev009

@kev009 kev009 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

innd deliberately opens the history without HIS_CREAT (a missing database at startup is more likely a mount failure than a fresh install, and auto-creating an empty history would re-accept everything), so initialization must happen beforehand. "make install" only knew the hisv6 procedure (touch history + makedbz -i -o), which with hismethod set to hissqlite leaves a stray empty hisv6 database and no .sqlite, and innd then refuses to start.

The initializer is makehistory with no arguments: it opens the history with HIS_CREAT, and on an empty spool that simply creates an initialized empty database (the makedbz -i -o equivalent; verified, and the result opens through the WAL direct-reader path). A bare "touch history.sqlite" is not sufficient: a zero-byte file has no schema and is not in WAL mode, and both innd and the readers refuse it cleanly.

site/Makefile now branches the history-creation recipe on the configured hismethod: for hissqlite it runs makehistory once, keyed on history.sqlite being absent so reinstalls stay no-ops; the hisv6 path is unchanged, and DESTDIR (packaging) installs take the historical path since the installed binaries and inn.conf are not available to query. Document the manual procedure in INSTALL next to the makedbz instructions and in hissqlite(5).

innd deliberately opens the history without HIS_CREAT (a missing database at
startup is more likely a mount failure than a fresh install, and auto-creating
an empty history would re-accept everything), so initialization must happen
beforehand.  "make install" only knew the hisv6 procedure (touch history +
makedbz -i -o), which with hismethod set to hissqlite leaves a stray empty
hisv6 database and no .sqlite, and innd then refuses to start.

The initializer is makehistory with no arguments: it opens the history with
HIS_CREAT, and on an empty spool that simply creates an initialized empty
database (the makedbz -i -o equivalent; verified, and the result opens through
the WAL direct-reader path).  A bare "touch history.sqlite" is not sufficient:
a zero-byte file has no schema and is not in WAL mode, and both innd and the
readers refuse it cleanly.

site/Makefile now branches the history-creation recipe on the configured
hismethod: for hissqlite it runs makehistory once, keyed on history.sqlite
being absent so reinstalls stay no-ops; the hisv6 path is unchanged, and
DESTDIR (packaging) installs take the historical path since the installed
binaries and inn.conf are not available to query.  Document the manual
procedure in INSTALL next to the makedbz instructions and in hissqlite(5).
@Julien-Elie Julien-Elie self-assigned this Jul 16, 2026
@Julien-Elie Julien-Elie added enhancement New feature or request C: build Related to the build system P: medium Medium priority labels Jul 16, 2026
@Julien-Elie Julien-Elie added this to the 2.8.0 milestone Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: build Related to the build system enhancement New feature or request P: medium Medium priority

Development

Successfully merging this pull request may close these issues.

2 participants