Bug 228582 - irc/ircd-hybrid - klinefile and friends.
Summary: irc/ircd-hybrid - klinefile and friends.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Santhosh Raju
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-29 02:41 UTC by Bunny Evans
Modified: 2020-04-04 21:54 UTC (History)
2 users (show)

See Also:
fox: maintainer-feedback+


Attachments
Sets ownership correctly for /var/ircd-hybrid directory (1.81 KB, patch)
2020-04-01 17:13 UTC, Santhosh Raju
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bunny Evans 2018-05-29 02:41:59 UTC
/var/log/ircd.log contains an infinite number of these:

[2018-05-29T11:28:02+0900] Cannot create temporary database file /var/lib/kline.db.new
[2018-05-29T11:28:02+0900] Cannot create temporary database file /var/lib/dline.db.new
[2018-05-29T11:28:02+0900] Cannot create temporary database file /var/lib/xline.db.new
[2018-05-29T11:28:02+0900] Cannot create temporary database file /var/lib/resv.db.new

This is caused by the Makefile containing: --localstatedir=/var
and the resulting configure being:

  $ ./configure --disable-assert --disable-halfops --enable-openssl=/usr --sysconfdir=/usr/local/etc/ircd-hybrid --datarootdir=/usr/local/share/ircd-hybrid-8.2.22 --localstatedir=/var --prefix=/usr/local --mandir=/usr/local/man --disable-silent-rules --infodir=/usr/local/info/ --build=amd64-portbld-freebsd11.1


These 4 files are not configured in the config file for reasons unknown, but handed over on the command line:


I think the solution is to modify the start up script to deal with this, but I am puzzled why a port in /usr/local is doing anything in /var, let along /var/lib ...

I do not know the official freebsd way to fix this ^^;
Comment 1 Diane Bruce freebsd_committer freebsd_triage 2018-06-04 14:21:22 UTC
Well, that's silly. I'll look at it. Should be very simple fix.
Comment 2 Diane Bruce freebsd_committer freebsd_triage 2018-06-04 15:15:33 UTC
ok looking at this further, I think the best way to handle this is to place the hybrid state files under var/hybrid/ with the ownership changed to match that of the hybrid owner. kline.conf would then be in /usr/local/var/hybrid/kline.conf
etc.
Comment 3 Bunny Evans 2018-06-30 13:37:45 UTC
That seems to have stopped the errors.
Comment 4 Walter Schwarzenfeld freebsd_triage 2019-03-02 04:10:30 UTC
See Comment3. Can we close here?
Comment 5 Bunny Evans 2019-03-02 09:01:36 UTC
(In reply to w.schwarzenfeld from comment #4)

Assuming the patch was put in the release, yes.
Comment 6 Walter Schwarzenfeld freebsd_triage 2019-08-14 11:34:46 UTC
ping!
Comment 7 Santhosh Raju freebsd_committer freebsd_triage 2019-10-09 22:45:25 UTC
irc/ircd-hybrid has been updated to 8.2.26.

Not sure if the issue still persists in this version, I was not able to replicate it.

Will keep this open for a week, if there are no updates, I shall close this ticket.
Comment 8 Bunny Evans 2020-04-01 09:30:08 UTC
This is back with 8.2.30
Comment 9 Santhosh Raju freebsd_committer freebsd_triage 2020-04-01 14:36:44 UTC
I shall have a look and get back to you.
Comment 10 Santhosh Raju freebsd_committer freebsd_triage 2020-04-01 17:13:55 UTC
Created attachment 212937 [details]
Sets ownership correctly for /var/ircd-hybrid directory

(In reply to Bunny Evans from comment #8)

Based on db@'s suggestion above, I have changed the location of --localstatedir from /var to /var/ircd-hybrid and gave the proper permissions to this folder.

In my local environment this seems to be working as intended and the databases are now created correctly. The log no longer has permission denied error when creating them.

I have attached a patch that addresses this issue, let me know if applying it and rebuilding solves the issue for you.
Comment 11 Santhosh Raju freebsd_committer freebsd_triage 2020-04-04 16:35:00 UTC
(In reply to Bunny Evans from comment #8)

Were you able to test this patch?
Comment 12 Bunny Evans 2020-04-04 20:56:24 UTC
Not exactly good with patches here, but yes. That works.
Comment 13 Santhosh Raju freebsd_committer freebsd_triage 2020-04-04 21:28:23 UTC
(In reply to Bunny Evans from comment #12)

Apologies, did not realize that, thank you for testing, let me commit it to the ports tree.
Comment 14 commit-hook freebsd_committer freebsd_triage 2020-04-04 21:50:23 UTC
A commit references this bug:

Author: fox
Date: Sat Apr  4 21:49:29 UTC 2020
New revision: 530722
URL: https://svnweb.freebsd.org/changeset/ports/530722

Log:
  irc/ircd-hybrid: Fixes permissions for localstatedir.

  Instead of pointing directly to /var, now localstatedir now
  points to /var/ircd-hybrid with proper permissions so that the
  databases are correctly created during start up.

  Also minor formatting fixes.

  PR:		228582
  Reported by:	Bunny Evans <bunny.evans@gmail.com>

Changes:
  head/irc/ircd-hybrid/Makefile
  head/irc/ircd-hybrid/pkg-plist
Comment 15 Santhosh Raju freebsd_committer freebsd_triage 2020-04-04 21:54:10 UTC
Committed the changes, closing the ticket.

Feel free to report back here in case you face issues again.

Thank you.