Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
CA-407370: Use remote.conf for customer rsyslog forwarding rules
Signed-off-by: Gerald Elder-Vass <[email protected]>
  • Loading branch information
GeraldEV committed Mar 6, 2025
commit 468eb75dddfea6db512a8bfb4860ff2042efab66
28 changes: 4 additions & 24 deletions scripts/xe-syslog-reconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,12 @@ do
shift
done

if [ -r /etc/syslog.conf ]; then
conf_file=/etc/syslog.conf
service=syslog
fi

if [ -r /etc/rsyslog.conf ]; then
conf_file=/etc/rsyslog.conf
service=rsyslog
fi

if [ -r /etc/rsyslog.d/xenserver.conf ]; then
conf_file=/etc/rsyslog.d/xenserver.conf
service=rsyslog
fi

if [ -z "$service" ]; then
echo "Error: unable to determine syslog service" >&2
exit 1
fi

sed -e '/^\*\.\*.*[@~]/ d' $conf_file >/etc/syslog.$$
if [ $remote -eq 1 ]; then
echo -e "*.* @$host\n*.* ~" >>/etc/syslog.$$
echo "# /etc/rsyslog.d/remote.conf is auto-generated by xe-syslog-reconfigure" > /etc/rsyslog.d/remote.conf
echo "*.* @$host" >> /etc/rsyslog.d/remote.conf
else
echo "*.* ~" >>/etc/syslog.$$
rm -f /etc/rsyslog.d/remote.conf
fi

[ -s /etc/syslog.$$ ] && mv -f /etc/syslog.$$ $conf_file
systemctl restart $service
systemctl restart rsyslog
Loading