Skip to content

Commit

Permalink
Merge pull request #82 from SW-CSA/cel_develop
Browse files Browse the repository at this point in the history
Cel develop
  • Loading branch information
MickeyZhan authored Jul 19, 2019
2 parents 2e8e360 + a50556e commit b7e914e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
#
exec /usr/local/bin/mTerm_server as58xx-cl /dev/ttyS1
exec /usr/local/bin/mTerm_server console /dev/ttyS1
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ bufStore* createBuffer(const char *dev, int fsize) {
}

int ret;
ret = snprintf(buf->file, sizeof(buf->file), "/var/log/mTerm_%s.log", dev);
ret = snprintf(buf->file, sizeof(buf->file), "/var/log/%s.log", dev);
if ((ret < 0) || (ret >= sizeof(buf->file))) {
perror("mTerm: Received dev name too long to create buffer file");
free(buf);
return NULL;
}

ret = snprintf(buf->backupfile, sizeof(buf->backupfile),
"/var/log/mTerm_%s_backup.log", dev);
"/var/log/%s_backup.log", dev);
if ((ret < 0) || (ret >= sizeof(buf->backupfile))) {
perror("mTerm: Received dev name too long to create backup buffer file");
free(buf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ start_sol_session() {

if mTerm_server_running; then
sol_ctrl BMC
exec /usr/local/bin/mTerm_client as58xx-cl
exec /usr/local/bin/mTerm_client console
else
start_sol_session
fi
7 changes: 7 additions & 0 deletions meta-celestica/recipes-extended/rsyslog/files/logrotate.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp and btmp -- we'll rotate them here


6 changes: 3 additions & 3 deletions meta-celestica/recipes-extended/rsyslog/files/rsyslog.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $PreserveFQDN on
$ActionQueueType Direct

input(type="imfile"
File="/var/log/mTerm_as58xx-cl.log"
File="/var/log/console.log"
Tag="console"
Severity="info"
Facility="local3"
Expand All @@ -47,7 +47,7 @@ else if $syslogfacility-text == 'local3' then

# Send local3 log messages to the /var/log/console.log
# limit size to 20M
$outchannel consolefile_channel, /var/log/console.log, 20480000, /usr/local/fbpackages/rotate/console_log
$outchannel consolefile_channel, /var/log/console_syslog.log, 20480000, /usr/local/fbpackages/rotate/console_log
local3.* :omfile:$consolefile_channel;

else /var/log/bmc_debug.log;LogUtilFileFormat
Expand All @@ -70,7 +70,7 @@ $RepeatedMsgReduction on
# give up after 10 attempts while retrying every second (20 second timeout).
# Also keep it at the end if we need to just amend the server name using cfg-util.
template (name="ForwardFormatInContainer" type="string" string="<%PRI%>%TIMESTAMP:::date-rfc3339% %HOSTNAME% bmc#%syslogtag%%msg:::sp-if-no-1st-sp%%msg%")
*.info;local3.none action(type="omfwd" target="240.1.1.2" port="514" template="ForwardFormatInContainer" protocol="udp"
*.info action(type="omfwd" target="240.1.1.2" port="514" template="ForwardFormatInContainer" protocol="udp"
queue.type="LinkedList" action.resumeRetryCount="1" action.resumeInterval="60"
queue.size="100" queue.workerthreadminimummessages="101" queue.discardseverity="0"
queue.timeoutenqueue="0" queue.timeoutshutdown="10" queue.timeoutactioncompletion="100"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@
delaycompress
compress
postrotate
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || /etc/init.d/syslog.rsyslog restart 2> /dev/null
endscript
}

/var/log/console.log
/var/log/console_syslog.log
{
rotate 9
missingok
notifempty
size 20M
delaycompress
compress
postrotate
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || /etc/init.d/syslog.rsyslog restart 2> /dev/null
endscript
}
2 changes: 2 additions & 0 deletions meta-celestica/recipes-extended/rsyslog/rsyslog_%.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://rsyslog.conf \
file://rsyslog.logrotate \
file://rotate_console_log \
file://logrotate.conf \
"

do_install_append() {
Expand All @@ -11,6 +12,7 @@ do_install_append() {
install -m 644 ${WORKDIR}/rsyslog.conf ${D}${sysconfdir}/rsyslog.conf
install -m 644 ${WORKDIR}/rsyslog.logrotate ${D}${sysconfdir}/logrotate.rsyslog
install -m 755 ${WORKDIR}/rotate_console_log ${dst}/console_log
install -m 644 ${WORKDIR}/logrotate.conf ${D}${sysconfdir}/logrotate.conf

sed -i "s/__PLATFORM_NAME__/${MACHINE}/g;s/__OPENBMC_VERSION__/${OPENBMC_VERSION}/g" ${D}${sysconfdir}/rsyslog.conf
}
Expand Down

0 comments on commit b7e914e

Please sign in to comment.