Re: apmd(8): reconnecting AC, not battery

2022-05-30 Thread Joerg Jung



> On 28. May 2022, at 16:31, Jan Stary  wrote:
> 
> On May 28 10:34:35, s...@spacehopper.org wrote:
>> On 2022/05/28 06:52, Jason McIntyre wrote:
>>> On Fri, May 27, 2022 at 07:19:37PM +0200, Jan Stary wrote:
 apmd says:
 
  When the power status changes (battery is connected or disconnected),
  apmd fetches the current status and reports it via syslog(3)
  with logging facility LOG_DAEMON.
 
 Is "battery" really meant here?  Should that be the AC power?
 Batteries are typically not being reconnected while running ...
>> 
>> They certainly can be, either while on external power, or in the case of
>> machines with multiple batteries (several generations of X series ThinkPads
>> have both internal and external batteries, so you can swap without powering
>> down even while on battery power). But yes the common case would be
>> external power.
>> 
 (The manpage calls it "external power", "line current"
 and "AC" interchangably.)
 
Jan
 
>>> 
>>> hi.
>>> 
>>> i think you're right that the text is off. the author possibly meant to
>>> say battery was charging or discharging.
>>> 
>>> anyway, if i don;t hear any reason not to soon, i'll commit your
>>> suggested diff (which i think is simpler and makes sense).
>> 
>> Why be inaccurate when we don't need to be - it's very uncommon to have
>> a machine with a battery with an AC input. "External power" would make
>> more sense.
> 
> I never liked the AC nomenclature either;

Me neither, but I believe this may have originated in the
APM specification which talks about "AC line status” for i.e.
"Get Power Status” function.  Seems like it went from
specification into code (see machine/apmvar.h) and then
into documentation/man page.

> it's battery vs wall socket, not AC vs DC.
> Feel free to change the wording of course.






Re: apmd(8): reconnecting AC, not battery

2022-05-28 Thread Ingo Schwarze
Hi Jason,

Jason McIntyre wrote on Sat, May 28, 2022 at 05:10:08PM +0100:
> On Sat, May 28, 2022 at 10:34:35AM +0100, Stuart Henderson wrote:
>> On 2022/05/28 06:52, Jason McIntyre wrote:
>>> On Fri, May 27, 2022 at 07:19:37PM +0200, Jan Stary wrote:

 apmd says:
 
   When the power status changes (battery is connected or disconnected),
   apmd fetches the current status and reports it via syslog(3)
   with logging facility LOG_DAEMON.
 
 Is "battery" really meant here?  Should that be the AC power?
 Batteries are typically not being reconnected while running ...

>> They certainly can be, either while on external power, or in the case of
>> machines with multiple batteries (several generations of X series ThinkPads
>> have both internal and external batteries, so you can swap without powering
>> down even while on battery power). But yes the common case would be
>> external power.

 (The manpage calls it "external power", "line current"
 and "AC" interchangably.)

>>> i think you're right that the text is off. the author possibly meant to
>>> say battery was charging or discharging.
>>> 
>>> anyway, if i don;t hear any reason not to soon, i'll commit your
>>> suggested diff (which i think is simpler and makes sense).

>> Why be inaccurate when we don't need to be - it's very uncommon to have
>> a machine with a battery with an AC input. "External power" would make
>> more sense.

> i have to say, i don;t understand the distinction. i thought a
> laptop was "a machine with a battery with an AC input" (or, at
> least, *and* an AC input). however i committed a diff with your
> text ("external power") knowing that you are undoubtedly correct ;)

I guess an example for what sthen@ wanted to say is that most laptops
have an external power adapter - for example, the one of the machine
i'm currently typing on has

  INPUT:  100-240V~ 1.3A  50-60Hz
  OUTPUT: 20V=  2.25A

printed on it (transforming AC to DC), so the machine itself
does *not* have an AC input.  Instead, the "external power" the
machine receives is already DC.

Yours,
  Ingo



Re: apmd(8): reconnecting AC, not battery

2022-05-28 Thread Jason McIntyre
On Sat, May 28, 2022 at 10:34:35AM +0100, Stuart Henderson wrote:
> On 2022/05/28 06:52, Jason McIntyre wrote:
> > On Fri, May 27, 2022 at 07:19:37PM +0200, Jan Stary wrote:
> > > apmd says:
> > > 
> > >   When the power status changes (battery is connected or disconnected),
> > >   apmd fetches the current status and reports it via syslog(3)
> > >   with logging facility LOG_DAEMON.
> > > 
> > > Is "battery" really meant here?  Should that be the AC power?
> > > Batteries are typically not being reconnected while running ...
> 
> They certainly can be, either while on external power, or in the case of
> machines with multiple batteries (several generations of X series ThinkPads
> have both internal and external batteries, so you can swap without powering
> down even while on battery power). But yes the common case would be
> external power.
> 
> > > (The manpage calls it "external power", "line current"
> > > and "AC" interchangably.)
> > > 
> > >   Jan
> > > 
> > 
> > hi.
> > 
> > i think you're right that the text is off. the author possibly meant to
> > say battery was charging or discharging.
> > 
> > anyway, if i don;t hear any reason not to soon, i'll commit your
> > suggested diff (which i think is simpler and makes sense).
> 
> Why be inaccurate when we don't need to be - it's very uncommon to have
> a machine with a battery with an AC input. "External power" would make
> more sense.

i have to say, i don;t understand the distinction. i thought a
laptop was "a machine with a battery with an AC input" (or, at
least, *and* an AC input). however i committed a diff with your
text ("external power") knowing that you are undoubtedly correct ;)

jmc



Re: apmd(8): reconnecting AC, not battery

2022-05-28 Thread Jan Stary
On May 28 10:34:35, s...@spacehopper.org wrote:
> On 2022/05/28 06:52, Jason McIntyre wrote:
> > On Fri, May 27, 2022 at 07:19:37PM +0200, Jan Stary wrote:
> > > apmd says:
> > > 
> > >   When the power status changes (battery is connected or disconnected),
> > >   apmd fetches the current status and reports it via syslog(3)
> > >   with logging facility LOG_DAEMON.
> > > 
> > > Is "battery" really meant here?  Should that be the AC power?
> > > Batteries are typically not being reconnected while running ...
> 
> They certainly can be, either while on external power, or in the case of
> machines with multiple batteries (several generations of X series ThinkPads
> have both internal and external batteries, so you can swap without powering
> down even while on battery power). But yes the common case would be
> external power.
> 
> > > (The manpage calls it "external power", "line current"
> > > and "AC" interchangably.)
> > > 
> > >   Jan
> > > 
> > 
> > hi.
> > 
> > i think you're right that the text is off. the author possibly meant to
> > say battery was charging or discharging.
> > 
> > anyway, if i don;t hear any reason not to soon, i'll commit your
> > suggested diff (which i think is simpler and makes sense).
> 
> Why be inaccurate when we don't need to be - it's very uncommon to have
> a machine with a battery with an AC input. "External power" would make
> more sense.

I never liked the AC nomenclature either;
it's battery vs wall socket, not AC vs DC.
Feel free to change the wording of course.

Jan



Re: apmd(8): reconnecting AC, not battery

2022-05-28 Thread Stuart Henderson
On 2022/05/28 06:52, Jason McIntyre wrote:
> On Fri, May 27, 2022 at 07:19:37PM +0200, Jan Stary wrote:
> > apmd says:
> > 
> >   When the power status changes (battery is connected or disconnected),
> >   apmd fetches the current status and reports it via syslog(3)
> >   with logging facility LOG_DAEMON.
> > 
> > Is "battery" really meant here?  Should that be the AC power?
> > Batteries are typically not being reconnected while running ...

They certainly can be, either while on external power, or in the case of
machines with multiple batteries (several generations of X series ThinkPads
have both internal and external batteries, so you can swap without powering
down even while on battery power). But yes the common case would be
external power.

> > (The manpage calls it "external power", "line current"
> > and "AC" interchangably.)
> > 
> > Jan
> > 
> 
> hi.
> 
> i think you're right that the text is off. the author possibly meant to
> say battery was charging or discharging.
> 
> anyway, if i don;t hear any reason not to soon, i'll commit your
> suggested diff (which i think is simpler and makes sense).

Why be inaccurate when we don't need to be - it's very uncommon to have
a machine with a battery with an AC input. "External power" would make
more sense.



Re: apmd(8): reconnecting AC, not battery

2022-05-27 Thread Jason McIntyre
On Fri, May 27, 2022 at 07:19:37PM +0200, Jan Stary wrote:
> apmd says:
> 
>   When the power status changes (battery is connected or disconnected),
>   apmd fetches the current status and reports it via syslog(3)
>   with logging facility LOG_DAEMON.
> 
> Is "battery" really meant here?  Should that be the AC power?
> Batteries are typically not being reconnected while running ...
> 
> (The manpage calls it "external power", "line current"
> and "AC" interchangably.)
> 
>   Jan
> 

hi.

i think you're right that the text is off. the author possibly meant to
say battery was charging or discharging.

anyway, if i don;t hear any reason not to soon, i'll commit your
suggested diff (which i think is simpler and makes sense).

jmc

> 
> 
> Index: apmd.8
> ===
> RCS file: /cvs/src/usr.sbin/apmd/apmd.8,v
> retrieving revision 1.54
> diff -u -p -r1.54 apmd.8
> --- apmd.831 Mar 2022 17:27:29 -  1.54
> +++ apmd.827 May 2022 17:13:52 -
> @@ -58,7 +58,7 @@ When resuming after suspend or standby,
>  runs the appropriate configuration program (if one exists).
>  .Pp
>  When the power status changes
> -(battery is connected or disconnected),
> +(AC is connected or disconnected),
>  .Nm
>  fetches the current status and reports it via
>  .Xr syslog 3
>