Bug 1471920 - Unable to run tgtd inside a docker container due to ECCESS on oom_score_adj
Summary: Unable to run tgtd inside a docker container due to ECCESS on oom_score_adj
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: scsi-target-utils
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Andy Grover
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-17 16:30 UTC by Daniel Berrangé
Modified: 2017-08-09 15:57 UTC (History)
3 users (show)

Fixed In Version: scsi-target-utils-1.0.70-2.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-09 15:57:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Fix build on Fedora 26 (1013 bytes, patch)
2017-07-20 11:02 UTC, Daniel Berrangé
no flags Details | Diff

Description Daniel Berrangé 2017-07-17 16:30:55 UTC
Description of problem:
If running tgtd inside a docker container, it will immediately exit on startup because it lacks permissions to change oom_score_adj, even if running as root in the container.

stat("/proc/self/oom_score_adj", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
open("/proc/self/oom_score_adj", O_WRONLY) = 8
write(8, "-1000\n", 6)                  = -1 EACCES (Permission denied)
write(2, "can't adjust oom-killer's pardon"..., 77can't adjust oom-killer's pardon /proc/self/oom_score_adj, Permission denied
) = 77
close(8)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++

Latest upstream has added check to avoid this problem a year ago

https://github.com/fujita/tgt/commit/d27320f7cdd9eef7a257b42f4bd6816efb106259

for some reason Fedora 26 version is lagging behind upstream by ~ 2 years so is lacking this fix :-(


Version-Release number of selected component (if applicable):
scsi-target-utils-1.0.55-6.fc26.x86_64

Comment 1 Andy Grover 2017-07-18 20:35:03 UTC
FWIW an updated version 1.0.70 is available for F25, but upstream has unresolved issues building with F26's GCC 7. Let me work on resolving those and we should be able to get F26 more current.

Comment 2 Daniel Berrangé 2017-07-20 11:02:29 UTC
Created attachment 1301664 [details]
Fix build on Fedora 26

Comment 3 Daniel Berrangé 2017-07-20 11:03:07 UTC
That patch is what I used to let it build cleanly on F26

Comment 4 Fedora Update System 2017-07-26 21:30:20 UTC
scsi-target-utils-1.0.70-2.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-fa34b3107e

Comment 5 Andy Grover 2017-07-26 21:31:33 UTC
Thanks, Daniel!

Comment 6 Fedora Update System 2017-07-28 01:52:34 UTC
scsi-target-utils-1.0.70-2.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-fa34b3107e

Comment 7 Fedora Update System 2017-08-09 15:57:32 UTC
scsi-target-utils-1.0.70-2.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.