Below is the top output that shows memory utilization for usermod at 95.3%. How is that possible on a box with 1Gig of RAM and 2Gig of swap? I've seen CPU% hit and stay at 90+% for quite a while on useradd and usermod.
The script (1400 lines long) is processing each line at an incredibly slow pace, so I believe what top is reporting, but can't fathom how this is possible.
Ideas anyone?
top - 16:51:00 up 23:51, 3 users, load average: 2.17, 1.96, 1.86 Tasks: 56 total, 1 running, 55 sleeping, 0 stopped, 0 zombie Cpu(s): 1.3% us, 5.0% sy, 0.0% ni, 0.0% id, 93.4% wa, 0.3% hi, 0.0% si Mem: 1035980k total, 1029772k used, 6208k free, 1084k buffers Swap: 2032212k total, 1021100k used, 1011112k free, 3556k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5755 root 18 0 1401m 964m 308 D 3.3 95.3 0:18.65 usermod 177 root 15 0 0 0 0 S 2.3 0.0 1:32.82 kswapd0
If anyone's interested, here's a typical sample of the script for 1 user:
#### vickie
if ! userexists vickie; then
if ! gidexists 542 vickie; then
if ! groupadd -g 542 vickie; then
echo groupadd for 542 vickie failed.
exit 1
fi
fi
if gidexists 542 vickie; then
if ! /usr/sbin/useradd -u 541 -g 542 -d /home/vickie -s /bin/bash -c 'vickie moreland ' vickie; then
echo useradd for user 541 vickie failed.
exit 1
fi
else
echo useradd for 541 vickie not attempted due to gid non existence.
exit 1
fi
else
echo LoginID vickie already exists on this box. Skipping this user.
fi
if ! /usr/sbin/usermod -G sambashare,vickie vickie; then
echo usermod -G sambashare,vickie vickie failed.
exit 1
fi
if ! /usr/sbin/usermod -p '$1$Hs.U04hM$mCGAFBZt3mtALN46hiyU91' vickie; then
echo usermod -p for vickie failed.
exit 1
fi
-- Bill Gradwohl bill@xxxxxxx http://www.ycc.com spamSTOMPER Protected email