[Bug 535583] Re: Excessive logging by apcsmart program

Lupe Christoph lupe at lupe-christoph.de
Sat Feb 12 23:59:42 UTC 2011


Of course after a reboot, I forgot to stop nut and start apcsmart
with debugging. :-( So when the problem reoccurred, I didn't get the
debug output.

But I ran strace of the apcsmart process, you might be able to
use that instead.

write(4, "Y", 1)                        = -1 EIO (Input/output error)
sendto(3, "<27>Feb 13 00:18:03 apcsmart[321"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
select(7, [4 5 6], NULL, NULL, {1, 999837}) = 1 (in [4], left {1, 999835})
write(4, "Y", 1)                        = -1 EIO (Input/output error)
sendto(3, "<27>Feb 13 00:18:03 apcsmart[321"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
select(7, [4 5 6], NULL, NULL, {1, 999839}) = 1 (in [4], left {1, 999837})
write(4, "Y", 1)                        = -1 EIO (Input/output error)
sendto(3, "<27>Feb 13 00:18:03 apcsmart[321"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
select(7, [4 5 6], NULL, NULL, {1, 999818}) = 1 (in [4], left {1, 999816})
write(4, "Y", 1)                        = -1 EIO (Input/output error)
sendto(3, "<27>Feb 13 00:18:03 apcsmart[321"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
select(7, [4 5 6], NULL, NULL, {1, 999757}) = 1 (in [4], left {1, 999755})
write(4, "Y", 1)                        = -1 EIO (Input/output error)
sendto(3, "<27>Feb 13 00:18:03 apcsmart[321"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
select(7, [4 5 6], NULL, NULL, {1, 999838}) = 1 (in [4], left {1, 999836})
write(4, "Y", 1)                        = -1 EIO (Input/output error)
sendto(3, "<27>Feb 13 00:18:03 apcsmart[321"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
select(7, [4 5 6], NULL, NULL, {1, 999845}) = 1 (in [4], left {1, 999843})
write(4, "Y", 1)                        = -1 EIO (Input/output error)
sendto(3, "<27>Feb 13 00:18:03 apcsmart[321"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
select(7, [4 5 6], NULL, NULL, {1, 999845}) = 1 (in [4], left {1, 999843})

I have no idea why there is an IO error on the serial port. When I
restart apcsmart, it works OK. But it does not seem to handle the
EIO, it just goes on and on looking for input on /dev/ttyS2 and
/var/run/nut/apcsmart-ups (on two FDs), but then ignores the input
available on /dev/ttyS2.

The 'Y' command tells the UPS to enter smart mode. I can imagine this
is the normal mode of operation, and apcsmart has been thrown off track
and tries to re-engage, but the code that is supposed to do this is
faulty. Or maybe the UPS has dropped the connection. When I unplug the
cable, the trace is similar but different:

write(4, "C", 1)                        = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 891541})
read(4, "045.9\r\n", 64)                = 7
write(4, "P", 1)                        = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 892849})
read(4, "017.6\r\n", 64)                = 7
write(4, "X", 1)                        = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 957850})
read(4, "N", 64)                        = 1

Cable is now unplugged.

select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
sendto(3, "<28>Feb 13 00:42:05 apcsmart[249"..., 73, MSG_NOSIGNAL, NULL, 0) = 73
write(6, "DATASTALE\n", 10)             = 10
select(7, [4 5 6], NULL, NULL, {0, 0})  = 1 (in [6], left {0, 0})
read(6, "PING\n", 512)                  = 5
write(6, "PONG\n", 5)                   = 5
write(4, "Y", 1)                        = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, 0x7fff2890ea60)       = 0
write(4, "\33", 1)                      = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
write(4, "Y", 1)                        = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, 0x7fff2890ea60)       = 0
write(4, "\33", 1)                      = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
write(4, "Y", 1)                        = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, 0x7fff2890ea60)       = 0
write(4, "\33", 1)                      = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
write(4, "Y", 1)                        = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, 0x7fff2890ea60)       = 0
write(4, "\33", 1)                      = 1
nanosleep({0, 0}, NULL)                 = 0
select(5, [4], NULL, NULL, {3, 0})      = 0 (Timeout)

HTH,
Lupe Christoph

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nut in ubuntu.
https://bugs.launchpad.net/bugs/535583

Title:
  Excessive logging by apcsmart program



More information about the Ubuntu-server-bugs mailing list