What's upsutil and why has it zombied sh 1020 times?

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.
Post Reply
wkearney99
Know my way around
Posts: 157
Joined: Sat Jul 11, 2015 5:49 am
Location: Bethesda, MD USA

What's upsutil and why has it zombied sh 1020 times?

Post by wkearney99 »

Anytime I purchase a new box I make it a habit to keep tabs on what it's doing 'behind the scenes'. Initial setup often includes trying a lot of new things that might not be useful long-term. Installing them, starting, stopping, removing... it doesn't always go smoothly. Thus it's useful to run something like ps.

I was rather surprised to find quite a few zombied sh processes. I was likewise surprised to find out the built-in ps command (part of busybox) isn't very robust. <sigh> Well, it's aiming to be an 'appliance' and that comes with a variety of issues that most folks won't care about it. I'm fine with that, at least the vendor isn't going out of their way to cripple it and prevent users from getting in there at all (aka Apple).

Ok, so after getting Optware installed and wrangling which packages to load (procps, procps-ps and psmisc) I had some usable tools. I'll say this, things are smoother since the starting days of WRT hacking.

/Apps/opt/bin/ps -aufx got me a useful list of processes, letting me see that upsutil was the parent of the defunct zombied processes.

Code: Select all

admin     5683  0.0  0.0   8772  1628 ?        S    Aug08   0:00 /usr/sbin/upsutil
admin    19990  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    20132  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    21062  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    21361  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    21650  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    22118  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    25366  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    25656  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    26105  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    26400  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    26714  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    27166  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
admin    30704  0.0  0.0      0     0 ?        Z    Aug12   0:00  \_ [sh] <defunct>
(for a total of 1020 zombies)
A quick search through /etc/init.d/* revealed that's part several services scripts, but largely something to do with UPS and USB.

Code: Select all

[~] # grep upsutil /etc/init.d/*
/etc/init.d/init_check.sh:    #[ -f /usr/sbin/upsutil ] && /sbin/daemon_mgr upsutil start "/usr/sbin/upsutil &"
/etc/init.d/snmp_ups.sh:                /bin/kill -USR1 `/sbin/pidof upsutil` 2>/dev/null
/etc/init.d/snmp_ups.sh:        /bin/kill -USR2 `/sbin/pidof upsutil` 2>/dev/null
/etc/init.d/ups.sh:     UPSUTIL_OPT=`/sbin/getcfg UPS upsutil_opt -d ""`
/etc/init.d/ups.sh:     [ -f /usr/sbin/upsutil ] && /sbin/daemon_mgr upsutil start "/usr/sbin/upsutil $UPSUTIL_OPT &"
/etc/init.d/ups.sh:             /usr/bin/killall -USR1 upsutil >/dev/null 2>&1
/etc/init.d/ups.sh:             /usr/bin/killall -USR1 upsutil >/dev/null 2>&1
/etc/init.d/usb_ups.sh: UPSUTIL_PID=`/sbin/pidof upsutil`
/etc/init.d/usb_ups.sh:         /sbin/daemon_mgr upsutil start "/usr/sbin/upsutil &"
/etc/init.d/usb_ups.sh:                 /bin/kill -USR1 `/sbin/pidof upsutil` 2>/dev/null
/etc/init.d/usb_ups.sh:         /bin/kill -USR1 `/sbin/pidof upsutil` 2>/dev/null
/etc/init.d/usb_ups.sh:                 [ $DAEMON_TYPE = "3" ] && /bin/kill -USR1 `/sbin/pidof upsutil` 2>/dev/null
/etc/init.d/usb_ups.sh:         /bin/kill -USR1 `/sbin/pidof upsutil` 2>/dev/null
/etc/init.d/usb_ups.sh: /bin/kill -USR2 `/sbin/pidof upsutil` 2>/dev/null
Now, knowing how UPS integration can be delicate, I decided it's probably best not to muck directly with the processes and scripts involved. Better to reboot the box and see if the problem persists. But I've got a ton of files copying up to it at the moment. I'll have to reboot it later.

Meanwhile, has anyone else run into any trouble with upsutil spawning a lot of zombie sh processes?

I don't suppose I'd have gone in there this soon were it not for usbkernel problems trying to use openremote with the recommended z-wave stick. Anyway, that's an issue for another thread.
--Bill

TVS-671 G3250 (for now)
User avatar
schumaku
Guru
Posts: 43578
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: What's upsutil and why has it zombied sh 1020 times?

Post by schumaku »

Your NAS is still on the current stable 4.1.4... fixed in the QTS 4.2.0 builds since March 27th.
wkearney99
Know my way around
Posts: 157
Joined: Sat Jul 11, 2015 5:49 am
Location: Bethesda, MD USA

Re: What's upsutil and why has it zombied sh 1020 times?

Post by wkearney99 »

Apparently this has been resolved with firmware 4.2, which I'm running now. Seems good, thus far.
--Bill

TVS-671 G3250 (for now)
Post Reply

Return to “Miscellaneous”