g'day all.. in a spot of bother and a starter of ten for someone. I have placed a simple bash shell script into the root of "/etc/profile.d" and without fail, the script executes 3 times within nanoseconds.
To diagnosis this, made a separate bash shell script within "/etc/profile.d" with the following syntax below, and all three email results are identical.
I can reproduce this anomaly on over 15 identical Oracle OEL 8.7 servers.
I would prefer to avoid modifying /etc/profile or /etc/bashrc for all the obvious reasons.
#!/bin/bash
loginctl show-session "$XDG_SESSION_ID" | mailx -r [email protected] -s "This is a development email" "[email protected]"
Results:
Id=54
User=0
Name=root
Timestamp=Thu 2023-01-05 10:26:51 CST
TimestampMonotonic=613980645805
VTNr=0
TTY=pts/0
Remote=yes
RemoteHost=(IP address removed)
Service=sshd
Scope=session-54.scope
Leader=578034
Audit=54
Type=tty
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=1672936187092136
IdleSinceHintMonotonic=614156116099
LockedHint=no
Parenthetical:
[ Oracle Linux Server 8.7 ]
[ Kernel: 5.15.0-5.76.5.1.el8uek.x86_64 ]
I have entertained a species of lock, however these are executed nanoseconds apart...
I would be massively grateful for any clues, suggestions or solutions.
Cheers in advance!