1

It is crazy when you just entered a command example sudo or su or even ps. It will flood your /var/log/messages. Please see duplicate entries except for the pid. At 1 specific time. I just type sudo su - and below is the flood. I just enter the command sudo and if you can see the /var/log/messages it is flooding with different PID. it should have at least 1 entry not multiple. My other box is just 1 entry. Thanks

[user1@SERVER1:~]$ cat /var/log/messages
Jan 13 17:09:05 SERVER1 bash[727]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[731]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[735]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[739]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[745]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[753]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[757]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[761]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[765]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[769]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[773]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[783]: user1 as root:
Jan 13 17:09:05 SERVER1 bash[787]: user1 as root:

Prompts are

[root@NEWSERVER:~]# echo "$PROMPT_COMMAND"
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"

[root@NEWSERVER:~]# echo "$PS1"
\[\][\u@\h:\w]# \[\]
[root@NEWSERVER:~]#

JUST NOW:

[newuser@NEWSERVER:~]$ sudo su -
[root@NEWSERVER:~]#

[root@NEWSERVER:~]# tail -f /var/log/messages
Jan 16 15:29:31 NEWSERVER bash[66067]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66071]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66075]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66079]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66085]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66089]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66093]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66097]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66101]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66105]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66109]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66113]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66123]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66127]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66131]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66135]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66141]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66145]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66149]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66153]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66163]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66167]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66171]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66175]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66181]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66185]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66189]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66193]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66197]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66201]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66205]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66209]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66213]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66223]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66227]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66231]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66235]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66239]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66243]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66247]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66251]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66255]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66259]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66263]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66269]: newuser as root:
Jan 16 15:29:31 NEWSERVER bash[66273]: newuser as root:

The output of trap is

trap -- 'log2syslog' DEBUG

closed as unclear what you're asking by G-Man, Kusalananda, GAD3R, user34720, don_crissti Jan 13 '17 at 20:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Don't use sudo su. You probably want either sudo -i ... or just plain sudo -s – roaima Jan 13 '17 at 20:52
  • Hi it is not about the sudo command. But everytime i type a command, it added entries in /var/log/messages. I have another machine where is jut log 1 line. Not multiple lines or entries – invinzin21 Jan 13 '17 at 21:20
  • What is the output of echo "$PROMPT_COMMAND" and echo "$PS1" please? (Add these to your question.) – roaima Jan 13 '17 at 21:27
  • Yes from 1 command and it logs multiple entries with diffrent PID at single time :) printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" and echo [\u@\h:\w]$ – invinzin21 Jan 13 '17 at 21:35
  • I just tried sudo -i and below is the output wc -l aa 47 aa... " echo "$PROMPT_COMMAND" and echo "$PS1" printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" and echo [\u@\h:\w]$ " – invinzin21 Jan 13 '17 at 21:38

Browse other questions tagged or ask your own question.