Strange process

eka

Verified User
Joined
Apr 9, 2015
Messages
22
hello i have a strange process running on my VPS server it takes 100% of a CPU

# pstree -p
init(1) build(4017) build(5142) fold(5144)
tr(5143)

#top -c shows
5143 root 20 0 4100 560 472 R 99.4 0.0 30:27.84 tr -cd a-zA-Z0-9
5144 root 20 0 4084 560 480 S 3.0 0.0 0:55.59 fold -w13

Maybe You guys know something about it?
 
I saw the same today on a customer server after he tryed to update Roundcube to latest version using CB plugin.

I dont know actually if it is related to that, i've just killed those "tr" processes and the server load went fine (and those processess didnt restart).

Did you update something using CB plugin? If yes it may be a CB plugin related process, otherwise i think a further investigation will be needed on my customer server aswell actually.

Regards
 
I killed it too
Restarted server and the process started again
I did try to update roundcube but was fail csf was blocking will try to update it and restart server.
And i am using CB2 plugin made by Martynas

True the process is comming from a CB2 plugin now when i try to update RoundCube.
 
Last edited:
I did update RC on customer server using ssh, i just wrote to Martynas to ask him if the CB plugin is somehow using that command so far.

I also did check crontabs but apparently that command isn't used on crontabs

Regards
 
Issue affected CustomBuild plugin only. It has been fixed in CB 2.0 rev. 1388. Thank you for the report! :)
 
Issue affected CustomBuild plugin only. It has been fixed in CB 2.0 rev. 1388. Thank you for the report! :)
Old post but it reared its head up on my system..

Code:
68681 root          1 103    0    11M  2244K CPU1     1  24.5H  99.82% tr

root@admin:/usr/local/directadmin/custombuild # ps -xa |grep tr
   12  -  WL       14:39.86 [intr]
31505  -  I        27:14.08 /usr/local/mysql/bin/mysqld --defaults-extra-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/l
68681  -  RC     1467:07.21 tr -cd a-zA-Z0-9
97897  -  Is        0:00.01 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-extra-file=/etc/my.cnf --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/
66638  1  S+        0:00.00 grep tr

root@admin:/usr/local/directadmin/custombuild # uname -a
FreeBSD xxx 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC  amd64
 
I am experiencing the same behavior on a FreeBSD 11.3 system


PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
485 root 1 103 0 6296K 2124K CPU1 1 67:33 98.93% tr
167 root 1 102 0 6296K 2124K CPU3 3 24:57 95.39% tr

root@srv2a:/usr/local/directadmin/custombuild # lsof -p 167
lsof: WARNING: compiled for FreeBSD release 11.3-RELEASE-p5; this is 11.3-RELEASE-p3.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tr 167 root cwd VDIR 0,61 3072 324928 /usr/local/directadmin/custombuild
tr 167 root rtd VDIR 0,61 1024 2 /
tr 167 root 0r VCHR 0,4 0x5ebd55000 4 /dev/random
tr 167 root 1u PIPE 0xfffff8000a3ed168 0 ->0xfffff8000a3ed000
tr 167 root 2w VCHR 0,28 0t0 28 /dev/null

root@srv2a:/usr/local/directadmin/custombuild # lsof -p 485
lsof: WARNING: compiled for FreeBSD release 11.3-RELEASE-p5; this is 11.3-RELEASE-p3.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tr 485 root cwd VDIR 0,61 3072 324928 /usr/local/directadmin/custombuild
tr 485 root rtd VDIR 0,61 1024 2 /
tr 485 root 0r VCHR 0,4 0xf242e7000 4 /dev/random
tr 485 root 1u PIPE 0xfffff800a934ed48 0 ->0xfffff800a934ebe0
tr 485 root 2w VCHR 0,28 0t0 28 /dev/null
tr 485 root 3u PIPE 0xfffff801125072f8 16384 ->0xfffff80112507460
tr 485 root 6u PIPE 0xfffff800ea476758 0 ->0xfffff800ea4765f0


edit: i completely removed custombuild and reinstalled it, saving only the options.conf. it seems to have resolved it but i'm going to monitor
 
Does this command work on your system to generate a random password?
Code:
tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c`perl -le 'print int rand(7) + 10'`
 
Does this command work on your system to generate a random password?
Code:
tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c`perl -le 'print int rand(7) + 10'`

doug@srv2a:~/domains % tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c`perl -le 'print int rand(7) + 10'`
Ambiguous output redirect.
 
Try this before:
Code:
sh

Then run the command :)
Woops. Yes, generated a PW.

$ tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c`perl -le 'print int rand(7) + 10'`
U8lpHbWManQUG$
 
Try this before:
Code:
sh

Then run the command :)

The issue appeared recently. When I enter the above command in SH shell, it outputs nothing:

Code:
# tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c`perl -le 'print int rand(7) + 10'`
#

OS: FreeBSD 11.3
 
It's part of ./build

its a function in the script.. I have noticed it as well some times it in a loop just keeps running. There is no control to stop it. I just had to kill it. seem to be random.

Code:
random_pass() {
    #No special characters yet, because they'd cause problems with regexes and PEAR::DB to split the DNS string correctly in roundcube config.inc.php
    if [ "${OS}" = "FreeBSD" ]; then
        RPC=${1:-`perl -le 'print int rand(7) + 10'`}
    else
        RPC=`awk -v min=10 -v max=17 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'`
    fi
    tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c${RPC} # perl generates a random integer between 10 and 16
}

maybe the should be a space in
Code:
head -c ${RPC}
or quotes to prevent globing
Code:
head -c"${RPC}"

@DirectAdmin Support
@smtalk
 
After reboot the "tr" processes disappeared.

How do you kill it? I was trying to kill the "tr" processes, but they reappeared immediately. They were 8 - I guess it's related to number of CPUs.
 
I had to find the parent build process. If I remember correctly. I know I did reboot once. I also did a killall -9. If it happens again i will take notes.
 
Update It happened again it's not the Build script it is letsencrypt.sh


I had to kill the letsencrypt process and the tr process.

One of my server was Running a cert renewal
The issue is in here.

challenge_check() {
if [ ! -d ${WELLKNOWN_PATH} ]; then
mkdir -p ${WELLKNOWN_PATH}
chown webapps:webapps ${HOSTNAME_DIR}/.well-known
chown webapps:webapps ${WELLKNOWN_PATH}
fi
RAND_BITS=`tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c8`
TEMP_FILENAME=letsencrypt_${TIMESTAMP}_${RAND_BITS}
touch ${WELLKNOWN_PATH}/${TEMP_FILENAME}
 
Try this before:
Code:
sh

Then run the command :)
tr -cd 'a-zA-Z0-9' < /dev/urandom 2>/dev/null | head -c`perl -le 'print int rand(7) + 10'`
Ambiguous output redirect.

sh tr -cd 'a-zA-Z0-9' < /dev/urandom 2 > /dev/null | head -c`perl -le 'print int rand(7) + 10'`
Ambiguous output redirect.

# sh
# tr -cd 'a-zA-Z0-9' < /dev/urandom 2 > /dev/null | head -c`perl -le 'print int rand(7) + 10'`
usage: tr [-Ccsu] string1 string2
tr [-Ccu] -d string1
tr [-Ccu] -s string1
tr [-Ccu] -ds string1 string2
 
ps -aux |grep lets
kill -9 pids

ps -aux |grep tr
kill -9 pids
 
Back
Top