Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 393499

Summary: app-laptop/laptop-mode-tools please add systemd service file
Product: Gentoo Linux Reporter: emil karlson <jekarlson>
Component: [OLD] UnspecifiedAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: enhancement CC: lmedinas, systemd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 420979    
Bug Blocks: 448882    
Attachments: laptop_mode service file
new service file.
tmpfiles.d conf

Description emil karlson 2011-12-07 11:10:19 UTC
Unit file attached. (tested on app-laptop/laptop-mode-tools-1.55-r2 and systemd-37)

inherit eutils systemd

src_install(){...
systemd_dounit "${FILESDIR}/laptop_mode.service"


Reproducible: Sometimes
Comment 1 emil karlson 2011-12-07 11:11:24 UTC
Created attachment 295061 [details]
laptop_mode service file
Comment 2 emil karlson 2011-12-07 16:31:11 UTC
Upstream is pretty silent on the issue
http://mailman.samwel.tk/pipermail/laptop-mode/2011-March/000406.html

Quoting mgorny on #gentoo-desktop preemptively. 
"systemd policy is to have unit files installed by packages themselves"
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-12-09 17:21:54 UTC
Comment on attachment 295061 [details]
laptop_mode service file

That service file is really bad. You really aren't supposed to reproduce tmpfiles.d in .service files.
Comment 4 emil karlson 2011-12-11 20:43:22 UTC
Created attachment 295491 [details]
new service file.

Ack, my bad.

Toggling the enabled file remains rather nasty touch & rm, since it needs to be removed and created on start/stop.
Comment 5 emil karlson 2011-12-11 20:58:30 UTC
Created attachment 295493 [details]
tmpfiles.d conf

Such tmpfiles.d config files do not seem popular on gentoo, since ebuilds create these directories. For some reason these directories are sometimes removed, which may be just my broken system, feel free to ignore this file, if this is the case.

systemd_dotmpfilesd can be used for this in a manner similar to systemd_dounit
Comment 6 Pacho Ramos gentoo-dev 2013-01-01 14:33:15 UTC
1.62 upstream version install systemd files itself... but per QA warning looks like they should be installed by systemd.eclass :/
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-01-01 15:42:17 UTC
(In reply to comment #6)
> 1.62 upstream version install systemd files itself... but per QA warning
> looks like they should be installed by systemd.eclass :/

Isn't that the warning that you should use systemd.eclass to get the path for appropriate configure option?
Comment 8 Pacho Ramos gentoo-dev 2013-01-01 18:07:46 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > 1.62 upstream version install systemd files itself... but per QA warning
> > looks like they should be installed by systemd.eclass :/
> 
> Isn't that the warning that you should use systemd.eclass to get the path
> for appropriate configure option?

Probably because it installs systemd file under /lib:
 * QA Notice: package installs systemd unit files (/lib/systemd/system)
 *            but does not inherit systemd.eclass.

but, since it relies on its own script to install, I guess will need to sed the script a bit
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-01-01 19:53:30 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > 1.62 upstream version install systemd files itself... but per QA warning
> > > looks like they should be installed by systemd.eclass :/
> > 
> > Isn't that the warning that you should use systemd.eclass to get the path
> > for appropriate configure option?
> 
> Probably because it installs systemd file under /lib:
>  * QA Notice: package installs systemd unit files (/lib/systemd/system)
>  *            but does not inherit systemd.eclass.
> 
> but, since it relies on its own script to install, I guess will need to sed
> the script a bit

You should ask upstream to introduce an option. I see they have INIT_D_PATH so maybe they'll do something about it.
Comment 10 Pacho Ramos gentoo-dev 2013-01-02 21:26:27 UTC
Fixed in 1.62