Bit of an odd one, started seeing this in ps, anyone seen something like this before?
10158 root 1076 S sleep 2147483647
Converting that value from seconds to years equals just over 68 years. After killing the process it respawns. Any good way to check what is starting it?
hnyman
January 15, 2021, 5:42am
2
biangbiangmian:
sleep 2147483647
Well, that is 2^31-1
Likely a script had erroneous arguments and ended up with -1, which has then been parsed wrongly.
e.g. something like (MAXLIMT - 1) , and there a typo somewhere, so that MAXLIMIT is defined but not MAXLIMT, so you end up with " -1"
instead of "34-1"
Start with process IDs, and check the parent ID (ppid) of it, so that you find the launching process. (It may not be informative is it is launched from procd)
EDIT:
E.g. "htop" can show processes nicely as tree
PPID PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
0 1 root 20 0 1396 852 680 S 0.0 0.2 0:11.71 /sbin/procd
1 304 ubus 20 0 1040 684 596 S 0.0 0.1 0:01.83 `- /sbin/ubusd
1 305 root 20 0 704 512 476 S 0.0 0.1 0:00.01 `- /sbin/askfirst /usr/libexec/login.sh
1 339 root 20 0 816 568 524 S 0.0 0.1 0:41.07 `- /sbin/urngd
1 989 logd 20 0 1232 864 540 S 0.0 0.2 0:00.41 `- /sbin/logd -S 128
1 1041 root 20 0 2072 1152 836 S 0.0 0.2 0:02.09 `- /sbin/rpcd -s /var/run/ubus/ubus.sock -t 30
1 1231 root 25 5 5160 2180 1472 S 0.0 0.5 0:38.60 `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1243 root 25 5 5160 2180 1472 S 0.0 0.5 0:00.61 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1244 root 25 5 5160 2180 1472 S 0.0 0.5 0:10.92 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1245 root 25 5 5160 2180 1472 S 0.0 0.5 0:01.22 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1246 root 25 5 5160 2180 1472 S 0.0 0.5 0:01.25 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1247 root 25 5 5160 2180 1472 S 0.0 0.5 0:01.18 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1248 root 25 5 5160 2180 1472 S 0.0 0.5 0:01.26 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1249 root 25 5 5160 2180 1472 S 0.0 0.5 0:01.23 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1250 root 25 5 5160 2180 1472 S 0.0 0.5 0:10.39 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1251 root 25 5 5160 2180 1472 S 0.0 0.5 0:10.27 | `- /usr/sbin/collectd -C /tmp/collectd.conf -f
1 1298 root 20 0 888 700 660 S 0.0 0.1 0:00.02 `- /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T
1298 4279 root 20 0 912 708 652 S 0.0 0.1 0:00.21 | `- /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300
4279 4280 root 20 0 1116 904 856 S 0.0 0.2 0:00.01 | `- -ash
4280 4290 root 20 0 1860 1632 860 R 2.0 0.3 0:02.59 | `- htop
1 1439 root 20 0 4480 2772 2480 S 0.0 0.6 5:17.22 `- /usr/sbin/hostapd -s -g /var/run/hostapd/global
1 1440 root 20 0 4384 1972 1772 S 0.0 0.4 0:04.31 `- /usr/sbin/wpa_supplicant -n -s -g /var/run/wpa_supplicant/global
1 1545 root 20 0 1572 936 788 S 0.0 0.2 1:01.83 `- /sbin/netifd
1545 1883 root 20 0 1108 764 728 S 0.0 0.2 0:00.22 | `- udhcpc -p /var/run/udhcpc-eth0.2.pid -s /lib/netifd/dhcp.scri
1545 1922 root 20 0 844 604 552 S 0.0 0.1 0:00.76 | `- odhcp6c -s /lib/netifd/dhcpv6.script -P0 -t120 eth0.2
1 2014 root 20 0 1260 788 660 S 0.0 0.2 0:57.71 `- /usr/sbin/odhcpd
1 2265 root 20 0 1112 772 732 S 0.0 0.2 0:01.70 `- /usr/sbin/crond -f -c /etc/crontabs -l 5
1 3030 dnsmasq 20 0 1340 976 736 S 0.0 0.2 0:41.81 `- /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/
1 3597 root 20 0 4436 3700 2732 S 0.0 0.8 0:02.74 `- /usr/sbin/uhttpd -f -h /www -r router1 -x /cgi-bin -u /ubus -t 6
1 3686 root 39 19 1396 768 652 S 0.0 0.2 3:18.71 `- /usr/sbin/nlbwmon -o /var/lib/nlbwmon -b 524288 -i 24h -r 30s -p
1 4383 root 5 -15 1112 708 668 S 0.0 0.1 0:00.54 `- /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool
Like I said above, as most services are started by procd, it shows up as the parent for most. You might need to test restarting various services to see which triggers a new sleep process.
6 Likes