PDA

View Full Version : سوال: یه مورد عجیب در cronjob



ahmad24shargh
پنج شنبه 30 آبان 1392, 18:56 عصر
با سلام به همه اساتید خودم

من از 3 اسکریپت ساده bash به صورت cronjob در دانلود شبانه استفاده میکنم.لیست crontab کاربر ریشه در سیستم من :


SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
50 0 * * * /usr/local/bin/keepmyalive.cron
#56 0 * * * /usr/bin/systemctl start ntop.service
53 0 * * * /usr/sbin/ntpdate 1.asia.pool.ntp.org 2.asia.pool.ntp.org 2.fedora.pool.ntp.org && hwclock --systohc
0 1 * * * /usr/local/bin/vnstat.cron
#0 5 */3 * * /usr/local/bin/yum.cron
0 8 * * * /sbin/shutdown -h -P now
57 7 * * * { /usr/bin/killall aria2.cron &>/dev/null; /usr/bin/killall aria2c &>/dev/null; /usr/bin/killall vnstat.cron &>/dev/null; }
#30 2 * * * /home/ahmad/Desktop/fetch/Run.sh
2 1 * * * /usr/local/bin/aria2.cron
#*/30 * * * * /home/ahmad/firefox-sync

اون فایلهایی که با پسوند cron. در لیست crontab میبینید همون اسکریپتهایی هستند که گفتم.
در خروجی دستور ps یکی از اسکریپتها (vnstat.cron) دو بار نشان داده میشود که علت این امر را میخواهم بدانم.خروجی دستور ps aux | grep cron


root 319 0.0 0.0 14456 1340 ? Ss 00:00 0:00 /usr/bin/crond -n
root 2650 0.0 0.0 12036 1816 ? Ss 00:53 0:00 /bin/bash /usr/local/keepmyalive.cron
root 2775 0.0 0.0 11904 1776 ? Ss 01:00 0:00 /usr/bin/bash /usr/local/vnstat.cron
ahmad 2972 0.0 0.0 11772 1508 ? Ss 01:02 0:00 /bin/bash /home/ahmad/bin/aria2.cron
root 3769 0.0 0.0 11904 748 ? S 02:20 0:00 /usr/bin/bash /usr/local/vnstat.cron
ahmad 3788 0.0 0.0 12160 1084 pts/1 S+ 02:21 0:00 grep cron

محتویات اسکریپت فوق الذکر :


#!/bin/bash
current_logged_user="`who | grep -v root | head -n 1 | cut -d " " -f1 | tr -d '\n'`" #${MAIL##*/}
[[ -z "${current_logged_user}" ]] && current_logged_user="$USER"
temp=`cat /etc/passwd 2>/dev/null | grep "$current_logged_user" | head -n 1 2>/dev/null | cut -d ':' -f 6 2>/dev/null | tr -d '\n'`
[ ! -d "$temp" -o ! -w "$temp" ] && { temp=~ ; current_logged_user="$USER"; }
if [ -d "${temp}/Desktop" ];then
work_folder="${temp}/Desktop"
elif [ -d "${temp}/desktop" ];then
work_folder="${temp}/desktop"
else
work_folder="${temp}"
fi
#mydir="$(cd `dirname $0` && pwd)"
#[ ! -d "$mydir" -o ! -w "$mydir" ] && mydir="$work_folder"
SCRIPT_NAME=$(basename $0)
logfile="${work_folder}/${SCRIPT_NAME%%.*}.log"
touch "$logfile" &>/dev/null
if [ ! -w "$logfile" ];then
logfile="${work_folder}/${SCRIPT_NAME%%.*}_$$.log"
touch "$logfile" &>/dev/null
echo | tee -a "$logfile" 2>/dev/null
echo -e "`date +"%A %d %B %Y %R"`\t script started" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t Error : ${work_folder}/${SCRIPT_NAME%%.*}.log No Writable" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t changing log file to '${logfile}' " | tee -a "$logfile"
else
echo | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t script started" | tee -a "$logfile"
fi
chown $current_logged_user "$logfile" &>/dev/null
unset OS_TYPE
OS_TYPE="`grep -Eio "arch |fedora " /etc/issue 2>/dev/null | tr "[:upper:]" "[:lower:]" 2>/dev/null | tr -d ' \n'`"
if [ "x${OS_TYPE}" == "x" ];then
if [[ ! -z "`grep -Eio '\$FreeBSD:' /etc/sysctl.conf`" || ! -z "`grep -Eio '\$FreeBSD:' /etc/defaults/rc.conf`" ]];then
OS_TYPE=freebsd
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: FreeBSD Not implemented yet" | tee -a "$logfile"
exit 1
else
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: OS Type Not Recognized Properly" | tee -a "$logfile"
exit 1
fi
fi
case $OS_TYPE in
"fedora")
rpm -q vnstat &>/dev/null
ERRORCODE=$?;;
"arch")
pacman -Q --noconfirm vnstat &>/dev/null
ERRORCODE=$?;;
*)
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: OS Type '${OS_TYPE} not implemented yet'" | tee -a "$logfile"
exit 1;;
esac
[ $ERRORCODE -ne 0 ] && { echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: vnstat package not installed in `hostname`" | tee -a "$logfile"; exit; }
let bash_ver=${BASH_VERSINFO[0]} &>/dev/null
if [ "${bash_ver}" -lt 4 ];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: Bash Shell Is Old Version And Not Compatible" | tee -a "$logfile"
exit 1
fi
case $OS_TYPE in
"fedora")
rpm -q NetworkManager &>/dev/null
ERRORCODE=$?;;
"arch")
pacman -Q --noconfirm networkmanager &>/dev/null
ERRORCODE=$?;;
*)
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: OS Type '${OS_TYPE} not implemented yet'" | tee -a "$logfile"
exit 1;;
esac
[ $ERRORCODE -ne 0 ] && { echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: NetworkManager package not installed In `uname -n`" | tee -a "$logfile"; exit 4; }
nmcli_bin="`which nmcli 2>/dev/null`"
if [[ -z "${nmcli_bin}" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: Network manager Command Line Interface Not Found In `uname -n`" | tee -a "$logfile"
exit 4
fi
#my_real_connection_type=pppoe #s کانکشن adsl
my_real_connection_type=`${nmcli_bin} -t -f TYPE con 2>/dev/null | grep -Ei "ppp[a-z]*" | head -n 1 | tr -d '\n'`
if [ -z "${my_real_connection_type}" ];then
my_real_connection_type=`${nmcli_bin} -t -f TYPE con 2>/dev/null | grep -Ei "ppp*" | head -n 1 | tr -d '\n'`
fi
my_con_str=`${nmcli_bin} -t -f TYPE dev | head -n 1 | tr -d '\n'`
if [ -z "$my_con_str" ];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: variable 'my_con_str' not set correctly" | tee -a "$logfile"
exit 3
fi
con_uuid=`${nmcli_bin} -t -f TYPE,UUID con | grep "${my_real_connection_type:-${my_con_str}}" | head -n 1 | cut -d ':' -f 2 | tr -d '\n'`
if [ -z "$con_uuid" ];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: variable 'con_uuid' not set correctly" | tee -a "$logfile"
exit 3
fi

function check_vnstat()
{
mainconfexist=true
interfaceconfigured=true
databasedirconfigured=true
databaseexist=true
unitmodeconfigured=true
user_vnstat_exist=true
#vnstat_cron_script="`find /usr/bin /usr/sbin -iname vnstat.cron 2>/dev/null`"
#if [ -z "${vnstat_cron_script}" ];then
# vnstat_cron_script="`find /usr /etc -iname vnstat.cron 2>/dev/null`"
#fi
vnstat_cron_job="`find /etc/cron* -iname "vnstat*" 2>/dev/null`"
#if [ -r "$vnstat_cron_script" ];then
# vnstat_sysconfig="`grep -Ei "VNSTAT_CONF=" "$vnstat_cron_script" 2>/dev/null | cut -d '=' -f 2 2>/dev/null`"
#else
# echo -e "`date +"%A %d %B %Y %R"`\t WARNING: '${vnstat_cron_script}' does not readable by $USER" | tee -a "$logfile"
vnstat_sysconfig="`find "/etc" -iname vnstat 2>/dev/null | grep -v 'cron*'`"
if [ "x${vnstat_sysconfig}" == "x" ];then
[ ! -z "`grep -Eio "if \[" ${vnstat_cron_job} 2>/dev/null`" ] && vnstat_sysconfig=true
fi
#fi
if [ ! -f /etc/vnstat.conf ];then
mainconfexist=false
elif [ -r /etc/vnstat.conf ];then
currentinterface=`grep -m 1 -Ei "Interface " /etc/vnstat.conf | cut -d ' ' -f 2 | tr -d '\n' | tr -d '"'`
temvar=NULL
for i in `ip maddr 2>/dev/null | grep -Ei '^[0-9]+' | cut -f 2 | tr '\n' ' '`;
do
if [[ 'x`grep -Eio "$i" /etc/vnstat.conf 2>/dev/null | tr -d '\n'`' != 'x' ]];then
tempvar=FIND
break;
fi
done
if [[ "${tempvar}" == "NULL" ]];then
interfaceconfigured=false
fi
databasedir="`grep -Ei "DatabaseDir" /etc/vnstat.conf | grep -Eio '/[^"]+' | tr -d '\n' | tr -d '"'`"
if [[ "x${databasedir}" == "x" ]];then
databasedirconfigured=false
else
if [ -r "${databasedir}" ];then
if [[ "x`ls "${databasedir}" 2>/dev/null | grep -oi "${currentinterface}" | tr -d '\n'`" == "x" ]];then
databaseexist=false
else
database_permissions="`ls -lZ "${databasedir}" 2>/dev/null | grep -i "${currentinterface}" | cut -d ' ' -f 1`"
database_owner="`ls -lZ "${databasedir}" 2>/dev/null | grep -i "${currentinterface}" | cut -d ' ' -f 2`"
if [[ ${database_owner} =~ [0-9]+ ]];then
database_owner="`ls -lZ "${databasedir}" 2>/dev/null | grep -i "${currentinterface}" | cut -d ' ' -f 3`"
fi
case ${database_permissions} in
"-rw-r--r--"|"-rw-r--r--."|"-rw-rw-r--"|"-rw-rw-r--.")
database_permissions=true;;
*)
database_permissions=false;;
esac
fi
else
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: '${databasedir}' does not readable by $USER" | tee -a "$logfile"
fi
fi
let unitmode="`grep -Ei "UnitMode " /etc/vnstat.conf | grep -Eio "[0-9]?" | tr -d '\n'`"
if [ ${unitmode} -ne 1 ];then
unitmodeconfigured=false
fi
else
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: main vnstat configuration file(/etc/vnstat.conf) does not readable by $USER" | tee -a "$logfile"
fi
if [[ "x${databasedir}" == "x" ]];then
if [ -d /var/lib/vnstat/ ];then
if [ -r /var/lib/vnstat/ ];then
databasedir=/var/lib/vnstat
if [[ "x`ls /var/lib/vnstat/ 2>/dev/null | grep -oi "${currentinterface}" | tr -d '\n'`" == "x" ]];then
databaseexist=false
else
database_permissions="`ls -lZ "${databasedir}" 2>/dev/null | grep -i "${currentinterface}" | cut -d ' ' -f 1`"
database_owner="`ls -lZ "${databasedir}" 2>/dev/null | grep -i "${currentinterface}" | cut -d ' ' -f 2`"
database_group="`ls -lZ "${databasedir}" 2>/dev/null | grep -i "${currentinterface}" | cut -d ' ' -f 3`"
case ${database_permissions} in
"-rw-r--r--"|"-rw-r--r--."|"-rw-rw-r--"|"-rw-rw-r--.")
database_permissions=true;;
*)
database_permissions=false;;
esac
fi
else
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: '/var/lib/vnstat/' does not readable by $USER" | tee -a "$logfile"
fi
fi
fi
serviceenabled="`systemctl status vnstat 2>/dev/null | grep -Ei "Loaded:" | grep -Eio "enabled" |tr '[:upper:]' '[:lower:]' | tr -d '\n'`"
if [[ "${serviceenabled}" == "enabled" ]];then
serviceenabled=true
else
serviceenabled=false
fi
servicerunning="`systemctl status vnstat 2>/dev/null | grep -Ei "Active:" | grep -Eio "running" |tr '[:upper:]' '[:lower:]' | tr -d '\n'`"
if [[ "${servicerunning}" == "running" ]];then
servicerunning=true
else
servicerunning=false
fi
if [ -r /etc/passwd ];then
if [[ "x`grep -i "vnstat" /etc/passwd 2>/dev/null`" != "x" ]];then
user_vnstat_exist=true;
else
user_vnstat_exist=false
fi
else
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: /etc/passwd does not readable by $USER" | tee -a "$logfile"
fi
if [[ "${mainconfexist}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: main vnstat configuration file(/etc/vnstat.conf) not exist" | tee -a "$logfile"
return 10
fi
if [[ "${databaseexist}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: no any databse exist" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please run vnstat with root privilage and follow instructions" | tee -a "$logfile"
return 11
fi
if [[ "${servicerunning}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: vnstat service not in running state" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please run 'systemctl start vnstat' with root privilage" | tee -a "$logfile"
return 12
fi
if [[ "${databasedirconfigured}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: 'DatabaseDir' not found in vnstat configuration file" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please add 'DatabaseDir \"/var/lib/vnstat\"' to /etc/vnstat.conf with root privilage" | tee -a "$logfile"
return 13
fi
if [[ "${interfaceconfigured}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: 'Interface' not configured correctly in vnstat configuration file" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: current value = '${currentinterface}' please edit /etc/vnstat.conf with root privilage" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: or start this script after establishing your internet connection" | tee -a "$logfile"
return 14
fi
if [[ "${user_vnstat_exist}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: user vnstat dos not exist" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please add this user whit this scheme: vnstat:x:\$UID:\$GID:vnStat user:/var/lib/vnstat:/sbin/nologin" | tee -a "$logfile"
return 15
fi
#if [[ "x${vnstat_cron_script}" == "x" ]];then
# echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: vnstat.cron not found " | tee -a "$logfile"
# echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please reinstall vnstat or correct this script" | tee -a "$logfile"
# return 16
#fi
if [[ "x${vnstat_cron_job}" == "x" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: vnstat daily cron job not found " | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please reinstall vnstat or add this job to /etc/cron.d" | tee -a "$logfile"
return 17
fi
if [[ "x${vnstat_sysconfig}" == "x" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: vnstat system config file not found " | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please reinstall vnstat or correct this script" | tee -a "$logfile"
return 18
fi
if [ "${vnstat_sysconfig}" != "true" ];then
tempvar="`grep -Ei "VNSTAT_OPTIONS=" "${vnstat_sysconfig}" 2>/dev/null`"
for i in `seq 10 -1 1`;
do
interface_sysconfig=`echo -n "${tempvar}" | cut -d ' ' -f $i 2>/dev/null`
if [ ! -z "${interface_sysconfig}" ];then
interface_sysconfig="`echo "${interface_sysconfig}" | tr -d '"'`"
break
fi
done
if [ -z "${interface_sysconfig}" ];then
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: error in parsing ${vnstat_sysconfig} file,network interface not detected" | tee -a "$logfile"
else
if [ ! -z "${currentinterface}" ];then
if [[ "${currentinterface}" != "${interface_sysconfig}" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: network interface in /etc/vnstat.conf and ${vnstat_sysconfig} are different" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: /etc/vnstat.conf = '${currentinterface}' , ${vnstat_sysconfig} = '${interface_sysconfig}' " | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please correct this problem" | tee -a "$logfile"
return 19
fi
fi
fi
fi
tempvar="`grep -Ev "^#.*" "${vnstat_cron_job}" 2>/dev/null | grep -Ei '\* \*' 2>/dev/null`"
if [ -z "${tempvar}" ];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: vnstat cronjob not configured" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please add or uncomment this line to '${vnstat_cron_job}'" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: */5 * * * * vnstat ${vnstat_cron_script}" | tee -a "$logfile"
return 20
fi
#check database permission and ownerships
if [[ "${database_owner}" != "vnstat" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: '${currentinterface}' in '${databasedir}' not owned by vnstat" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please run { cd '${databasedir}' && chown vnstat ${currentinterface}; }" | tee -a "$logfile"
return 21
fi
if [[ "${database_permissions}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: '${currentinterface}' in '${databasedir}' dont have right permissions" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t FATAL ERROR: please run { cd '${databasedir}' && chmod 644 ${currentinterface}; }" | tee -a "$logfile"
return 22
fi
if [[ "${serviceenabled}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: vnstat service not configured to run from boot" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: please run 'systemctl enable vnstat' with root privilage" | tee -a "$logfile"
fi
if [[ "${unitmodeconfigured}" == "false" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: 'UnitMode' must be set to 1" | tee -a "$logfile"
echo -e "`date +"%A %d %B %Y %R"`\t WARNING: please edit /etc/vnstat.conf with root privilage" | tee -a "$logfile"
fi
return 0
}


function func_traping()
{
temp="`date +"%A %d %B %Y %R"`"
let temp_length=${#temp}
printf "%${temp_length}s \t Summary traffic statistics for today :\n" " " | tee -a "$logfile"
if [[ "x$(/usr/bin/vnstat | grep -Ei "today.*|`date +"%D"`" | tr '|' '\n')" == "x" ]];then
printf "%${temp_length}s \t %s\n" " " "traffic not recorded for today ???" | tee -a "$logfile"
else
declare -a traffic
let j=0
for i in $(/usr/bin/vnstat | grep -Ei "today.*|`date +"%D"`" | tr '|' '\n');
do
traffic[$j]="$i"
let j++
done
rx="${traffic[1]} ${traffic[2]}"
tx="${traffic[3]} ${traffic[4]}"
total="${traffic[5]} ${traffic[6]}"
avg_rate="${traffic[7]} ${traffic[8]}"
printf "%${temp_length}s \t %-13s%-13s%-13s%-13s\n" " " "rx" "tx" "total" "avg. rate" | tee -a "$logfile"
printf "%${temp_length}s \t %-13s%-13s%-13s%-13s\n" " " "$rx" "$tx" "$total" "$avg_rate" | tee -a "$logfile"
fi
echo -e "${temp} \t script stoped" | tee -a "$logfile"
echo | tee -a "$logfile"
return
}

trap func_traping EXIT

check_vnstat
ERRORCODE=$?
if [ $ERRORCODE -ne 0 ];then
exit $ERRORCODE
fi

speed="$(/usr/bin/vnstat -tr | grep rx | grep -Eio "[0-9\.]+ k[^/]+/s")"
if [[ "$speed" == "0.00 KB/s" ]];then
export MyVAR=`${nmcli_bin} -t -f TYPE,STATE dev`
if [[ "$MyVAR" != "${my_con_str}:connected" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t ${speed} \t ${MyVAR}" | tee -a "$logfile"
fi
else
echo -e "`date +"%A %d %B %Y %R"`\t ${speed}" | tee -a "$logfile"
fi
while true;
do
speed="$(/usr/bin/vnstat -tr 300 | grep rx | grep -Eio "[0-9\.]+ k[^/]+/s")"
if [[ "$speed" == "0.00 KB/s" ]];then
export MyVAR=`${nmcli_bin} -t -f TYPE,STATE dev`
if [[ "$MyVAR" != "${my_con_str}:connected" ]];then
echo -e "`date +"%A %d %B %Y %R"`\t ${speed} \t ${MyVAR}" | tee -a "$logfile"
continue
fi
fi
echo -e "`date +"%A %d %B %Y %R"`\t ${speed}" | tee -a "$logfile"
done


این اسکریپت رو خودم نوشتم و میدونم چیزی توش نیست که باعث این وضعیت شده باشه.این اسکریپت خروجی خودش رو به یه log فایل میفرسته و هیچ دوگانگی در log فایل دیده نمیشه
البته یه مورد وجود داره اونم اینه که این اسکریپت هر 300 ثانیه (5 دقیقه) یه خروجی ایجاد میکنه و زمان آغاز یکی از ۲ پروسه و PID اون با این خروجی به هنگام میشه

هر کس از ریزه کاریهای پردازشهای لینوکس سر درمیاره لطفا علتش رو بهم بگه.به شدت کنجکاوم