DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 70
Default What do you use for monitoring programs?

Dear Forum,

What do you use when it comes to creating a reliable program?

By "reliable program" I meant that the program will persist, if it crashes something will pick that crashed service up and make it conduct business again. And also when something bad happens to the program that monitoring tool is responsible to watch, the monitoring tool sends an alert via email, for example.

So far, I've seen supervisord and monit but I do not know about their full capabilities.

Could you please mention about which one of them or any other monitoring tool you are using?
Reply With Quote
  #2   (View Single Post)  
Old 3 Weeks Ago
jmccue jmccue is offline
Real Name: John McCue
Package Pilot
 
Join Date: Aug 2012
Location: here
Posts: 188
Default

Needs to be said

If the program crashes, is probably crashed for a reason. So I guess all one needs to do is look for core files.

The only programs I had crashed were the ones I wrote. After the crash I did a back-trace via lldb(1) on the core file and found out I had a memory leak. Once fixed no more crashes.

If I understand what I have read about OpenBSD, the kernel has a lot of internal checks that will kill a program that tries to go were it is not suppose to.

FWIW, the broken programs I fixed on OpenBSD had no issues slowly eating memory on Linux forever.

Is there something specific ?
__________________
[t]csh(1) - "An elegant shell, for a more... civilized age."
- Paraphrasing Star Wars (tvtropes.org)

Last edited by jmccue; 3 Weeks Ago at 03:06 PM. Reason: grammer
Reply With Quote
  #3   (View Single Post)  
Old 3 Weeks Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 70
Default

Dear John,

Thanks for the input.

I think my case is different than what you have described.

Specifically, let's say I write a business-critical Python script and it must be daemonized.
So if the script produces an error it can retry the task that has given to it, by script's internal mechanisms. But somehow if the script crashes and stops working, this has to be taken care of by the monitoring tool. That's what I need.

Best regards
Reply With Quote
  #4   (View Single Post)  
Old 3 Weeks Ago
jmccue jmccue is offline
Real Name: John McCue
Package Pilot
 
Join Date: Aug 2012
Location: here
Posts: 188
Default

Quote:
business-critical Python script
I know nothing about python or how you would start it.

Maybe execute it in a script and the script can catch the crash using "trap", or the script checks the return code for non-zero. If it fails, send an email.

Using trap and/or the return code you could also resubmit the script.

FWIW, I do not use any monitoring tools except for emails sent out from cron.
__________________
[t]csh(1) - "An elegant shell, for a more... civilized age."
- Paraphrasing Star Wars (tvtropes.org)
Reply With Quote
  #5   (View Single Post)  
Old 3 Weeks Ago
Onauk's Avatar
Onauk Onauk is offline
Real Name: Thomas
Fdisk Soldier
 
Join Date: Jan 2023
Location: France
Posts: 71
Default

For this kind of task I would use systemd on linux, so I would guess you can use rc(8) and rc.d(8) on OpenBSD.

With this kind of tools you can log, start, stop, restart after a crash etc.
Reply With Quote
  #6   (View Single Post)  
Old 3 Weeks Ago
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,164
Default

I have used https://cr.yp.to/daemontools/supervise.html for monitoring and restarting. But that was a long time ago. I do not think Bernstein's programs compile on OpenBSD anymore.

Jonathan de Boyne Pollard has made updated versions of Bernstein's program. I think these are in the ports tree of OpenBSD.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #7   (View Single Post)  
Old 3 Days Ago
gordon.f gordon.f is offline
Fdisk Soldier
 
Join Date: Oct 2021
Location: Europe
Posts: 70
Default

Thank you for the experience sharing and suggestions.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installation programs J65nko NetBSD Installation and Upgrading 5 23rd February 2024 04:57 AM
Linux programs on amd64 nwp OpenBSD General 3 8th April 2012 06:06 PM
problem passing /dev/fd/n to programs TerryP Programming 2 15th April 2009 08:24 AM
Distributed Computing Programs JMJ_coder General software and network 0 25th November 2008 08:50 PM
Programs syrushcw FreeBSD Security 1 2nd May 2008 05:44 PM


All times are GMT. The time now is 09:04 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick