Bug 227218 - databases/mongodb32: Adapt ${name}_limits to the new resource limiting mechanics for services
Summary: databases/mongodb32: Adapt ${name}_limits to the new resource limiting mechan...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Thomas Zander
URL:
Keywords: patch-ready, regression
Depends on:
Blocks: 227205
  Show dependency treegraph
 
Reported: 2018-04-02 23:41 UTC by Mateusz Piotrowski
Modified: 2018-05-20 09:36 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback?
0mp: maintainer-feedback?


Attachments
Patch adding support for the new ${name}_limits mechanics (databases/mongodb32) (2.65 KB, patch)
2018-04-02 23:41 UTC, Mateusz Piotrowski
no flags Details | Diff
Patch adding support for the new ${name}_limits mechanics (databases/mongodb32, revision: 1) (2.65 KB, patch)
2018-04-04 18:07 UTC, Mateusz Piotrowski
no flags Details | Diff
Patch adding support for the new ${name}_limits mechanics (databases/mongodb32, revision: 4) (2.76 KB, patch)
2018-04-11 00:13 UTC, Mateusz Piotrowski
0mp: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Piotrowski freebsd_committer freebsd_triage 2018-04-02 23:41:05 UTC
Created attachment 192132 [details]
Patch adding support for the new ${name}_limits mechanics (databases/mongodb32)

Thanks to the recent change to rc.subr(8) it is no longer necessary to
define a resource limiting logic in service scripts. limits(1) is now run
by default and its configuration is handled via the "${name}_limits"
variable.

Unfortunately, there is a collision of variable names. The service
scripts are broken on FreeBSD version with that new change (12.0-CURRENT,
11-STABLE and soon 11.2-RELEASE). It has been reported and diagnosed here.[2]

I'm submitting a patch fixing the service script for this port. A similar patch
has already been accepted by a maintainer of another database port.[2]

The patch preserves the old behavior on the systems without the
modification.

It would be great if you could review the patch and test it. :)

[1]: https://svnweb.freebsd.org/base?view=revision&revision=r328331
[2]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226907
Comment 1 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-04-04 18:07:40 UTC
Created attachment 192222 [details]
Patch adding support for the new ${name}_limits mechanics (databases/mongodb32, revision: 1)

The previous patch would fail to trigger the new ${name}_limits semantics for __FreeBSD_version 1101514. The new patch fixes it (thanks to mmokhi@).
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-04-11 00:13:07 UTC
Created attachment 192408 [details]
Patch adding support for the new ${name}_limits mechanics (databases/mongodb32, revision: 4)

Due to an increasing number of problems caused by the new ${name}_limits behavior, the revision, which was backported from 12-CURRENT to 11-STABLE, has now been reverted.[1] As a result, the new behavior will not be present in any FreeBSD version < 12. 

This new patch adapts the port to those latest changes.

[1]: https://svnweb.freebsd.org/base?view=revision&revision=r332363
Comment 3 Thomas Zander freebsd_committer freebsd_triage 2018-04-30 17:32:58 UTC
This does not work in the default case on stable/11:

root@p11xSamd64-default:~ # service mongod onestart
Starting mongod.
limits: NO: No such file or directory
/usr/local/etc/rc.d/mongod: WARNING: failed to start mongod
Comment 4 Mateusz Piotrowski freebsd_committer freebsd_triage 2018-04-30 18:37:03 UTC
(In reply to Thomas Zander from comment #3)

The new mechanics made it into 11-STABLE[1] but it was later removed[2].

Aren't you running a relatively old 11-STABLE?

[1]: https://svnweb.freebsd.org/base?view=revision&revision=r332089
[2]: https://svnweb.freebsd.org/base?view=revision&revision=r332363
Comment 5 Thomas Zander freebsd_committer freebsd_triage 2018-05-05 05:06:24 UTC
Not *very* old, but indeed a few commits older than your references. Will upgrade asap.
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-05-20 09:25:13 UTC
A commit references this bug:

Author: riggs
Date: Sun May 20 09:24:10 UTC 2018
New revision: 470445
URL: https://svnweb.freebsd.org/changeset/ports/470445

Log:
  Adapt ${name}_limits to the new resource limiting mechanics for services

  PR:		227218
  Submitted by:	0mp

Changes:
  head/databases/mongodb32/Makefile
  head/databases/mongodb32/files/mongod.in