[ltp] Fan control under ubuntu

Paul RIVIER linux-thinkpad@linux-thinkpad.org
Tue, 04 Jul 2006 21:32:09 +0200


This is a multi-part message in MIME format.
--------------070207050702020404000704
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

a year ago I wanted to do exactly that.
At this time, nothing was existing, not as userlandland script, nor as 
kernel handling.
Since then I have seen people doing other stuff, as script as well as 
"in kernel" patches, probably better.
Well, a year after, I'm still using my own sub-optimal solution, 
probably just because it is mine (I am french after all). :)
So far I did never have a single problem with it, so I give it.

Here it is : 2 files, one for the script, one for /etc/init.d. It is 
probably a very very bad idea to start the script without the associated 
rc script, which make sure that either the fan is on AUTO MODE, or 
properly handeld by *only one instance* of my script.

How to use it :
1) copy ibm_manage_fan.sh in /usr/sbin, chmod +x it, read the few first 
lines and set the values you want for the hysterisis.
2) copy ibm_fan_rc in /etc/init.d, chmod +x it
3) to start software fan management, issue a /etc/init.d/ibm_fan_rc 
start command. To automatically start it at boot time, man update-rc.d

Regards


paul




amateur wrote:

>On Tue, Jul 04, 2006 at 02:15:14PM +0200, Michael Ott wrote:
>  
>
>>Hello Ignacio!
>>
>>    
>>
>>>>I've been noticing that under ubuntu the fan of the computer starts and never 
>>>>stops until I shut down - which might mean that I don't have power management 
>>>>properly set up.
>>>>        
>>>>
>>>What's the room temperature? What's the CPU temperature? What's the CPU freq?
>>>
>>>I have an R51 and in winter the fan stops without problems when the CPU (or 
>>>whatever) temp drops below ~37癈. Now it's summer and I have no air 
>>>conditioning, the room temperature is well above 25癈 (almost 30癈) now I 
>>>don't see the CPU below 40癈, that means the fan never stops (fortunately).
>>>      
>>>
>>On my T43 the fan start when the CPU have 60? and stop when it reach
>>54?. Do you think that the fan have to start when the CPU have reached
>>40癈. Not in the winter my Thinkpad is under 50癈.
>>    
>>
>
>How do you manage to acheive that? Could you share your configuration?
>
>  
>
>> 
>>CU        
>>         
>>  Michael  
>>          
>>-- 
>>    ,''`.   Michael Ott, e-mail: michael at zolnott dot de
>>   : :' :   Debian SID on Thinkpad T43: 
>>   `. `'    http://www.zolnott.de/laptop/ibm-t43-uc34nge.html 
>>     `-     
>>Jeden Mittwoch von 21 - 24 Uhr. Zosh! auf Radio Z. 
>>Das H鋜teste, was der Musikmarkt zu bieten hat. http://www.zosh.de
>>Online h鰎en: http://www.radio-z.net 
>>--
>>The linux-thinkpad mailing list home page is at:
>>http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
>>
>>    
>>
>-------------------------
>
>  
>


--------------070207050702020404000704
Content-Type: application/x-shellscript;
 name="ibm_manage_fan.sh"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="ibm_manage_fan.sh"

IyEvYmluL3NoCgojIGlibV9tYW5hZ2VfZmFuIHdyaXR0ZW4gYnkgUGF1bCBSSVZJRVIgKHBh
dWwucml2aWVyQGVsZXZlLmVtbi5mcikKIyB2ZXJzaW9uIDAuMQojIFVuZGVyIEdQTAoKIyBU
aGlzIHNjcmlwdCBwZXJtaXRzIHRvIG1hbmFnZSB0aGUgZmFuCiMgRG8gbm90IHVzZSBpdCBh
bG9uZSAhIE11c3QgYmUgbGF1bmNoIGJ5IHRoZSBpbml0IHNjcmlwdCBpYm1fZmFuX3JjCiMg
UGVhc2UgY29weSB0aGlzIGZpbGUgdG8gL3Vzci9zYmluIGFuZCBtYWtlIGl0IGV4ZWN1dGFi
bGUuCgojIEl0IHJlcXVpcmVzIGlibS1hY3BpIDAuMTEgb3IgaGlnaGVyLCB3aXRoIG1vZGUg
ZXhwZXJpbWVudGFsPTEKIyAhISEhISBCRSBDQVJFRlVMICEhISBTdG9wcGluZyB0aGUgZmFu
IGNhbiBkYW1hZ2UgdGhlIGNvbXB1dGVyCiMgRG8gbm90IHVzZSBpZiB5b3UgZG8gbm90IG1v
bml0b3IgeW91ciBjb21wdXRlcgojIEtub3duIHRvIHdvcmsgb24gVDQyIG9ubHkKIyBVc2Ug
aXQgYXQgeW91ciBvd24gcmlza3MKIyAhISEhI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JCUZBTl9TVEFURT1vZmYKCWZpCgoJIyBJbiBj
YXNlIG9mIGVtZXJnZW5jeSAoZmFuIGNvbnRyb2wgZmFpbHVyZSBvciBmYW4gYnJva2VuKQoJ
IyBsYXB0b3AgaXMgc2h1dCBkb3duICh5b3UgY2FuIHR3ZWFrIHRoZSBiZWhhdmlvcikKCWlm
IFsgJDIgLWdlICRDUklUSUNBTF9URU1QIF0KCXRoZW4KCQllY2hvIC1uIGVuYWJsZSA+IC9w
cm9jL2FjcGkvaWJtL2ZhbgoJCWhhbHQKCQlzbGVlcCAzMAoJZmkKCgoJdGVzdCAtZiAvdmFy
L3J1bi9pYm0tbWFuYWdlLWZhbi1lbmFibGVkIHx8IENPTlRJTlVFPTAgICMgY2hlY2sgaWYg
aXQgaXMgc3VwcG9zZWQgdG8gbG9vcCBvbmUgbW9yZSB0aW1lCgpkb25lCgojIERvIG5vdCBs
ZWF2ZSBmYW4gZGlzYWJsZWQgOikKZWNobyAtbiBlbmFibGUgPiAvcHJvYy9hY3BpL2libS9m
YW4K
--------------070207050702020404000704
Content-Type: text/plain;
 name="ibm_fan_rc"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="ibm_fan_rc"

IyEvYmluL3NoCiMKIyBQbGVhc2UgY29weSB0aGlzIGZpbGUgaW4gL2V0Yy9pbml0LmQgYW5k
IG1ha2UgaXQgZXhlY3V0YWJsZQogCiMgZGVzY3JpcHRpb246IFN0YXJ0cyBhbmQgc3RvcCBp
Ym1fbWFuYWdlX2ZhbiBhcyB0byBjb250cm9sIHRoZSBmYW4gb24gaWJtIHRoaW5rcGFkcwoj
IFJlYWQgL3Vzci9zYmluL2libV9tYW5hZ2VfZmFuLnNoICEKCi4gL2xpYi9sc2IvaW5pdC1m
dW5jdGlvbnMKCgppZiBbICEgLWYgL3Byb2MvYWNwaS9pYm0vZmFuIF0gOyB0aGVuCgllY2hv
ICJQbGVhc2UgdXNlIGlibS1hY3BpIDAuMTEgb3IgaGlnaGVyLCB3aX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