Re: How do I get a list of the files of only installed packages?

2020-06-07 Thread Ottavio Caruso
On Sun, 7 Jun 2020 at 21:37, Daniel Jakots  wrote:
>
> On Sun, 7 Jun 2020 21:11:57 +0100, Ottavio Caruso
>  wrote:
>
> > Hi,
> >
> > "pkg_info -L PACKAGE-NAME"
> >
> > will give me a list of all the files within each package, regardless
> > of whether the package is installed or not.
> >
> > How can I restrict the output to only installed packages, making it
> > fail if the package is not installed?
> >
> > I could do:
> >
> > "pkg_info -f PACKAGE-NAME "
> >
> > but that would not give me full pathnames.
> >
> > I've looked at the pkg_info man page but I couldn't find a clue.
> >
> > Thanks.
> >
>
> A "creative" solution:
> $ cat -- /var/db/pkg/*/+CONTENTS
>
> for free, you get for each file its size, its timestamp, and
> its checksum! ;)

Well no, because that would give results for all packages, not each of
them; no full path and extra garble.

I'd have to think of a shell script.

-- 
Ottavio Caruso



Re: pfsync interface in carp group

2020-06-07 Thread Markus Wernig
On 6/8/20 12:29 AM, Paul B. Henson wrote:
> whenever I rebooted the secondary firewall, the
> carp interfaces on the primary would flip to backup and then back to
> master as the secondary one rebooted

I don't see that behaviour on my carp pair. Are you using a cross-link
cable between the two firewalls? (You shouldn't, in my experience.)

best



Re: How do I get a list of the files of only installed packages?

2020-06-07 Thread Ottavio Caruso
On Sun, 7 Jun 2020 at 21:11, Ottavio Caruso
 wrote:
>
> Hi,
>
> "pkg_info -L PACKAGE-NAME"
>
> will give me a list of all the files within each package, regardless
> of whether the package is installed or not.
>
> How can I restrict the output to only installed packages, making it
> fail if the package is not installed?
>
> I could do:
>
> "pkg_info -f PACKAGE-NAME "
>

Correction: "pkg_info -f" will also show me the packing list of remote
packages, so that is not an option either.


-- 
Ottavio Caruso



How do I get a list of the files of only installed packages?

2020-06-07 Thread Ottavio Caruso
Hi,

"pkg_info -L PACKAGE-NAME"

will give me a list of all the files within each package, regardless
of whether the package is installed or not.

How can I restrict the output to only installed packages, making it
fail if the package is not installed?

I could do:

"pkg_info -f PACKAGE-NAME "

but that would not give me full pathnames.

I've looked at the pkg_info man page but I couldn't find a clue.

Thanks.

-- 
Ottavio Caruso



Re: Potential awk bug?

2020-06-07 Thread Jordan Geoghegan

Hi Philip,

Thanks for the quick response. I certainly wasn't expecting to find an 
ancient bug like this. Should I be reporting this bug upstream, or are 
you planning on upstreaming a diff?


Regards,

Jordan



On 2020-06-06 20:16, Philip Guenther wrote:
On Sat, Jun 6, 2020 at 5:08 PM Zé Loff > wrote:


On Sat, Jun 06, 2020 at 03:51:58PM -0700, Jordan Geoghegan wrote:
> I'm working on a simple awk snippet to convert the IP range data
listed in
> the Extended Delegation Statistics data from ARIN [1] and
convert it into
> CIDR blocks. I have a snippet that works perfectly fine on mawk
and gawk,
> but not on the base system awk. I'm 99% sure I'm not using any
GNUisms, as
> when I break the command up into two parts, it works perfectly.
>
> The snippet below does not work with base awk, but does work
with gawk and
> mawk: (Running on 6.6 -stable system)
>
>   awk -F '|' '{ if ( $3 == "ipv4" && $2 == "US")
printf("%s/%d\n", $4,
> 32-log($5)/log(2))}' delegated-arin-extended-latest.txt
>
>
> The command does output data, but it also throws errors for
certain lines:
>
>   awk: log result out of range
>   input record number 94027, file delegated-arin-extended-latest.txt
>   source line number 1
>
> Most CIDR blocks are calculated correctly, but about 10% of them
have errors
> (ie something that should calculated to be a /24 is instead
calculated to be
> a /30).

...

I have no idea about what is going on, but FWIW I can reproduce
this on
i386 6.7-stable and amd64 6.7-current (well, current-ish, #232).
Truncating the file to a single offending line produces the same
result:
log($5) is out of range.

It appears to have something to do with the last field. Removing it or
changing some of its characters seems to work, e.g.:


arin|US|ipv4|216.250.144.0|4096|20050503|allocated|5e58386636aa775c2106140445cf2c30

arin|US|ipv4|216.250.144.0|4096|20050503|allocated|5a58386636aa775c2106140445cf2c30
                                                    ^
Fails on the first line but works on the second.


Hah!  Nice observation!

The last field of the first line looks kinda like a number in 
scientific notation, but when awk internally tries to set up the 
fields it generates an ERANGE error...and the global errno variable is 
left with that value.  Several builtins in awk, including log(), 
perform operations and then check whether errno is set to EDOM or 
ERANGE but fail to clear errno beforehand.


The fix is to zero errno before all the code sequences that use the 
errcheck() function, ala:


--- run.c       13 Aug 2019 10:45:56 -      1.44
+++ run.c       7 Jun 2020 03:14:38 -
@@ -26,6 +26,7 @@ THIS SOFTWARE.
 #define DEBUG
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1041,8 +1042,10 @@ Cell *arith(Node **a, int n)     /* a[0] + a
        case POWER:
                if (j >= 0 && modf(j, ) == 0.0)       /* pos integer 
exponent */

                        i = ipow(i, (int) j);
-               else
+               else {
+                       errno = 0;
                        i = errcheck(pow(i, j), "pow");
+               }
                break;
        default:        /* can't happen */
                FATAL("illegal arithmetic operator %d", n);
@@ -1135,8 +1138,10 @@ Cell *assign(Node **a, int n)    /* a[0] =
        case POWEQ:
                if (yf >= 0 && modf(yf, ) == 0.0)     /* pos integer 
exponent */

                        xf = ipow(xf, (int) yf);
-               else
+               else {
+                       errno = 0;
                        xf = errcheck(pow(xf, yf), "pow");
+               }
                break;
        default:
                FATAL("illegal assignment operator %d", n);
@@ -1499,12 +1504,15 @@ Cell *bltin(Node **a, int n)    /* builtin
                        u = strlen(getsval(x));
                break;
        case FLOG:
+               errno = 0;
                u = errcheck(log(getfval(x)), "log"); break;
        case FINT:
                modf(getfval(x), ); break;
        case FEXP:
+               errno = 0;
                u = errcheck(exp(getfval(x)), "exp"); break;
        case FSQRT:
+               errno = 0;
                u = errcheck(sqrt(getfval(x)), "sqrt"); break;
        case FSIN:
                u = sin(getfval(x)); break;


Todd, are we up to date with upstream, or is this latent there too?


Philip Guenther





pfsync interface in carp group

2020-06-07 Thread Paul B. Henson
I've had a pair of redundant firewalls using pfsync for years. I've 
noticed in the past that whenever I rebooted the secondary firewall, the 
carp interfaces on the primary would flip to backup and then back to 
master as the secondary one rebooted. I never really noticed any issues 
with it, so I just ignored it.


Since upgrading to 6.7 though, if I have an active ssh connection to the 
carp IP address on the primary when I reboot the secondary and these 
interface flip-flops occur, my connection is dropped, which is undesirable.


It looks like this is happening because by default the pfsync interface 
is in the carp group, so when it goes down, it demotes all of the carp 
interfaces on the system. I can see why this would be useful for a setup 
using multicast and more than two firewalls, as if you are not 
synchronizing states, you are probably not the best choice to be the 
active owner of the virtual IP addresses.


However, for only two firewalls, when you're using the syncpeer 
directive for the pfsync interface, it seems it would be better not to 
default to belonging to the carp group? With only two firewalls, if one 
of them has broken synchronization, so does the other, so is there any 
real point in trying to migrate away from the one that's currently master?


I updated my configuration to remove the pfsync interface from the carp 
group and now when I reboot there are no issues with the carp interfaces 
changing state or connections being dropped. Would it make sense to not 
automatically include the pfsync interface in the carp group if it is 
using the syncpeer directive?


Thanks…



Re: pfsync and rule specific state timeouts

2020-06-07 Thread Paul B. Henson

On 6/5/2020 11:15 PM, obs...@loopw.com wrote:


1)  “egress” can be used to reference the external nic in a rule,
instead of having a specific IP.  Egress is defined as the nic with
the default route. pass in quick log on egress inet proto tcp to
(egress) port 22


Ah, I think I seen that in the past but did not remember it offhand. 
Thanks; although these boxes run OSPF and the default route changes 
depend on the network state, so I'm not sure that this would work.



2)  Both of the firewall IP addresses can be in a rule if egress is
not suitable for your topology, something like this will sync over
cleanly with pfsync: pass in quick log on $ext_if inet proto tcp to {
$fw1_ext $fw2_ext } port 22


I thought about doing that, but I ended up just making a table with a 
single IP address in it, each router having the appropriate IP address 
in the table, and the rule referencing the table being exactly the same 
on both. Everything is working properly now.


I do still wonder if this requirement is documented anywhere? I've been 
looking, and could not find it. It was very confusing trying to sort out 
why my states were mysteriously disappearing, I ended up having to add 
some extra debugging code in the kernel to figure out what was happening.


Thanks…



usb keyboard suspend and hibernate problem

2020-06-07 Thread Switch 1024
Hi,

I have a Ultimate Hacking Keyboard [1] and it seems to prevent my
lenovo X1 Carbon 4th gen. from suspending and hibernating.

Sometimes it works, but more often than not, the power led flashes
rapidly, the displays turn off, hdmi cuts out, the fan starts up and
thats it.

after quite some time i found that I can make the machine reliable
suspend if I disconnect the usb keyboard before executing zzz.

I am wondering if there is a command with which I can poweroff the
keyboard in /etc/apm/suspend?

Thank you,

best regards
Rai



Re: How do I get a list of the files of only installed packages?

2020-06-07 Thread Udo Zorn
On Sun, Jun 07, 2020 at 10:04:53PM +0100, Ottavio Caruso wrote:
> On Sun, 7 Jun 2020 at 21:37, Daniel Jakots  wrote:
> >
> > On Sun, 7 Jun 2020 21:11:57 +0100, Ottavio Caruso
> >  wrote:
> >
> > > Hi,
> > >
> > > "pkg_info -L PACKAGE-NAME"
> > >
> > > will give me a list of all the files within each package, regardless
> > > of whether the package is installed or not.
> > >
> > > How can I restrict the output to only installed packages, making it
> > > fail if the package is not installed?
> > >
> > > I could do:
> > >
> > > "pkg_info -f PACKAGE-NAME "
> > >
> > > but that would not give me full pathnames.
> > >
> > > I've looked at the pkg_info man page but I couldn't find a clue.
> > >
> > > Thanks.
> > >
> >
> > A "creative" solution:
> > $ cat -- /var/db/pkg/*/+CONTENTS
> >
> > for free, you get for each file its size, its timestamp, and
> > its checksum! ;)
> 
> Well no, because that would give results for all packages, not each of
> them; no full path and extra garble.
> 
> I'd have to think of a shell script.
> 
> -- 
> Ottavio Caruso
> 

How about this?

$ pkg_info -z | xargs pkg_info -L



Re: How do I get a list of the files of only installed packages?

2020-06-07 Thread Daniel Jakots
On Sun, 7 Jun 2020 21:11:57 +0100, Ottavio Caruso
 wrote:

> Hi,
> 
> "pkg_info -L PACKAGE-NAME"
> 
> will give me a list of all the files within each package, regardless
> of whether the package is installed or not.
> 
> How can I restrict the output to only installed packages, making it
> fail if the package is not installed?
> 
> I could do:
> 
> "pkg_info -f PACKAGE-NAME "
> 
> but that would not give me full pathnames.
> 
> I've looked at the pkg_info man page but I couldn't find a clue.
> 
> Thanks.
> 

A "creative" solution:
$ cat -- /var/db/pkg/*/+CONTENTS

for free, you get for each file its size, its timestamp, and
its checksum! ;)

Cheers,
Daniel



OpenBSD 6.6/amd64 kernel crash: softdep_deallocate_dependencies: unrecovered I/O error

2020-06-07 Thread Antonius Bekasi
Hi Misc,



This is just a report. My lovely OpenBSD firewall crashed lately too much. So 
here kernel debugger output.

I was using softdep in every partition. Now i removed every softdep from fstab. 
I think using softdep under /usr partition was the source of my fault: 



# cat /etc/fstab.old

6d79d3e0564cde27.b none swap sw

6d79d3e0564cde27.a / ffs rw 1 1

6d79d3e0564cde27.g /log ffs rw,softdep,nodev,nosuid 1 2

6d79d3e0564cde27.d /tmp ffs rw,softdep,nodev,nosuid 1 2

6d79d3e0564cde27.f /usr ffs rw,softdep,wxallowed,nodev 1 2

6d79d3e0564cde27.e /var ffs rw,softdep,nodev,nosuid 1 2




Here ddb outputs:



ddb{0}> show panic

softdep_deallocate_dependencies: unrecovered I/O error

ddb{0}> trace

db_enter() at db_enter+0x10

panic() at panic+0x128

softdep_deallocate_dependencies(fd83e1c6af00) at softdep_deallocate_depende

ncies+0x49

brelse(fd83e1c6af00) at brelse+0xdc

sd_buf_done(fd83e1eb4548) at sd_buf_done+0x124

scsi_done(fd83e1eb4548) at scsi_done+0x24

ahci_port_intr(80277d00,8000) at ahci_port_intr+0xa88

ahci_ata_cmd_timeout(802a0f00) at ahci_ata_cmd_timeout+0x226

softclock(0) at softclock+0x142

softintr_dispatch(0) at softintr_dispatch+0xf2

Xsoftclock(0,40,1388,0,40,81f3c6f8) at Xsoftclock+0x1f

acpicpu_idle() at acpicpu_idle+0x1d2

sched_idle(81f3bff0) at sched_idle+0x225

end trace frame: 0x0, count: -13

ddb{0}> machine ddbcpu 1

Stopped at      x86_ipi_db+0x12:        leave

x86_ipi_db(800022008ff0) at x86_ipi_db+0x12

x86_ipi_handler() at x86_ipi_handler+0x80

Xresume_lapic_ipi(c,800022008ff0,80002202bff0,0,0,8000cef0) at X

resume_lapic_ipi+0x23

__mp_acquire_count(81fbd988,1) at __mp_acquire_count+0x82

mi_switch() at mi_switch+0x243

sleep_finish(8000335e7eb8,1) at sleep_finish+0x84

tsleep(fd83f0d36b60,118,81c9866f,bb9) at tsleep+0xcb

kqueue_scan(fd83f0d36b60,40,48097867800,8000335e8270,8000cef0,f

fff8000335e82b8) at kqueue_scan+0x113

sys_kevent(8000cef0,8000335e8320,8000335e8380) at sys_kevent+0x

2a9

syscall(8000335e83f0) at syscall+0x389

Xsyscall(6,48,7f7f1f80,48,0,48097867800) at Xsyscall+0x128

end of kernel

end trace frame: 0x7f7f1f40, count: 4

ddb{1}> trace

x86_ipi_db(800022008ff0) at x86_ipi_db+0x12

x86_ipi_handler() at x86_ipi_handler+0x80

Xresume_lapic_ipi(c,800022008ff0,80002202bff0,0,0,8000cef0) at X

resume_lapic_ipi+0x23

__mp_acquire_count(81fbd988,1) at __mp_acquire_count+0x82

mi_switch() at mi_switch+0x243

sleep_finish(8000335e7eb8,1) at sleep_finish+0x84

tsleep(fd83f0d36b60,118,81c9866f,bb9) at tsleep+0xcb

kqueue_scan(fd83f0d36b60,40,48097867800,8000335e8270,8000cef0,f

fff8000335e82b8) at kqueue_scan+0x113

sys_kevent(8000cef0,8000335e8320,8000335e8380) at sys_kevent+0x

2a9

syscall(8000335e83f0) at syscall+0x389

Xsyscall(6,48,7f7f1f80,48,0,48097867800) at Xsyscall+0x128

end of kernel

end trace frame: 0x7f7f1f40, count: -11

ddb{1}>

x86_ipi_db(800022008ff0) at x86_ipi_db+0x12

end trace frame: 0x8000335e7d40, count: 0

ddb{1}>

x86_ipi_db(800022008ff0) at x86_ipi_db+0x12

end trace frame: 0x8000335e7d40, count: 0

ddb{1}>

x86_ipi_db(800022008ff0) at x86_ipi_db+0x12

end trace frame: 0x8000335e7d40, count: 0

ddb{1}>

x86_ipi_db(800022008ff0) at x86_ipi_db+0x12

end trace frame: 0x8000335e7d40, count: 0

ddb{1}> machine ddbcpu 2

Stopped at      x86_ipi_db+0x12:        leave

x86_ipi_db(800022019ff0) at x86_ipi_db+0x12

x86_ipi_handler() at x86_ipi_handler+0x80

Xresume_lapic_ipi(d,800022019ff0,8000223e8000,0,0,8000223e80d8) at X

resume_lapic_ipi+0x23

_kernel_lock() at _kernel_lock+0xa2

timeout_del_barrier(8000223e80d8) at timeout_del_barrier+0xa2

msleep(81efbe70,81efbe90,20,81c70ac3,0) at msleep+0xf5

taskq_next_work(81efbe70,800022409010) at taskq_next_work+0x38

taskq_thread(81efbe70) at taskq_thread+0x6f

end trace frame: 0x0, count: 7

ddb{2}> trace

x86_ipi_db(800022019ff0) at x86_ipi_db+0x12

x86_ipi_handler() at x86_ipi_handler+0x80

Xresume_lapic_ipi(d,800022019ff0,8000223e8000,0,0,8000223e80d8) at X

resume_lapic_ipi+0x23

_kernel_lock() at _kernel_lock+0xa2

timeout_del_barrier(8000223e80d8) at timeout_del_barrier+0xa2

msleep(81efbe70,81efbe90,20,81c70ac3,0) at msleep+0xf5

taskq_next_work(81efbe70,800022409010) at taskq_next_work+0x38

taskq_thread(81efbe70) at taskq_thread+0x6f

end trace frame: 0x0, count: -8

ddb{2}> machine ddbcpu 3

Stopped at      x86_ipi_db+0x12:        leave

x86_ipi_db(800022022ff0) at x86_ipi_db+0x12

x86_ipi_handler() at x86_ipi_handler+0x80

Xresume_lapic_ipi(c,800022022ff0,81f3bff0,0,0,8000fffeb8f0) at X

resume_lapic_ipi+0x23

__mp_acquire_count(81fbd988,1) at __mp_acquire_count+0x82


Re: Getting HDMI Events

2020-06-07 Thread Switch 1024
On Sun, 7 Jun 2020 at 14:06, Marcus MERIGHI  wrote:
>
> switch1...@gmail.com (Switch 1024), 2020.06.07 (Sun) 08:59 (CEST):
> > tldr; My question is, how can I get  HDMI Events, I want to execute scripts
> > when a new HDMI (or DP, for that matter) device is connected or 
> > disconnected.
> > Maybe there is a really obvious or simple way or solution but I did not see 
> > it.
>
> x-on-resize might have some clues:
> https://marc.info/?l=openbsd-misc=157104216604576
>
> marcus

Ok, Thank you, I downloaded the sources for x-on-resize [1], got it to
compile with clang, but I do not receive events.

Clang line:
clang -v -L/usr/X11R6/lib/ -lX11 -lXrandr
-I/usr/src/lib/libX11/include/ -I/usr/src/proto/xorgproto/include/
-I/usr/src/lib/libXrandr/include/ -I/usr/src/lib/libXrender/include/
x-on-resize.c

I modified the source a bit to get some output:

```
for (;;) {
int configed = 0;
int resized = 0;
printf ("in for\n");

do {
printf ("in while\n");
printf ("XNextEvent\n");
XNextEvent(dpy, );
printf ("ev.type: %d\n", ev.type);
switch (ev.type - event_base) {
case RRNotify:
printf ("in RRNotify\n");
nev = (XRRNotifyEvent *) 
```

But I only get "in while", then "XNextEvent" and nothing more, it sits
there. If i execute Xrandr, change Xrandr configuration, disconnect
HDMI port, reconnect HDMI port, I do not receive any events.

Does any one have any thoughts? Could it be my graphics card?
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics" rev 0x0b
drm0 at inteldrm0
inteldrm0: msi, HASWELL, gen 7
inteldrm0: 1600x900, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
[drm] *ERROR* Potential atomic update failure on pipe B


[1] https://people.freedesktop.org/~keithp/x-on-resize.git/



Re: Getting HDMI Events

2020-06-07 Thread Marcus MERIGHI
switch1...@gmail.com (Switch 1024), 2020.06.07 (Sun) 08:59 (CEST):
> tldr; My question is, how can I get  HDMI Events, I want to execute scripts
> when a new HDMI (or DP, for that matter) device is connected or disconnected.
> Maybe there is a really obvious or simple way or solution but I did not see 
> it.

x-on-resize might have some clues:
https://marc.info/?l=openbsd-misc=157104216604576

marcus



Re: OpenBSD 6.6/amd64 kernel crash: softdep_deallocate_dependencies: unrecovered I/O error

2020-06-07 Thread Otto Moerbeek
On Sun, Jun 07, 2020 at 02:18:50PM +0200, Antonius Bekasi wrote:

> Hi Misc,
> 
> 
> 
> This is just a report. My lovely OpenBSD firewall crashed lately too much. So 
> here kernel debugger output.
> 
> I was using softdep in every partition. Now i removed every softdep from 
> fstab. I think using softdep under /usr partition was the source of my fault: 
> 
> 
> 
> # cat /etc/fstab.old
> 
> 6d79d3e0564cde27.b none swap sw
> 
> 6d79d3e0564cde27.a / ffs rw 1 1
> 
> 6d79d3e0564cde27.g /log ffs rw,softdep,nodev,nosuid 1 2
> 
> 6d79d3e0564cde27.d /tmp ffs rw,softdep,nodev,nosuid 1 2
> 
> 6d79d3e0564cde27.f /usr ffs rw,softdep,wxallowed,nodev 1 2
> 
> 6d79d3e0564cde27.e /var ffs rw,softdep,nodev,nosuid 1 2
> 
> 
> 
> 
> Here ddb outputs:
> 
> 
> 
> ddb{0}> show panic
> 
> softdep_deallocate_dependencies: unrecovered I/O error

This is a clear sign of hardware failing.

-Otto

> 
> ddb{0}> trace
> 
> db_enter() at db_enter+0x10
> 
> panic() at panic+0x128
> 
> softdep_deallocate_dependencies(fd83e1c6af00) at 
> softdep_deallocate_depende
> 
> ncies+0x49
> 
> brelse(fd83e1c6af00) at brelse+0xdc
> 
> sd_buf_done(fd83e1eb4548) at sd_buf_done+0x124
> 
> scsi_done(fd83e1eb4548) at scsi_done+0x24
> 
> ahci_port_intr(80277d00,8000) at ahci_port_intr+0xa88
> 
> ahci_ata_cmd_timeout(802a0f00) at ahci_ata_cmd_timeout+0x226
> 
> softclock(0) at softclock+0x142
> 
> softintr_dispatch(0) at softintr_dispatch+0xf2
> 
> Xsoftclock(0,40,1388,0,40,81f3c6f8) at Xsoftclock+0x1f
> 
> acpicpu_idle() at acpicpu_idle+0x1d2
> 
> sched_idle(81f3bff0) at sched_idle+0x225
> 
> end trace frame: 0x0, count: -13
> 
> ddb{0}> machine ddbcpu 1
> 
> Stopped at      x86_ipi_db+0x12:        leave
> 
> x86_ipi_db(800022008ff0) at x86_ipi_db+0x12
> 
> x86_ipi_handler() at x86_ipi_handler+0x80
> 
> Xresume_lapic_ipi(c,800022008ff0,80002202bff0,0,0,8000cef0) 
> at X
> 
> resume_lapic_ipi+0x23
> 
> __mp_acquire_count(81fbd988,1) at __mp_acquire_count+0x82
> 
> mi_switch() at mi_switch+0x243
> 
> sleep_finish(8000335e7eb8,1) at sleep_finish+0x84
> 
> tsleep(fd83f0d36b60,118,81c9866f,bb9) at tsleep+0xcb
> 
> kqueue_scan(fd83f0d36b60,40,48097867800,8000335e8270,8000cef0,f
> 
> fff8000335e82b8) at kqueue_scan+0x113
> 
> sys_kevent(8000cef0,8000335e8320,8000335e8380) at 
> sys_kevent+0x
> 
> 2a9
> 
> syscall(8000335e83f0) at syscall+0x389
> 
> Xsyscall(6,48,7f7f1f80,48,0,48097867800) at Xsyscall+0x128
> 
> end of kernel
> 
> end trace frame: 0x7f7f1f40, count: 4
> 
> ddb{1}> trace
> 
> x86_ipi_db(800022008ff0) at x86_ipi_db+0x12
> 
> x86_ipi_handler() at x86_ipi_handler+0x80
> 
> Xresume_lapic_ipi(c,800022008ff0,80002202bff0,0,0,8000cef0) 
> at X
> 
> resume_lapic_ipi+0x23
> 
> __mp_acquire_count(81fbd988,1) at __mp_acquire_count+0x82
> 
> mi_switch() at mi_switch+0x243
> 
> sleep_finish(8000335e7eb8,1) at sleep_finish+0x84
> 
> tsleep(fd83f0d36b60,118,81c9866f,bb9) at tsleep+0xcb
> 
> kqueue_scan(fd83f0d36b60,40,48097867800,8000335e8270,8000cef0,f
> 
> fff8000335e82b8) at kqueue_scan+0x113
> 
> sys_kevent(8000cef0,8000335e8320,8000335e8380) at 
> sys_kevent+0x
> 
> 2a9
> 
> syscall(8000335e83f0) at syscall+0x389
> 
> Xsyscall(6,48,7f7f1f80,48,0,48097867800) at Xsyscall+0x128
> 
> end of kernel
> 
> end trace frame: 0x7f7f1f40, count: -11
> 
> ddb{1}>
> 
> x86_ipi_db(800022008ff0) at x86_ipi_db+0x12
> 
> end trace frame: 0x8000335e7d40, count: 0
> 
> ddb{1}>
> 
> x86_ipi_db(800022008ff0) at x86_ipi_db+0x12
> 
> end trace frame: 0x8000335e7d40, count: 0
> 
> ddb{1}>
> 
> x86_ipi_db(800022008ff0) at x86_ipi_db+0x12
> 
> end trace frame: 0x8000335e7d40, count: 0
> 
> ddb{1}>
> 
> x86_ipi_db(800022008ff0) at x86_ipi_db+0x12
> 
> end trace frame: 0x8000335e7d40, count: 0
> 
> ddb{1}> machine ddbcpu 2
> 
> Stopped at      x86_ipi_db+0x12:        leave
> 
> x86_ipi_db(800022019ff0) at x86_ipi_db+0x12
> 
> x86_ipi_handler() at x86_ipi_handler+0x80
> 
> Xresume_lapic_ipi(d,800022019ff0,8000223e8000,0,0,8000223e80d8) 
> at X
> 
> resume_lapic_ipi+0x23
> 
> _kernel_lock() at _kernel_lock+0xa2
> 
> timeout_del_barrier(8000223e80d8) at timeout_del_barrier+0xa2
> 
> msleep(81efbe70,81efbe90,20,81c70ac3,0) at msleep+0xf5
> 
> taskq_next_work(81efbe70,800022409010) at taskq_next_work+0x38
> 
> taskq_thread(81efbe70) at taskq_thread+0x6f
> 
> end trace frame: 0x0, count: 7
> 
> ddb{2}> trace
> 
> x86_ipi_db(800022019ff0) at x86_ipi_db+0x12
> 
> x86_ipi_handler() at x86_ipi_handler+0x80
> 
> Xresume_lapic_ipi(d,800022019ff0,8000223e8000,0,0,8000223e80d8) 
> at X
> 
> resume_lapic_ipi+0x23
> 
> _kernel_lock() at _kernel_lock+0xa2
> 
> timeout_del_barrier(8000223e80d8) at timeout_del_barrier+0xa2
> 
> 

Re: Potential awk bug?

2020-06-07 Thread Todd C . Miller
On Sat, 06 Jun 2020 18:16:39 -0900, Philip Guenther wrote:

> Todd, are we up to date with upstream, or is this latent there too?

We are not up to date but upstream (https://github.com/onetrueawk/awk)
exhibits the same bug.

 - todd



Re: OpenSMTP relaying to multiple mail servers

2020-06-07 Thread Robert Sacks

On 6/7/20 12:42 AM, Predrag Punosevac wrote:

I have a very noob question. Is it possible to configure OpenSMTP to use
multiple relay servers?


Yes. I would create an action for each relay like this:

action "gmail" relay host smtps://gm...@smtp.gmail.com auth 
action "outlook" relay host smtps://outl...@smtp-mail.outlook.com \
auth 

and then create a match rule for each email address like this:

match mail-from "someb...@gmail.com" for any action "gmail"
match mail-from "someb...@hotmail.com" for any action "outlook"

If you want to use more than one email address for a relay you could 
also use `match-from "@gmail.com"` or use a list table.


You can read this blog post[1] for a more detailed explanation.

[1] https://dataswamp.org/~solene/2018-09-06-openbsd-opensmtpd-relay.html



Re: cron scheduling on a laptop and backups

2020-06-07 Thread Switch 1024
> One suggestion would be to, just like on Linux, run jobs that need to
> run at least once a day (if the machine is up at least once a day) using
> anacron.  The anacron tool is available as a package.
>
> You would trigger anacron with a "@reboot", and possibly also with a
> "@daily" cron job.

Thank you very much, got it configured!



Re: late pppoe address

2020-06-07 Thread Stuart Henderson
On 2020-06-07, Mihai Popescu  wrote:
> Start address this problem to your ISP and ask it to remedy this stupid
> implementation of pppoe on server side. Otherwise, you have to wait for it
> and avoid spamming the list with your "i need to get this done quickly"
> messages, please. Maybe it is time to employ a real expert on OpenBSD.

Have you considered that it might not be the ISP's problem?
OpenBSD's pppoe(4) is not perfect.




Re: cron scheduling on a laptop and backups

2020-06-07 Thread Andreas Kusalananda Kähäri
On Sun, Jun 07, 2020 at 06:52:50AM +, Switch 1024 wrote:
> Hello,
> 
> first time OpenBSD user here. I came from 20 years of linux, then 6
> years of freebsd, and finally arrived at OpenBSD, thank you guys for
> doing such a great job. It just feels right, feels like home!
> 
> While checking about how to backup the system correctly, and what
> files I need to recover my system and checked the altroot strategy,
> which is executed from the daily script which is started via cron.
> 
> I checked my cron log and there are no executions of daily, weekly,
> etc. I only see newsyslog jobs being executed. Right, I put my laptop
> to sleep or turn it off most of the time when I am done working.
> 
> So how to deal with this correctly? Change the hours to run the
> backups during the day? Is there a way to tell cron to run jobs it
> missed? (Reading the man pages, I did not see that there would be ...)
> 
> How do you guys schedule these tasks (also cleanup tasks to clean out
> /tmp etc. on your laptops?
> 
> Thank you,
> Best regards
> Rai

One suggestion would be to, just like on Linux, run jobs that need to
run at least once a day (if the machine is up at least once a day) using
anacron.  The anacron tool is available as a package.

You would trigger anacron with a "@reboot", and possibly also with a
"@daily" cron job.

-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.



Getting HDMI Events

2020-06-07 Thread Switch 1024
Hello again,

tldr; My question is, how can I get  HDMI Events, I want to execute scripts
when a new HDMI (or DP, for that matter) device is connected or disconnected.
Maybe there is a really obvious or simple way or solution but I did not see it.


Reading the man page for kqueue, I was very excited to see that I can
monitor for HDMI changes EVFILT_DEVICE and NOTE_CHANGE.

But I do not see how I could use it, I am not sure what would be the
descriptor to watch for in this case. Also the perl kqueue cpan module
does not contain the EVFILT_DEVICE stuff.

I tried anyway using values defined in the .h files, tried to use
various outputs like pci device number etc. as a descriptor but it did
not work.

Using incron does also not work as it only concentrates on
files.

I checked the hotplugd but did not get anywhere either.

Then reading the source of drm etc. and I see that at least HDMI
changes do send NOTE_CHANGE events to kqueue, so they should be there.

Using xev with the -event randr should print randr events, and I
thought HDMI connects or disconnects should be events randr talks
about, but it does not work.


I am very interested in this because I created a set of scripts which
check the EDID output and stuff and create a hash and based on that
executes defined scripts so in my home, the monitor is left of the
laptop, but in the office, it is actually right of the laptop for
reasons. And when I am on the road it just turns off the other
outputs, but now I have to I3 bindsym a key binding to execute it when
I come home from work and connect the monitor.




Thank you
Rai



cron scheduling on a laptop and backups

2020-06-07 Thread Switch 1024
Hello,

first time OpenBSD user here. I came from 20 years of linux, then 6
years of freebsd, and finally arrived at OpenBSD, thank you guys for
doing such a great job. It just feels right, feels like home!

While checking about how to backup the system correctly, and what
files I need to recover my system and checked the altroot strategy,
which is executed from the daily script which is started via cron.

I checked my cron log and there are no executions of daily, weekly,
etc. I only see newsyslog jobs being executed. Right, I put my laptop
to sleep or turn it off most of the time when I am done working.

So how to deal with this correctly? Change the hours to run the
backups during the day? Is there a way to tell cron to run jobs it
missed? (Reading the man pages, I did not see that there would be ...)

How do you guys schedule these tasks (also cleanup tasks to clean out
/tmp etc. on your laptops?

Thank you,
Best regards
Rai