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

Bug 334393

Summary: sys-power/pm-utils: hdparm settings are reset during KDE startup
Product: Gentoo Linux Reporter: Wonko <wonko>
Component: [OLD] KDEAssignee: Freedesktop bugs <freedesktop-bugs>
Status: RESOLVED DUPLICATE    
Severity: minor CC: arne.flagge, confabulate, daniel, tomas
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: https://bugs.kde.org/show_bug.cgi?id=248905
Whiteboard:
Package list:
Runtime testing required: ---

Description Wonko 2010-08-25 09:49:34 UTC
Disk drive settings like acoustic management or spindown time are somehow being reset when KDE starts up.


Reproducible: Always

Steps to Reproduce:
1. hdparm -M /dev/sdX # get current setting, 0 for me
2. hdparm -M 128 /dev/sdX # change to most quiet mode
3. log into KDE
Actual Results:  
hdparm -M /dev/sdX again gives 0

Expected Results:  
hdparm -M /dev/sdX should return 128

Other settings are also affected. I set the spindown time in
/etc/init.d/hdparm, but when loging into KDE, I have to start the script again
to make any of its settings work.

I also like some drives to spin down immeadiately after bootup, but they all
spin up during login, even if no partitions are mounted.

Another Gentoo user also has this problem:
http://thread.gmane.org/gmane.linux.gentoo.user/232044

I reported first to bugs.kde.org, but they say it's Gentoo-specific.

I'm running KDE 4.5.0. Can't say if this also happens with earlier versions, I did not use the spindown feature then.

Portage 2.2_rc68 (default/linux/amd64/10.0/desktop/kde, gcc-4.4.4, glibc-2.11.2-r0, 2.6.34-tuxonicegrml x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.34-tuxonicegrml-x86_64-AMD_Athlon-tm-_Dual_Core_Processor_4850e-with-gentoo-2.0.1
Timestamp of tree: Tue, 24 Aug 2010 10:45:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.2
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8-sse3 -mfpmath=sse -O2 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/portage /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=k8-sse3 -mfpmath=sse -O2 -pipe -ggdb"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests buildpkg buildsyspkg ccache collision-protect distlocks fixlafiles fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ ftp://gentoo.imj.fr/pub/gentoo/ http://mirror.leaseweb.com/gentoo/ ftp://mirror.leaseweb.com/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j3"
PKGDIR="/var/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/portage/tmp"
PORTDIR="/var/portage/tree"
PORTDIR_OVERLAY="/var/portage/layman/kde /var/portage/layman/kde-sunset /var/portage/layman/armagetron /var/portage/layman/science /var/portage/layman/zugaina /var/portage/layman/sunrise /var/portage/local"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac aalib acl acpi aim alsa amd64 apache2 apm audiofile bash-completion bcmath berkdb bluetooth branding bzip2 cairo calendar cdparanoia cdr cli consolekit cracklib crypt ctype cups cvs cxx dbus dga directfb dri dts dvb dvd dvdr emacs emboss encode exif fam fbcon ffmpeg firefox flac foomaticdb fortran ftp gd gdbm ggi gif gimp ginac gphoto2 gpm gtk hal handbook hddtemp iconv ieee1394 imagemagick imlib ipv6 jabber jack java javascript jbig jpeg jpeg2k kde latex lcms ldap libnotify lirc lm_sensors mad maildir matroska matrox mikmod mime mmx mng modplug modules motif mp3 mp4 mpeg mplayer msn mudflap multilib musepack musicbrainz nas ncurses nls nptl nptlonly nsplugin ogg openal opengl openmp oss pam pango pcre pdf perl php plotutils png ppds pppd python qt3support qt4 quicktime radius readline recode reflection ruby samba scanner sdl semantic-desktop session slang slp sndfile sockets sox speex spell spl sse sse2 sse3 ssl startup-notification subversion svg sysfs tcpd theora threads tiff truetype unicode usb videos vim-syntax visualization vorbis wma wmf wxwindows x264 xattr xcb xcomposite xine xml xorg xosd xpm xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" FRITZCAPI_CARDS="fcpci" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" LIRC_DEVICES="serial" MISDN_CARDS="avmfritz" RUBY_TARGETS="ruby18" SANE_BACKENDS="canon_pp microtek" USERLAND="GNU" VIDEO_CARDS="fglrx radeon radeonhd vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Wonko 2010-08-25 09:54:15 UTC
The thread I mentioned has the information that this happens from KDE-4.4.4 on.
Comment 2 MickKi 2010-08-25 17:58:11 UTC
I posted in the thread mentioned above.  Currently unning KDE-4.4.4 on stable x86.

Running '/sbin/hdparm -M 128 /dev/sda' survives through a reboot and is retained if I login into other DMs (e.g. fluxbox) or console, but not if login into KDE, where acoustic management is switched off (it defaults to 254).

If I recall correctly this started with the kde-4.4.4 version.

Please let me know if you need additional info to troubleshoot this.
-- 
Regards,
Mick
Comment 3 Arne Flagge 2010-08-26 06:42:46 UTC
I had another pm related issue with KDE and it was caused by pm-utils (used by powerdevil). pm-utils sets a lot of pm settings (see /usr/lib/pm-utils/* scripts). Try to disable the harddrive features of pm-utils by:
touch /etc/pm/power.d/harddrive

and restart KDE.
Comment 4 MickKi 2010-08-30 16:25:22 UTC
(In reply to comment #3)
> I had another pm related issue with KDE and it was caused by pm-utils (used by
> powerdevil). pm-utils sets a lot of pm settings (see /usr/lib/pm-utils/*
> scripts). Try to disable the harddrive features of pm-utils by:
> touch /etc/pm/power.d/harddrive and restart KDE.

Thanks, this stopped KDE from interfering with the hdparm settings.
-- 
Regards,
Mick
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2010-11-14 16:25:34 UTC
This actually relates to bug #257156 if I'm correct.
The difference with the original bug is that there is a hdparm script now, it must be handled by the ebuild now. I'll mark this one as a duplicate then.

*** This bug has been marked as a duplicate of bug 257156 ***
Comment 6 Arne Flagge 2010-11-19 08:45:39 UTC
I don't think, the solution in bug #257156 fixes this bug. That bug handles the supend/resume case, while this bug handles the power-on case.

The script in question is "power.d/harddrive", which is provided by the pm-utils package itself and won't get obsolete by adding another script in "sleep.d". To handle this bug, I propose to ignore script at the install phase, because the script is a bad default. It is obvious for  users of KDE's powerdevil and (GNOME's) upower don't expect, that their sane configuration of hdparm get overwritten by a basic, not flexibel pm script.
Comment 7 Gilles Dartiguelongue (RETIRED) gentoo-dev 2010-11-19 09:08:06 UTC
well, the script is configurable, does powerdevil changes hdd parameters on its own ?
Comment 8 Arne Flagge 2010-11-19 09:38:57 UTC
(In reply to comment #7)
> well, the script is configurable, does powerdevil changes hdd parameters on its
> own ?
> 
No, powerdevil doesn't change any harddisk parameter by its own.

Also the "power.d/harddisk" script provides basic pm defaults, if you don't change any hdparm parameters. That's all fine. But if you want to change something, there are several points where pm-utils fails:
1) Hdparm parameters apply not until the the pm apps (powerdevil, upower) starts.
2) Users have to move existing hdparm configuration to pm-util.
3) The config file to override the defaults doesn't exists. You have to create it by your own.
4) The new config file is empty. Users have to learn, how to configure pm-util scripts.
5) Config can not be shared. The suspend/resume script of bug #257156 depends on hdparm and its configuration.
6) Admins of server and desktop maschines have to configure both differently.
Comment 9 Gilles Dartiguelongue (RETIRED) gentoo-dev 2010-11-19 09:57:20 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > well, the script is configurable, does powerdevil changes hdd parameters on its
> > own ?
> > 
> No, powerdevil doesn't change any harddisk parameter by its own.
> 
> Also the "power.d/harddisk" script provides basic pm defaults, if you don't
> change any hdparm parameters. That's all fine. But if you want to change
> something, there are several points where pm-utils fails:
> 1) Hdparm parameters apply not until the the pm apps (powerdevil, upower)
> starts.

that is fine, you most likely have a login manager that should start one of these if you are in a situation where you want pm-utils, otherwise it's admin's work to make sure pm-utils gets triggered on boot (a dbus call in local.start would do the job just fine).

> 2) Users have to move existing hdparm configuration to pm-util.

I wanted to say something sarcastic but I'll fallback to documentation. Writing something up for the power management guide would be the way to go.

> 3) The config file to override the defaults doesn't exists. You have to create
> it by your own.

same a 2

> 4) The new config file is empty. Users have to learn, how to configure pm-util
> scripts.

variation of 3, see answer to 2

> 5) Config can not be shared. The suspend/resume script of bug #257156 depends
> on hdparm and its configuration.

I guess you mean shared between hdparm and pm-utils. We could probably solve that by making a default configuration file wrapping hdparm conf.d but in any case, it still is the same argument as 2

> 6) Admins of server and desktop maschines have to configure both differently.

that's entirely up to the admin of the machine, see answer to 1
Comment 10 Arne Flagge 2010-11-19 10:17:05 UTC
Sure, it can all by done, but it is a lot of effort to push something, which I would call at the moment a regression.

It think is  good to have some pm defaults and pm-utils looks like the right app for this task, but without the proper docs and an annoucements of the switch in configuration (harddisk pm is new in pm-utils 1.4), the change is a regression for the uninformed user, see the bug's reporter.

So until the work is done, I suggest to ignore the script.

Comment 11 Andreas K. Hüttel archtester gentoo-dev 2010-11-19 17:21:42 UTC
KDE is following the freedesktop alias anyway, no need to send all e-mails twice