test.shをcrontab設定で起動して各プロセスを見ると以下のようになります。
①自宅CentOS環境
-bash-4.2$ ps aux | grep test.sh
root 100527 0.0 0.0 113172 1196 ? Ss 17:56 0:00 /bin/sh /root/test.sh
root 100528 0.0 0.0 113172 692 ? S 17:56 0:00 /bin/sh /root/test.sh
root 100617 0.0 0.0 112720 988 pts/1 R+ 17:56 0:00 grep --color=auto test.sh
②業務Redhat環境(crontab起動したプロセスに-cがついて、3番目のプロセスが1つ増えている)
-bash-4.2$ ps aux | grep test.sh
root 100527 0.0 0.0 113172 1196 ? Ss 17:56 0:00 /bin/sh -c /root/test.sh
root 100528 0.0 0.0 113172 692 ? S 17:56 0:00 /bin/sh /root/test.sh
root 100529 0.0 0.0 113172 693 ? S 17:56 0:00 /bin/sh /root/test.sh
root 100617 0.0 0.0 112720 988 pts/1 R+ 17:56 0:00 grep --color=auto test.sh
①と②で違いが生じる原因を見つけたいです。
どこを調べたらいいでしょうか。
test.shは以下のようにsleepしながら
ループしているものです。
SLEEP_SEC=5
LOOP_MAX=1000
COUNT=0
(
while [[ $COUNT -lt $LOOP_MAX ]]
do
sleep $SLEEP_SEC
COUNT=expr $COUNT +1
done)
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/05/26 12:34 編集