Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib, watchfrr: Add some additional status messages to systemd #5105

Merged

Conversation

donaldsharp
Copy link
Member

Allow systemd to be informed about operational state so operators can
infer a bit about what is going on with FRR from the systemd status
cli.

sharpd@robot ~/frr4> systemctl status frr
● frr.service - FRRouting
Loaded: loaded (/usr/lib/systemd/system/frr.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2019-10-03 21:09:04 EDT; 7s ago
Docs: https://frrouting.readthedocs.io/en/latest/setup.html
Process: 32455 ExecStart=/usr/lib/frr/frrinit.sh start (code=exited, status=0/SUCCESS)
Status: "FRR Operational"
Tasks: 12 (limit: 4915)
Memory: 76.5M
CGroup: /system.slice/frr.service
├─32468 /usr/lib/frr/watchfrr -d zebra bgpd staticd
├─32487 /usr/lib/frr/zebra -d -A 127.0.0.1 -s 90000000
├─32492 /usr/lib/frr/bgpd -d -A 127.0.0.1
└─32500 /usr/lib/frr/staticd -d -A 127.0.0.1

Please note the Status: ... line above.

Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com

Allow systemd to be informed about operational state so operators can
infer a bit about what is going on with FRR from the systemd status
cli.

sharpd@robot ~/frr4> systemctl status frr
● frr.service - FRRouting
   Loaded: loaded (/usr/lib/systemd/system/frr.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-10-03 21:09:04 EDT; 7s ago
     Docs: https://frrouting.readthedocs.io/en/latest/setup.html
  Process: 32455 ExecStart=/usr/lib/frr/frrinit.sh start (code=exited, status=0/SUCCESS)
   Status: "FRR Operational"
    Tasks: 12 (limit: 4915)
   Memory: 76.5M
   CGroup: /system.slice/frr.service
           ├─32468 /usr/lib/frr/watchfrr -d zebra bgpd staticd
           ├─32487 /usr/lib/frr/zebra -d -A 127.0.0.1 -s 90000000
           ├─32492 /usr/lib/frr/bgpd -d -A 127.0.0.1
           └─32500 /usr/lib/frr/staticd -d -A 127.0.0.1

Please note the `Status: ...` line above.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
@LabN-CI
Copy link
Collaborator

LabN-CI commented Oct 4, 2019

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/5105 b3ee8bc
Date 10/03/2019
Start 22:25:23
Finish 22:47:30
Run-Time 22:07
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2019-10-03-22:25:23.txt
Log autoscript-2019-10-03-22:26:38.log.bz2
Memory 431 430 358

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9129/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.


CLANG Static Analyzer Summary

  • Github Pull Request 5105, comparing to Git base SHA bf9846b

No Changes in Static Analysis warnings compared to base

1 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-9129/artifact/shared/static_analysis/index.html

@@ -86,6 +86,7 @@ static int systemd_get_watchdog_time(int the_process)

void systemd_send_stopping(void)
{
systemd_send_information("STATUS=");
Copy link
Member

Choose a reason for hiding this comment

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

maybe "stopping %s" here as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

nah. status stays there after you've stopped. so a systemct status frr would have a status of stopping after it was stopped, which I found confusing.

Copy link
Member

Choose a reason for hiding this comment

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

ah 🙂

@@ -86,6 +86,7 @@ static int systemd_get_watchdog_time(int the_process)

void systemd_send_stopping(void)
{
systemd_send_information("STATUS=");
Copy link
Contributor

Choose a reason for hiding this comment

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

status == FRR operational indicate that all the daemons are successfully started and running. Also, if a particular daemon is down or continuously restarting, the status would be "restarting". Right ?

if two daemons are restarting at any given instance, does this show two daemons with status as restarting ?

Copy link
Member Author

Choose a reason for hiding this comment

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

say bgpd died you would see status==restarting bgpd and on zebra death you would see status == restarting all

@ton31337 ton31337 merged commit f7192aa into FRRouting:master Oct 7, 2019
@donaldsharp donaldsharp deleted the watchfrr_more_systemd_status branch December 9, 2019 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants