[SOLVED] lxc ps -ef shows wrong date

RobFantini

Famous Member
May 24, 2012
2,042
107
133
Boston,Mass
Code:
# date
Thu Sep 21 09:06:38 EDT 2017

Code:
# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Sep25 ?        00:00:00 init [2]  
daemon     250     1  0 Sep25 ?        00:00:00 /sbin/portmap
root       341     1  0 Sep25 ?        00:00:00 /usr/sbin/rsyslogd -c3
dnsmasq    364     1  0 Sep25 ?        00:00:00 /usr/sbin/dnsmasq -u dnsmasq
105        383     1  0 Sep25 ?        00:00:00 /usr/bin/dbus-daemon --system
root       397     1  0 Sep25 ?        00:00:00 /usr/sbin/nscd
root       409     1  0 Sep25 ?        00:00:00 /usr/sbin/inetd
root       469     1  0 Sep25 ?        00:00:00 /usr/lib/postfix/master
postfix    476   469  0 Sep25 ?        00:00:00 pickup -l -t fifo -u -c
postfix    477   469  0 Sep25 ?        00:00:00 qmgr -l -t fifo -u
root       481     1  0 Sep25 ?        00:00:00 /u/bin/iscollect
root       483   481  0 Sep25 ?        00:00:00 [iscollect] <defunct>
root       489     1  0 Sep25 ?        00:00:00 /usr/sbin/sshd
daemon     519     1  0 Sep25 ?        00:00:00 /usr/sbin/atd
root       526     1  0 Sep25 ?        00:00:00 /usr/sbin/cron
root       549     1  0 Sep25 ?        00:00:00 /usr/local/bin/monit
root       564     1  0 Sep25 tty1     00:00:00 /sbin/getty -L 38400 tty1
root       565     1  0 Sep25 tty2     00:00:00 /sbin/getty -L 38400 tty2
root       569   489  0 Sep25 ?        00:00:00 sshd: root@pts/2
root       571   569  0 Sep25 pts/2    00:00:00 -bash
postfix    597   469  0 Sep25 ?        00:00:00 showq -t unix -u -c
root       600   571  0 Sep25 pts/2    00:00:00 ps -ef

I have 3 debian etch lxc's and they all show wrong dates in ps -ef

making a file time stamp is OK:
Code:
# l> fo
# ls -l fo
-rw-r--r-- 1 root root 96 2017-09-21 09:08 fo


any clues on how to fix this?
 
What is date inside and outside of the container showing?
 
What is the uptime of the container & PVE? Also, does it return to normal after lxc reboot?
 
Code:
sys10  ~ # pct exec 123 uptime
 12:26:41 up  3:55,  0 users,  load average: 0.35, 0.43, 0.52
sys10  ~ # uptime
 12:26:44 up 3 days, 22:31,  1 user,  load average: 0.35, 0.43, 0.52
I'll restart it now..

Code:
pro4bkup  ~ # ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Sep25 ?        00:00:00 init [2] 
root       230     1  0 Sep25 ?        00:00:00 /usr/sbin/ntpdate -s -b 0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.or
daemon     251     1  0 Sep25 ?        00:00:00 /sbin/portmap
root       342     1  0 Sep25 ?        00:00:00 /usr/sbin/rsyslogd -c3
dnsmasq    365     1  0 Sep25 ?        00:00:00 /usr/sbin/dnsmasq -u dnsmasq
105        384     1  0 Sep25 ?        00:00:00 /usr/bin/dbus-daemon --system
root       398     1  0 Sep25 ?        00:00:00 /usr/sbin/nscd
root       410     1  0 Sep25 ?        00:00:00 /usr/sbin/inetd
root       470     1  0 Sep25 ?        00:00:00 /usr/lib/postfix/master
postfix    476   470  0 Sep25 ?        00:00:00 pickup -l -t fifo -u -c
postfix    477   470  0 Sep25 ?        00:00:00 qmgr -l -t fifo -u
root       482     1  0 Sep25 ?        00:00:00 /u/bin/iscollect
root       484   482  0 Sep25 ?        00:00:00 [iscollect] <defunct>
root       490     1  0 Sep25 ?        00:00:00 /usr/sbin/sshd
zabbix     495     1  0 Sep25 ?        00:00:00 /usr/sbin/zabbix_agentd
zabbix     499   495  0 Sep25 ?        00:00:00 /usr/sbin/zabbix_agentd
zabbix     500   495  0 Sep25 ?        00:00:00 /usr/sbin/zabbix_agentd
zabbix     501   495  0 Sep25 ?        00:00:00 /usr/sbin/zabbix_agentd
zabbix     502   495  0 Sep25 ?        00:00:00 /usr/sbin/zabbix_agentd
zabbix     503   495  0 Sep25 ?        00:00:00 /usr/sbin/zabbix_agentd
daemon     533     1  0 Sep25 ?        00:00:00 /usr/sbin/atd
root       540     1  0 Sep25 ?        00:00:00 /usr/sbin/cron
root       563     1  0 Sep25 ?        00:00:00 /usr/local/bin/monit
root       578     1  0 Sep25 tty1     00:00:00 /sbin/getty -L 38400 tty1
root       579     1  0 Sep25 tty2     00:00:00 /sbin/getty -L 38400 tty2
root       583     0  0 Sep25 ?        00:00:00 /bin/bash
root       605   583  0 Sep25 ?        00:00:00 ps -ef
pro4bkup  ~ # uptime
 12:27:50 up 0 min,  0 users,  load average: 0.36, 0.42, 0.51
 
Is your ntpdate running inside the container? A lxc container cannot update the time and it would inherit the time from the host itself. This might influence the ps output in some way.
 
thanks, i noticed the same thing, then uninstalled ntpdate, rebooted. same issue. to be sure i just did a stop and start. date on ps -ef still in future
 
Is 'ps aux' showing the same start time/date? Could you test on a newer debian version, maybe there was/is a bug on etch?
 
we've a few stretch systems, time is OK.

on a jessie system there is an issue , i'll put info at end.

here is ps aux:

Code:
pro4bkup  ~ # ps aux

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1   2008  1352 ?        Ss   Sep25   0:00 init [2]  
daemon     249  0.0  0.0   1748    84 ?        Ss   Sep25   0:00 /sbin/portmap
root       340  0.0  0.1  27796  1984 ?        Sl   Sep25   0:00 /usr/sbin/rsyslogd -c3
dnsmasq    363  0.0  0.1   1972  1456 ?        S    Sep25   0:00 /usr/sbin/dnsmasq -u dnsmasq
105        382  0.0  0.0   5604   376 ?        Ss   Sep25   0:00 /usr/bin/dbus-daemon --system
root       396  0.0  0.2  12088  2972 ?        Ssl  Sep25   0:00 /usr/sbin/nscd
root       408  0.0  0.1   1812  1316 ?        Ss   Sep25   0:00 /usr/sbin/inetd
root       468  0.0  0.2   5224  2736 ?        Ss   Sep25   0:00 /usr/lib/postfix/master
postfix    475  0.0  0.2   5224  2328 ?        S    Sep25   0:00 qmgr -l -t fifo -u
root       480  0.0  0.0   1864   924 ?        S    Sep25   0:00 /u/bin/iscollect
root       482  0.0  0.0      0     0 ?        Z    Sep25   0:00 [iscollect] <defunct>
root       488  0.0  0.2   3752  2416 ?        Ss   Sep25   0:00 /usr/sbin/sshd
zabbix     493  0.0  0.1   4208  1668 ?        SN   Sep25   0:03 /usr/sbin/zabbix_agentd
zabbix     501  0.0  0.1   4208  1612 ?        SN   Sep25   0:00 /usr/sbin/zabbix_agentd
zabbix     502  0.0  0.1   4208  1612 ?        SN   Sep25   0:00 /usr/sbin/zabbix_agentd
zabbix     503  0.0  0.1   4208  1612 ?        SN   Sep25   0:00 /usr/sbin/zabbix_agentd
zabbix     505  0.0  0.1   4208  1612 ?        SN   Sep25   0:00 /usr/sbin/zabbix_agentd
zabbix     507  0.0  0.1   4208  1592 ?        SN   Sep25   0:00 /usr/sbin/zabbix_agentd
daemon     531  0.0  0.0   2108    88 ?        Ss   Sep25   0:00 /usr/sbin/atd
root       538  0.0  0.1   2260  1484 ?        Ss   Sep25   0:00 /usr/sbin/cron
root       561  0.0  0.2  12980  2432 ?        Sl   Sep25   0:00 /usr/local/bin/monit
root       576  0.0  0.1   1636  1140 tty1     Ss+  Sep25   0:00 /sbin/getty -L 38400 tty1
root       577  0.0  0.1   1636  1224 tty2     Ss+  Sep25   0:00 /sbin/getty -L 38400 tty2
root      1653  0.0  0.4   9612  4512 ?        Ss   Sep25   0:00 sshd: root@pts/2
root      1655  0.0  0.2   4144  2836 pts/2    Ss   Sep25   0:00 -bash
root      1683  0.0  0.1   3496  1752 pts/2    R+   Sep25   0:00 ps aux

jessie system that has been up 10 days shows some processes at Jul 26:
Code:
bc-sys1  ~ # w
 14:30:30 up 10 days, 16 min,  2 users,  load average: 0.48, 0.59, 0.53

bc-sys1  ~ # ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  15492  1432 ?        Ss   Jul26   0:06 init [2]  
root      1135  0.0  0.0  24216    20 ?        Ss   Jul26   0:00 /usr/sbin/uuidd
root      1180  0.0  0.0 258672  1636 ?        Ssl  Jul26   0:01 /usr/sbin/rsyslogd
root      1208  0.0  0.0   4256  1372 ?        Ss   Jul26   0:00 /usr/sbin/acpid
shellin+  1226  0.0  0.0  32124  1240 ?        Ss   Jul26   0:00 /usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid -c /var
shellin+  1227  0.0  0.0  32124    24 ?        S    Jul26   0:00 /usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid -c /var
root      1228  0.0  0.0   4240  1288 ?        Ss   Jul26   0:00 /lib/startpar/startpar -f -- shellinabox
blueche+  1317  0.0  3.6 1768828 77032 ?       Sl   Jul26 4608:14 /usr/sbin/bc-server -s -u bluecherry -g bluecherry
root      1374  0.0  0.0   4336  1392 ?        S    Jul26   0:00 /bin/sh /usr/bin/mysqld_safe
stunnel4  1421  0.0  0.0  41484    60 ?        Ss   Jul26   0:00 /usr/bin/stunnel4 /etc/stunnel/stunnel.conf
root      1429  0.0  0.0  55184  1840 ?        Ss   Jul26   0:00 /usr/sbin/sshd
mysql     1943  0.0  7.5 1141620 159224 ?      Sl   Jul26  23:36 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/
root      2180  0.0  0.1  36168  2376 ?        Ss   Jul26   0:02 /usr/lib/postfix/master
postfix   2212  0.0  0.1  38392  2876 ?        S    Jul26   0:01 qmgr -l -t unix -u
root      2224  0.0  0.1 106476  2352 ?        Sl   Jul26   0:45 /usr/bin/monit -c /etc/monit/monitrc
root      2245  0.0  0.0  12664  1640 tty1     Ss+  Jul26   0:00 /sbin/getty --noclear 38400 tty1
root      2246  0.0  0.0  12664  1560 tty2     Ss+  Jul26   0:00 /sbin/getty --noclear 38400 tty2
postfix   7035  0.0  0.1  38232  3504 ?        S    Aug05   0:00 pickup -l -t unix -u -c
www-data  7048  0.0  1.4 376924 30736 ?        SN   Aug05   0:00 /usr/sbin/apache2 -k start
www-data  7050  0.0  1.4 377276 31092 ?        SN   Aug05   0:00 /usr/sbin/apache2 -k start
the host for that lxc has been up 56 days:
Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  57992  7476 ?        Ss   Jul26   3:10 /sbin/init
root         2  0.0  0.0      0     0 ?        S    Jul26   0:01 [kthreadd]
root         4  0.0  0.0      0     0 ?        S<   Jul26   0:00 [kworker/0:0H]
root         6  0.1  0.0      0     0 ?        S    Jul26  94:14 [ksoftirqd/0]
 
I rebooted the pve host, times are OK now:
Code:
pro4bkup  ~ # ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1   2008  1276 ?        Ss   15:32   0:00 init [2]  
daemon     249  0.0  0.0   1748    88 ?        Ss   15:32   0:00 /sbin/portmap
root       340  0.0  0.1  26772  1904 ?        Sl   15:32   0:00 /usr/sbin/rsyslogd -c3
dnsmasq    363  0.0  0.1   1972  1388 ?        S    15:32   0:00 /usr/sbin/dnsmasq -u dnsmasq
105        382  0.0  0.0   5604   372 ?        Ss   15:32   0:00 /usr/bin/dbus-daemon --system
root       396  0.0  0.2  13112  3044 ?        Ssl  15:32   0:00 /usr/sbin/nscd
root       408  0.0  0.1   1812  1368 ?        Ss   15:32   0:00 /usr/sbin/inetd
root       468  0.0  0.2   5224  2696 ?        Ss   15:32   0:00 /usr/lib/postfix/master
postfix    474  0.0  0.2   5188  2440 ?        S    15:32   0:00 pickup -l -t fifo -u -c
postfix    475  0.0  0.2   5224  2380 ?        S    15:32   0:00 qmgr -l -t fifo -u
root       480  0.0  0.0   1864   996 ?        S    15:32   0:00 /u/bin/iscollect
root       482  0.0  0.0      0     0 ?        Z    15:32   0:00 [iscollect] <defunct>
root       488  0.0  0.2   3752  2400 ?        Ss   15:32   0:00 /usr/sbin/sshd
zabbix     493  0.1  0.1   4204  1736 ?        SN   15:32   0:00 /usr/sbin/zabbix_agentd
zabbix     500  0.0  0.1   4204  1620 ?        SN   15:32   0:00 /usr/sbin/zabbix_agentd
zabbix     501  0.0  0.1   4204  1608 ?        SN   15:32   0:00 /usr/sbin/zabbix_agentd
zabbix     503  0.0  0.1   4204  1608 ?        SN   15:32   0:00 /usr/sbin/zabbix_agentd
zabbix     504  0.0  0.1   4204  1620 ?        SN   15:32   0:00 /usr/sbin/zabbix_agentd
zabbix     505  0.0  0.1   4208  1600 ?        SN   15:32   0:00 /usr/sbin/zabbix_agentd
daemon     531  0.0  0.0   2108    80 ?        Ss   15:32   0:00 /usr/sbin/atd
root       538  0.0  0.1   2260  1536 ?        Ss   15:32   0:00 /usr/sbin/cron
root       561  0.0  0.2  12980  2452 ?        Sl   15:32   0:00 /usr/local/bin/monit
root       576  0.0  0.1   1636  1152 tty1     Ss+  15:32   0:00 /sbin/getty -L 38400 tty1
root       577  0.0  0.1   1636  1160 tty2     Ss+  15:32   0:00 /sbin/getty -L 38400 tty2
root       609  0.0  0.4   9744  4400 ?        Rs   15:37   0:00 sshd: root@pts/2
root       611  0.0  0.2   4144  2752 pts/2    Ss   15:37   0:00 -bash
root       636  0.0  0.1   3496  1752 pts/2    R+   15:37   0:00 ps aux
 
so i'll assume this was something to do with the lxc operating system being old. however i think a lot of places use cobol on old operating systems.
we'll just be careful.