Opened 7 years ago

Closed 7 years ago

#2122 closed enhancement (fixed)

Add isc.sysinfo.SysInfo implementation for FreeBSD

Reported by: muks Owned by: muks
Priority: medium Milestone: Sprint-20120717
Component: Unclassified Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description (last modified by muks)

Add FreeBSD implementation for isc.sysinfo.SysInfo.

This is a part of #2085.

Subtickets

Change History (10)

comment:1 Changed 7 years ago by muks

  • Description modified (diff)

comment:2 Changed 7 years ago by muks

  • Owner changed from muks to UnAssigned
  • Status changed from new to assigned

Up for review.

comment:3 Changed 7 years ago by muks

  • Status changed from assigned to reviewing

comment:4 follow-up: Changed 7 years ago by jelte

  • Owner changed from UnAssigned to muks

This one fails, the output of sysctl -n vm.loadavg on my freebsd is:

{ 0.00 0.01 0.00 }

So the split/cast functions fail on the {...

Not sure if this is for FreeBSD in general or for certain versions though.

comment:5 in reply to: ↑ 4 Changed 7 years ago by muks

  • Owner changed from muks to jelte

Replying to jelte:

This one fails, the output of sysctl -n vm.loadavg on my freebsd is:

{ 0.00 0.01 0.00 }

So the split/cast functions fail on the {...

Not sure if this is for FreeBSD in general or for certain versions though.

Fixed. The FreeBSD implementation also has the issues (command not found) that you mentioned in the OpenBSD bug, but I'll fix these after rebasing on top of that when it hits master.

comment:6 Changed 7 years ago by jelte

  • Owner changed from jelte to muks

Fix confirmed, output now looks ok on my system.

I think this can be merged too

comment:7 Changed 7 years ago by jreed

For sysctl, consider using ctypes and libc.sysctlbyname() instead of a subprocess.

comment:8 follow-up: Changed 7 years ago by jreed

Maybe to know if SMP, use sysctl kern.smp.disabled or kern.smp.active

comment:9 in reply to: ↑ 8 Changed 7 years ago by muks

Replying to jreed:

For sysctl, consider using ctypes and libc.sysctlbyname() instead of a subprocess.

I have skipped this for now as it seems to involve loading a shared library and calling into it.

Replying to jreed:

Maybe to know if SMP, use sysctl kern.smp.disabled or kern.smp.active

Picked this suggestion.

This and all other commits were rebased on the OpenBSD modifications in #2121, squashed and put on the trac2122_2 branch.

comment:10 Changed 7 years ago by muks

  • Resolution set to fixed
  • Status changed from reviewing to closed

Merged to master in commit 03f0b4d031e117cfd5ed21bcb43b4c1375c732bf:

* 1100d1a [2122] Add isc.sysinfo.SysInfo implementation for FreeBSD (squashed commit)

Resolving as fixed. Thank you for the reviews and suggestions Jelte and Jeremy.

Note: See TracTickets for help on using tickets.