Skip to content

[System logs]: Fix logrotate bugs#535

Merged
jleveque merged 3 commits intosonic-net:masterfrom
jleveque:syslog_fixes
Apr 25, 2017
Merged

[System logs]: Fix logrotate bugs#535
jleveque merged 3 commits intosonic-net:masterfrom
jleveque:syslog_fixes

Conversation

@jleveque
Copy link
Contributor

  • rsyslog logs were being rotated regardless of whether they exceeded their maixmum size. This was due to "-f" flag passed to logrotate in cron job.

  • After rotation, /var/log/syslog was never written to again. Instead, logs were written to /var/log/syslog.1. This was due to rsyslog not properly closing the file descriptor to the pre-rotated log.

  • Also addresses issue systemd-journald[224]: [/etc/systemd/journald.conf:21] Failed to parse size value, ignoring:  #528

  • Also brought back time-related rotation via the new(er) maxsize option, which performs a boolean OR operation. If the log exceeds the maxsize OR the log hasn't been rotated in the specified, it will be rotated. Using the older size option, the time-based rotation was ignored.

@jleveque jleveque self-assigned this Apr 24, 2017
@jleveque jleveque requested review from lguohan and stcheng April 24, 2017 19:42
delaycompress
sharedscripts
postrotate
invoke-rc.d rsyslog rotate > /dev/null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvoke-rc.d rsyslog rotate > /dev/null [](start = 9, length = 37)

in /etc/init.d/rsyslog, rotate is doing the kill HUP. why not use invoke-rc.d rsyslog rotate?

Copy link
Contributor Author

@jleveque jleveque Apr 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not working properly. It was confirmed as a bug present in our version of init-system-helpers: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672218.

There seem to be two workarounds:

  1. service rsyslog rotate >/dev/null 2>&1 || true
  2. kill -HUP $(cat /var/run/rsyslogd.pid)

I have tested the latter solution. I did not try the former, as the || true seems a bit hacky. I can test it if you'd like.

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as comments

Copy link
Contributor

@NStetskovych-zz NStetskovych-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/etc/init.d/rsyslog rotate > /dev/null
was solved this problem to me some time ago, not sure about now.

@jleveque jleveque merged commit f28790c into sonic-net:master Apr 25, 2017
@jleveque jleveque deleted the syslog_fixes branch April 25, 2017 00:55
lguohan pushed a commit that referenced this pull request Jul 31, 2019
* src/sonic-utilities ee56d54...cb0e745 (11):
  > sonic_utilities: Support for DOM Threshold values for EEPROM dump
(#545)
  > [portstat] Fix portstat show RX_UTIL over 100% for 100G (#563)
  > sonic_installer: fix read-only filesystem support for firmware
update (#565)
  > Revert "show acl table command output should show binding column
correctly even with single port (#447)" (#589)
  > show acl table command output should show binding column correctly
even with single port (#447)
  > [config] Do no stop or restart dependent services (#582)
  > sfpshow: prevent 'show int trans eeprom --dom' from crashing (#567)
  > [warm-reboot] add docker upgrade --warm option and roll back support
(#559)
  > [ecnconfig] Validate input WRED parameters (#579)
  > [sonic-utilities] Add fstrim to reboot (#535)
  > Fixing the expected neighbor command due to change in output format
under sonic-buildimage/pull/3036 (#584)
Kalimuthu-Velappan pushed a commit to Kalimuthu-Velappan/sonic-buildimage that referenced this pull request Sep 12, 2019
Signed-off-by: Harish Venkatraman <harish_venkatraman@dell.com>
lguohan added a commit to lguohan/sonic-buildimage that referenced this pull request Nov 22, 2019
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (sonic-net#535) [Kamil Cudnik]

Signed-off-by: Guohan Lu <gulv@microsoft.com>
lguohan added a commit that referenced this pull request Nov 22, 2019
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (#535) [Kamil Cudnik]

Signed-off-by: Guohan Lu <gulv@microsoft.com>
zhenggen-xu pushed a commit to zhenggen-xu/sonic-buildimage that referenced this pull request Jan 10, 2020
* 5337490 2019-11-22 | Send port status notification when creating hostif interface (sonic-net#535) [Kamil Cudnik]

Signed-off-by: Guohan Lu <gulv@microsoft.com>
madhanmellanox pushed a commit to madhanmellanox/sonic-buildimage that referenced this pull request Mar 23, 2020
* Pospone QueueMap initialization until activation of counters

* Generate queue maps only for front panel ports

* Create empty buffer lists by default
dmytroxshevchuk pushed a commit to dmytroxshevchuk/sonic-buildimage that referenced this pull request Aug 31, 2020
TACappleman added a commit to Metaswitch/sonic-buildimage that referenced this pull request Oct 27, 2021
[schema] Add EXP to TC map config table (sonic-net#537)
[CI]: Swap the python code coverage report with the cpp report (sonic-net#544)
Remove SWIG generated files from coverage report (sonic-net#542)
Update database defintions for PINs / P4Runtime (sonic-net#536)
[ci]: Support code coverage (sonic-net#539)
Fix the option missing in kernel config issue (sonic-net#541)
Add SRV6 APP tables (sonic-net#538)
[schema] Rename CBF config tables (sonic-net#535)
lguohan pushed a commit that referenced this pull request Oct 28, 2021
[schema] Add EXP to TC map config table (#537)
[CI]: Swap the python code coverage report with the cpp report (#544)
Remove SWIG generated files from coverage report (#542)
Update database defintions for PINs / P4Runtime (#536)
[ci]: Support code coverage (#539)
Fix the option missing in kernel config issue (#541)
Add SRV6 APP tables (#538)
[schema] Rename CBF config tables (#535)
mssonicbld added a commit that referenced this pull request Nov 28, 2024
…D automatically (#20957)

#### Why I did it
src/sonic-platform-daemons
```
* 57f0448 - (HEAD -> master, origin/master, origin/HEAD) [lag_id] Add lagid to free_list when LC absent for 30 minutes (#542) (9 hours ago) [Marty Y. Lok]
* 3624cb7 - [stormond] Added new dynamic field 'last_sync_time' to STATE_DB (#535) (21 hours ago) [Ashwin Srinivasan]
* 0431fa3 - Addition of DPU Chassis for thermalctld (#564) (24 hours ago) [Gagan Punathil Ellath]
```
#### How I did it
#### How to verify it
#### Description for the changelog
VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
…D automatically (sonic-net#20957)

#### Why I did it
src/sonic-platform-daemons
```
* 57f0448 - (HEAD -> master, origin/master, origin/HEAD) [lag_id] Add lagid to free_list when LC absent for 30 minutes (sonic-net#542) (9 hours ago) [Marty Y. Lok]
* 3624cb7 - [stormond] Added new dynamic field 'last_sync_time' to STATE_DB (sonic-net#535) (21 hours ago) [Ashwin Srinivasan]
* 0431fa3 - Addition of DPU Chassis for thermalctld (sonic-net#564) (24 hours ago) [Gagan Punathil Ellath]
```
#### How I did it
#### How to verify it
#### Description for the changelog
stepanblyschak pushed a commit to stepanblyschak/sonic-buildimage that referenced this pull request Jan 27, 2025
…1070

[action] [PR:21070] [sonic-mgmt-docker-image] Support ptf dataplane packet poll with multiple ptf nn agents connection
jianyuewu pushed a commit to jianyuewu/sonic-buildimage that referenced this pull request May 7, 2025
…et#535)

<!-- Provide a general summary of your changes in the Title above -->

#### Description
<!--
 Describe your changes in detail
-->
For some transceivers, the `MaxDurationDPInit` encoded in EEPROM might be lesser than the actual time taken to reach DP init state by the transceivers. This causes the CMIS initialization to fail with the below error
```
Jan 23 19:28:12.207053 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_INIT, appl 1 host_lane_count 8 retries=0
Jan 23 19:28:12.221832 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: DpInit duration 0.5 secs
Jan 23 19:28:13.230593 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_TXON, appl 1 host_lane_count 8 retries=0
Jan 23 19:28:13.234448 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: timeout for 'DataPathInitialized' <<-- Error
Jan 23 19:28:14.250133 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: 400G, lanemask=0xff, state=INSERTED, appl 1 host_lane_count 8 retries=1
Jan 23 19:28:14.315148 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: Setting appl=1
Jan 23 19:28:14.380452 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: Setting host_lanemask=0xff
Jan 23 19:28:14.511850 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: Setting media_lanemask=0xf
Jan 23 19:28:14.567454 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: force Datapath reinit
Jan 23 19:28:15.575785 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_DEINIT, appl 1 host_lane_count 8 retries=1
Jan 23 19:28:15.598574 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: DpDeinit duration 0.1 secs, modulePwrUp duration 10.0 secs
Jan 23 19:28:16.606588 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: 400G, lanemask=0xff, state=AP_CONFIGURED, appl 1 host_lane_count 8 retries=1
Jan 23 19:28:17.640929 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_INIT, appl 1 host_lane_count 8 retries=1
Jan 23 19:28:17.656010 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: DpInit duration 0.5 secs
Jan 23 19:28:18.664305 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_TXON, appl 1 host_lane_count 8 retries=1
Jan 23 19:28:18.668263 DUT1 NOTICE pmon#xcvrd[36]: CMIS: Ethernet96: timeout for 'DataPathInitialized' <<-- Error
```
Hence, we need to relax this stringent requirement from software to successfully allow CMIS initialization for such transceivers.

#### Motivation and Context
<!--
 Why is this change required? What problem does it solve?
 If this pull request closes/resolves an open Issue, make sure you
 include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here
-->
For transceivers with `MaxDurationDPInit` <= 1s, the CMIS driver will increase the timeout value to 10 times of the corresponding `MaxDurationDPInit` value advertised in the EEPROM to allow the transceiver to reach DP init state successfully.

#### How Has This Been Tested?
<!--
 Please describe in detail how you tested your changes.
 Include details of your testing environment, and the tests you ran to
 see how your change affects other areas of the code, etc.
-->
For a transceiver with `MaxDurationDPInit` = 0.5s, the `get_datapath_init_duration` API returned a value of 5s.
```
PATELMI@DUT1:~$ sudo sfputil read-eeprom -p Ethernet96 -n 1 -o 144 -s 1
 00000090 45 |E|
PATELMI@DUT1:~$
.
.
.
Jan 24 06:09:29.896666 DUT1 NOTICE pmon#xcvrd[101451]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_INIT, appl 1 host_lane_count 8 retries=0
Jan 24 06:09:29.912270 DUT1 NOTICE pmon#xcvrd[101451]: CMIS: Ethernet96: DpInit duration 5.0 secs
Jan 24 06:09:30.920209 DUT1 NOTICE pmon#xcvrd[101451]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_TXON, appl 1 host_lane_count 8 retries=0
Jan 24 06:09:32.957135 DUT1 NOTICE pmon#xcvrd[101451]: message repeated 2 times: [ CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_TXON, appl 1 host_lane_count 8 retries=0]
Jan 24 06:09:32.957135 DUT1 NOTICE pmon#xcvrd[101451]: CMIS: Ethernet96: Turning ON tx power
Jan 24 06:09:33.964916 DUT1 NOTICE pmon#xcvrd[101451]: CMIS: Ethernet96: 400G, lanemask=0xff, state=DP_ACTIVATION, appl 1 host_lane_count 8 retries=0
Jan 24 06:09:33.968630 DUT1 NOTICE pmon#xcvrd[101451]: CMIS: Ethernet96: READY
```

#### Additional Information (Optional)
MSFT ADO - 31007979
bobby-nexthop pushed a commit to bobby-nexthop/sonic-buildimage that referenced this pull request Aug 1, 2025
…c-net#535)

* Added new dynamic field 'last_sync_time' that shows when STORAGE_INFO for disk was last synced to STATE_DB

* Moved 'start' message to actual starting point of the daemon

* Added functions for formatted and epoch time for user friendly time display

* Made changes per prgeor review comments

* Pivot to SysLogger for all logging

* Increased log level so that they are seen in syslogs

* Code coverage improvement
bobby-nexthop pushed a commit to bobby-nexthop/sonic-buildimage that referenced this pull request Aug 1, 2025
…evice is in detaching mode (sonic-net#546)

* Skip logging the warning, if device is in detaching mode

* Add detach_info table and unittests

* Fix unit tests

* Increase code coverage

* Remove unused header import

* Fix dict get values

* Increase code coverage

* Increase test coverage

* [SmartSwitch] Extend implementation of the DPU chassis daemon. (sonic-net#563)

* Addition of DPU Chassis for thermalctld (sonic-net#564)

* [stormond] Added new dynamic field 'last_sync_time' to STATE_DB (sonic-net#535)

* Added new dynamic field 'last_sync_time' that shows when STORAGE_INFO for disk was last synced to STATE_DB

* Moved 'start' message to actual starting point of the daemon

* Added functions for formatted and epoch time for user friendly time display

* Made changes per prgeor review comments

* Pivot to SysLogger for all logging

* Increased log level so that they are seen in syslogs

* Code coverage improvement

* [lag_id] Add lagid to free_list when LC absent for 30 minutes (sonic-net#542)

When LC is absent for 30 minutes, the database cleanup kicks in. When LagId is released, it needs to be appended to the SYSTEM_LAG_IDS_FREE_LIST

This PR works with the following 2 PRs:
sonic-net/sonic-swss#3303
sonic-net#20369

Signed-off-by: mlok <marty.lok@nokia.com>

* Fixed bug in chassisd causing incorrect number of ASICs in CHASSIS_STATE_DB (sonic-net#560)

Fixed the bug in chassisd due to which incorrect number of ASICs were being pushed to CHASSIS_STATE_DB.

* thermalctld: Add support for fans on non-CPU modules (sonic-net#555)

* thermalctld: Add support for fans on non-CPU modules

* Add module fan to unit tests

* Advanced Azure pipeline to Bookworm (sonic-net#572)

Description
This PR advances the azure pipeline on sonic_platform_daemons from bullseye to bookworm. This fixes the issue where sonic-platform-daemons azp is having some issues due to upgrade to bookworm. See Pipelines - Run 20241210.8 logs for details.

* Take non-CMIS xcvrs out of lpmode in SFF Manager (sonic-net#565)

Description
Fix non-CMIS transceivers in down state by bringing them out of low power mode in the SFF Manager Task.
This is intended to work together with the change in sonic-net#20886.

Motivation and Context
Non-CMIS transceivers were not functioning correctly when put into Low Power mode. So XCVRD now brings them out of lpmode.

How Has This Been Tested?
Loaded an image containing this change alongside the change from sonic-net#20886 on an Arista chassis containing a Clearwater2 linecard.
Verified that without this image some interfaces were in a down state but with the image all interfaces came up as expected.

* Added SmartSwitch support in chassisd and enabling chassisd  (sonic-net#467)

Added SmartSwitch support in chassisd and enabling chassisd

* [chassis][psud] Move the PSU parent information generation to the loop run function from the initialization function (sonic-net#576)

Description
Move the PSU parent information generation to the loop run function from the initialization function

Motivation and Context
Fixes sonic-net#575

How Has This Been Tested?
Tested on Cisco chassis, the PHYSICAL_ENTITY_INFO|PSU * can be re-inserted after thermalctld restart.
And monitored the stated db for memory for hours, works well:

* [chassisd] Address the chassisd crash issue and add UT for it (sonic-net#573)

Description
On Nokia platform, slot name of Supervisor is string "A" instead of a number. Using "int" to convert it could cause issue backtrace. We should use slot value to any checking without any conversion. This will fixes sonic-net#21131

Motivation and Context
Modify the _get_module_info not to convert "slot" to a string value. And also modify the code not to convert slot value to an to do any checking. Just directly use the returned value of get_slot(). Also add UT test_moduleupdater_check_slot_string() to valid it.

How Has This Been Tested?
Tested on 202405 branch


Signed-off-by: mlok <marty.lok@nokia.com>

* Fix a comment

---------

Signed-off-by: mlok <marty.lok@nokia.com>
Co-authored-by: Oleksandr Ivantsiv <oivantsiv@nvidia.com>
Co-authored-by: Gagan Punathil Ellath <gpunathilell@nvidia.com>
Co-authored-by: Ashwin Srinivasan <93744978+assrinivasan@users.noreply.github.com>
Co-authored-by: Marty Y. Lok <76118573+mlok-nokia@users.noreply.github.com>
Co-authored-by: Vivek Verma <137406113+vivekverma-arista@users.noreply.github.com>
Co-authored-by: Patrick MacArthur <pmacarthur@arista.com>
Co-authored-by: Peter Bailey <peterbailey@arista.com>
Co-authored-by: rameshraghupathy <43161235+rameshraghupathy@users.noreply.github.com>
Co-authored-by: Jianquan Ye <jianquanye@microsoft.com>
mssonicbld added a commit that referenced this pull request Nov 6, 2025
…lly (#24418)

#### Why I did it
src/sonic-gnmi
```
* d044158 - (HEAD -> 202411, origin/202411) Merge pull request #417 from FengPan-Frank/temptest (#535) (2 days ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
noaOrMlnx pushed a commit to noaOrMlnx/sonic-buildimage that referenced this pull request Nov 24, 2025
…tomatically (sonic-net#1813)

#### Why I did it
src/sonic-gnmi
```
* 22b7767 - (HEAD -> 202412, origin/202412) [202412] Code sync sonic-net/sonic-gnmi:202411 => 202412 (sonic-net#145) (23 hours ago) [Riff]
* 057765a - Merge remote-tracking branch 'base/202411' into code-sync-202412 (5 days ago) [r12f]
* d044158 - Merge pull request sonic-net#417 from FengPan-Frank/temptest (sonic-net#535) (13 days ago) [Zain Budhwani]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Feb 14, 2026
…tomatically (#25455)

#### Why I did it
src/sonic-linux-kernel
```
* 5b351e3 - (HEAD -> 202511, origin/202511) Integrate HW-MGMT 7.0050.3001 Changes (#535) (2 days ago) [Volodymyr Samotiy]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants