0

We have some scripts that run to detect long running processes. It works using ps and etime

e.g

ps -eo uid,pid,etime

This part works fine except that occasionally we get an etime back with an invalid format

2000 20453 1158050441-07:00:15 sh

All of the processes this happens to are short lived so I haven't caught one to investigate.

I'm very interested to why the format is coming out like this and why that epoch.

In case it helps, its a Debian Linux system running a 2.6 kernel.

Ryaner
  • 3,097
  • 5
  • 25
  • 33
  • Does this : ps -eo uid,pid,etimes - (etimes - Elapsed time in second) return the same value than your wrong format etime ? – NooJ Jul 03 '14 at 14:07
  • etimes isn't supported by ps on this host. Its old and due to be upgraded. I'll add that any time the invalid format comes back, 1158050441-07:00 is constant. Its only the seconds that change. – Ryaner Jul 03 '14 at 15:24
  • Do you perhaps have `ntpdate` running on a cron? Or some bad NTP servers set? I'd suspect something is screwing with the machine's time in a way that's confusing ps. – devicenull Jul 04 '14 at 02:14
  • NTP doesn't run through cron but adding some other traps around the commands points to time being the issue. The commands all have just started or died when we catch them like this. – Ryaner Jul 07 '14 at 11:17

0 Answers0