Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
The Grumpy Editor's Fedora 18 experience
Posted Jan 16, 2013 0:16 UTC (Wed) by nirik (subscriber, #71)
a) edit /etc/systemd/logind.conf and tell it to not do that.
b) run systemd-inhibit to prevent it from doing so when you don't want it to.
(something like: 'systemd-inhibit --what=handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch sleep NNNNN'
Posted Jan 16, 2013 0:38 UTC (Wed) by quintesse (subscriber, #14569)
(I also tried systemd-inhibit, but all the examples I find seem to be missing some important part because the command always complains)
Posted Jan 16, 2013 4:48 UTC (Wed) by mezcalero (subscriber, #45103)
Posted Jan 16, 2013 10:44 UTC (Wed) by jospoortvliet (subscriber, #33164)
Are there hooks for the UI to control this, Lennart?
(I use the feature to disable power management in the battery applet frequently, it's a smart and useful feature which I'd rather not see broken)
I'll surely test this feature for the upcoming openSUSE 12.3 release to make sure I raise a bug if this is an issue there too. I'd rather not have us ship it this way.
Posted Jan 16, 2013 22:50 UTC (Wed) by mezcalero (subscriber, #45103)
With other words: KDE can do whatever it wants, it can tell logind to stay away from the lid switch, or it can leave logind in control, and can even dynamically do that at any time.
GNOME for example tells logind to stay away from the lid switch if an external monitor is plugged in, but otherwise let's logind handle everything.
Posted Jan 17, 2013 18:16 UTC (Thu) by man_ls (subscriber, #15091)
Posted Jan 18, 2013 10:41 UTC (Fri) by dgm (subscriber, #49227)
I hereby propose that systemd gets merged with Emacs. Think of the possibilities! It would become sentient in less than 24 hours...
Posted Jan 18, 2013 16:12 UTC (Fri) by man_ls (subscriber, #15091)
Posted Jan 22, 2013 23:59 UTC (Tue) by DonDiego (subscriber, #24141)
Posted Jan 18, 2013 22:49 UTC (Fri) by mathstuf (subscriber, #69389)
Posted Jan 19, 2013 15:52 UTC (Sat) by nix (subscriber, #2304)
My normal arguments about init being critical software and thus being software that should not change too fast (because if it dies the system is useless and instantly panics) is moot here, because if your Emacs dies your system is useless in any case. I mean, what else is an OS for?
Posted Jan 19, 2013 16:44 UTC (Sat) by apoelstra (subscriber, #75205)
This isn't true, is it? Do people do that?
I'm scared to try because I don't know Emacs well enough to undo it.
Posted Jan 19, 2013 20:10 UTC (Sat) by tom.prince (subscriber, #70680)
If you just pass init=/usr/bin/emacs on the kernel command line, you shouldn't need to do anything to undo it.
Posted Jan 20, 2013 8:04 UTC (Sun) by apoelstra (subscriber, #75205)
That didn't work. Maybe this is a bug in Fedora's initram, because it worked the last time I tried it (several years ago, and with an actual init program).
For those curious, I did manage to do it though, by popping open my initramfs and adding an explicit INIT=/bin/emacs after the code which sets the INIT variable. The result was emacs saying "cannot open /dev/tty" and bailing, and then the kernel panicked.
If only udev had been merged into emacs..
Posted Jan 16, 2013 0:27 UTC (Wed) by mezcalero (subscriber, #45103)
Posted Jan 16, 2013 7:11 UTC (Wed) by ekj (guest, #1524)
Posted Jan 16, 2013 13:34 UTC (Wed) by cortana (subscriber, #24596)
Posted Jan 16, 2013 13:40 UTC (Wed) by ekj (guest, #1524)
But having different rules for what to do when you're plugged in, relative to when you're on battery-power is something that's fairly standard, and something there's a good reason for.
Posted Jan 29, 2013 15:16 UTC (Tue) by oblio (guest, #33465)
Posted Jan 16, 2013 15:24 UTC (Wed) by lkundrak (subscriber, #43452)
When the machine is plugged in, I mostly close the lid to turn off the screen so that it does not disturb me from sleep, but can still be alive finishing a build.
When it's not plugged, I'm probably travelling and I close the lid so that I can carry the laptop in my bag.
This even sounds like a sane default to me and I'll miss the setting terribly if it goes away from my desktop.
Posted Jan 16, 2013 18:45 UTC (Wed) by mathstuf (subscriber, #69389)
Posted Jan 17, 2013 8:52 UTC (Thu) by michich (subscriber, #17902)
Posted Jan 18, 2013 22:37 UTC (Fri) by mathstuf (subscriber, #69389)
Posted Jan 18, 2013 9:06 UTC (Fri) by Kamilion (subscriber, #42576)
My Asus netbook currently has the exact settings you speak of, under windows 7. If the machine is on AC, display off. If the machine is on battery, suspend. I find myself instinctively pulling the cord out before closing the screen when I'm about to take it somewhere. Just consider it another plus one to the idea, since I think it's Asus's fancy 'superhybridengine' power profiles that seem to invoke this behavior.
Can't complain, since they threw a free windows license in my face, might as well stick steam on it.
On the upside, FC18 ships with systemd 19*, so it'd be pretty sane to send a patch to the ML and expect to be able to build and utilize the resulting fix. (haha, systemd-44 patches? YGTBSM.)
Posted Jan 29, 2013 8:15 UTC (Tue) by Duncan (guest, #6647)
Originally designed to deal with the kernel's laptop-mode, it now ships a plethora of scripts designed to control all sorts of things. The defaults are sane and reasonable in most cases, but those who feel the need can tweak settings to their heart's content (as naturally I have, being a gentooer =:^)
rpmfind doesn't appear to list any fedora packages, but it does list mandriva/opensuse/sourceforge/mageia/dagfabian-rhel noarch packages, upto 1.61, which is only a version behind the 1.62 that's showing up here on gentoo (and that adds systemd support according to the changelog, so anyone running that will probably want to grab 1.62 from the home page, there's Fedora-specific instructions), and it lists homepages/sites for it as well, so that would appear to be a reasonable place for rpm-based-distro folks at least to start looking for more, if they're interested.
But you really have to take a look in the tarball to see all the modules it comes with, and thus the configuration options. =:^)
While I don't see a direct lid-switch module in the 1.60 tarball that's what I have on my (slightly dated) netbook install, there's hooks for adding commandlines to execute at plug/unplug, and it'd be simple enough to add the commands above, there.
Posted Jan 16, 2013 22:54 UTC (Wed) by mezcalero (subscriber, #45103)
GNOME for example turns off lid switch handling if an external monitor is plugged in. If you want a different policy, file a bug against GNOME or hack it up yourself.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds