Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591352 - sys-block/zram-init: /usr/lib/systemd/system/zram-*.service files should be config-protected
Summary: sys-block/zram-init: /usr/lib/systemd/system/zram-*.service files should be c...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-15 23:24 UTC by Maciej Mrozowski
Modified: 2016-08-21 22:47 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.txt,18.73 KB, text/plain)
2016-08-15 23:26 UTC, Maciej Mrozowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Mrozowski gentoo-dev 2016-08-15 23:24:31 UTC
system-d zram service ignores /etc/conf.d/zram-init (config for openrc), instead, zram volume settings are hardcoded in /usr/lib/systemd/system/zram-*.service files.
Those need to overrided everytime by the used.
And with each zram-init reinstallation, those settings are lost.
Either those settings need to be config-protected, or zram-*.service files need to tweaked to reuse /etc/conf.d/zram-init settings.
Comment 1 Maciej Mrozowski gentoo-dev 2016-08-15 23:26:53 UTC
Created attachment 443434 [details]
emerge --info
Comment 2 Jason Zaman gentoo-dev 2016-08-16 01:54:26 UTC
(In reply to Maciej Mrozowski from comment #0)
> system-d zram service ignores /etc/conf.d/zram-init (config for openrc),
> instead, zram volume settings are hardcoded in
> /usr/lib/systemd/system/zram-*.service files.
> Those need to overrided everytime by the used.
> And with each zram-init reinstallation, those settings are lost.
Arn't you supposed to replace the service file in /etc/systemd/system/? Systemd uses files in /etc to override /usr/

> or zram-*.service files
> need to tweaked to reuse /etc/conf.d/zram-init settings.
This is actually forbidden (by QA i think?) SystemD should not import openrc files at all.
Comment 3 Martin Väth 2016-08-16 21:57:44 UTC
(In reply to Jason Zaman from comment #2)
> Aren't you supposed to replace the service file in /etc/systemd/system/?

Either this, or one can just override the data one wants.
For instance, one can put into

/etc/lib/systemd/system/zram_swap.service.d/size512

a file with the content

[Service]
ExecStart=
ExecStart=/usr/sbin/zram-init -s2 -alz4 512

(the empty ExecStart= is necessary to "clean" the original ExecStart command)
Comment 4 Maciej Mrozowski gentoo-dev 2016-08-21 22:47:43 UTC
(In reply to Jason Zaman from comment #2)
> Arn't you supposed to replace the service file in /etc/systemd/system/?
> Systemd uses files in /etc to override /usr/

Indeed it seems so:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Unit_Files.html#sect-Managing_Services_with_systemd-Unit_File_Modify

Well, that's an easy bug to fix.