File: README

package info (click to toggle)
pmud 0.10-9.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 404 kB
  • ctags: 257
  • sloc: ansic: 2,984; sh: 486; tcl: 290; makefile: 104; perl: 35
file content (135 lines) | stat: -rw-r--r-- 4,527 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
This is pmud - PMU daemon for Linux/PPC on Powerbooks.

Copyright 2000 Stephan Leemburg

At present this supports the PB2400/3400/3500,
the 1999 G3 Powerbooks (aka "Lombard"), and the previous 
generation of G3 Powerbooks (aka "Wallstreet").
 
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version
2 of the License, or (at your option) any later version.

pmud is a system daemon, which is usefull only for Apple Macintosh
Powerbooks. 

It constantly checks the Powermanagement unit to see if there is enough
power left to continue. If power runs short, it will put the machine
to sleep.

This version was modified by me (Stephan Leemburg) mainly for own usage 
on a G3 Wallstreet Powerbook. Note that this version of pmud is inherently 
INSECURE, because every local user can issue a sleep request. 

The source is also not checked for possible buffer overflow attacks. As
this deamon is usefull only on a Apple Powerbook, this is currently not
viewed upon as something which needs immediate attention...

If you're planning to use SIGPWR signals, please test this _before_ starting
pmud with the -s flag. You can test powersignals by creating a file 

/etc/powerstatus 

with an F (the letter F) as it's sole contents. Then do

# kill -SIGPWR 1

if you get an shutdown wall message, you're setup ok. To cancel shutdown
- again - create the file /etc/powerstatus with a O (the uppercase o) as
it's contents and again issue

# kill -SIGPWR 1

you should again receive a wall, indicating shutdown has been cancelled.

If this does not work, check the runlevels in /etc/inittab on the powerfail
entry. Setting it to 012345 will probably work.

The current source is still full of globals, which certainly is not 
something I like. This will get cleaned up in the future. Please note
that any error you discover in pmud or the accompanying objects is 
probably my fault and not that of Paul Mackerras, so you can bother me 
with it.

I need to work for my money so I may not always (if ever) respond 
directly to every question/comment made. Please have some consideration
for this.

For further information, please refer to the manual pmud(8).

Newsgroups: <comp.os.linux.powerpc>
Cc: <pmud-bugs@jvc.nl>
Subject: Re: PowerUp/PowerDown Scripts

in article slrn87ikca.o4.ami@greta.ami.home, Adam Price at ami@greta.ami.home wrote on 10-01-2000 04:40:


>>> What do low power and medium power correspond to?  Empty and full
>>> battery (as opposed to AC)?

...
> 
> Ooops.  That should read "minimum power," not "low power."
> 

...

Aha, well for pmud there are 2 powerlevels:

1 = on battery
2 = on AC

but pwrctl discriminates between 3 powerlevels:

1 = minimum power
2 = medium power
3 = full power

So that's kind of confusing (I'll build a manual page for pwrctl). 

When pmud detects a pmud-powerlevel (which actually should be named powersource) change, it will run pwrctl with an argument. This argument is the pwrctl-powerlevel. The default pwrctl-powerlevels for pmud are:

pmud-powersource pwrctl-powerlevel
__________________________________
1 = on battery   1 = minimum power
2 = on AC        3 = full power

These default relations can be overwritten by the contents of the file:

/etc/powerlevels

It's contents can be set by either telnetting to pmud on it's port (default is 879), like in the following example:

[terra]stephan> telnet localhost 879
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
pmud 0.3 10
S {111 2263 3228 633 15719} {100}
S {111 2263 3228 633 15719} {100}
power 1 2
^]
telnet> c
Connection closed.
[terra]stephan> cat /etc/powerlevels
1 2
[terra]stephan> su
Password: 
[root@terra pmud-0.3]# tail /var/log/messages
Jan 11 09:33:49 terra pmud[324]: running /sbin/pwrctl 2

Or by just editting the file (with vi naturally!) and putting the desired pwrctl-powerlevels in the order on-battery on-AC in the file.

Pmud will then use these levels as an argument to pwrctl on powersource changes. It will enable you to have pwrctl set the system to medium powerconsumption when on battery.

Also when telnetting to pmud you can also issue the "sleep" command, which will give you the same effect as using snooze. So you can emulate snooze by using nc (netcat) and issuing sleep to pmud....

I hope this helps. I will update the manuals accordingly!

--

Stephan Leemburg
<stephan@jvc.nl>

$Id: README,v 1.1.1.1 2001/12/07 11:31:43 sleemburg Exp $