Re: netsnmpd Fails to Start on Current [Solved]

2016-10-11 Thread Stuart Henderson
On 2016-10-08, Theodore Wynnychenko  wrote:
> On 2016-10-04, Theodore Wynnychenko  wrote:
>> # /usr/local/sbin/snmpd -L e
>> kvm_openfiles: Operation not permitted
>> kvm_openfiles: /dev/mem: Operation not permitted
>
> On 2016-10-06, Stuart Henderson wrote:
>
>> Kernel virtual memory access is no longer permitted by the kernel on a
>> On 2016-10-04, normally running system.  The relevant parts of net-snmp will
> need to be
>> disabled or rewritten.
>
>
> Thank you (again) for the reply.
> Even though I had previously read the (net)snmpd manpage, I went through it
> again, and found (apparently, missed it before):
>
>  -r  Do not require root access to run the daemon.  Specifically, do
>  not exit if files only accessible to root (such as /dev/kmem
>  etc.) cannot be opened.
>
> So, I added 'netsnmpd_flags="-r -u _netsnmp -I -ipv6"' to /etc/rc.conf.local,
> and netsmtpd now starts without as expected.
>
> # rcctl start netsnmpd
> netsnmpd(ok)
>
> Thanks again
>
>

Ah nice, thanks for tracking that down. I've modified the rc.d script in
-current to set this.



Re: netsnmpd Fails to Start on Current [Solved]

2016-10-08 Thread Theodore Wynnychenko
On 2016-10-04, Theodore Wynnychenko  wrote:
> # /usr/local/sbin/snmpd -L e
> kvm_openfiles: Operation not permitted
> kvm_openfiles: /dev/mem: Operation not permitted

On 2016-10-06, Stuart Henderson wrote:

> Kernel virtual memory access is no longer permitted by the kernel on a
> On 2016-10-04, normally running system.  The relevant parts of net-snmp will
need to be
> disabled or rewritten.


Thank you (again) for the reply.
Even though I had previously read the (net)snmpd manpage, I went through it
again, and found (apparently, missed it before):

 -r  Do not require root access to run the daemon.  Specifically, do
 not exit if files only accessible to root (such as /dev/kmem
 etc.) cannot be opened.

So, I added 'netsnmpd_flags="-r -u _netsnmp -I -ipv6"' to /etc/rc.conf.local,
and netsmtpd now starts without as expected.

# rcctl start netsnmpd
netsnmpd(ok)

Thanks again



Re: netsnmpd Fails to Start on Current

2016-10-06 Thread Stuart Henderson
On 2016-10-04, Theodore Wynnychenko  wrote:
> # /usr/local/sbin/snmpd -L e
> kvm_openfiles: Operation not permitted
> kvm_openfiles: /dev/mem: Operation not permitted

Kernel virtual memory access is no longer permitted by the kernel on a
normally running system.  The relevant parts of net-snmp will need to be
disabled or rewritten.



netsnmpd Fails to Start on Current

2016-10-04 Thread Theodore Wynnychenko
Hello

I updated to the Oct 2 AMD64 snapshot yesterday.
I then updated to the Oct 3 AMD64 snapshot today.

After updating to the Oct 2 snapshot, I noticed that netsnmpd (from packages)
was "failed" on reboot.

I updated all the packages (pkg_add -vui), but had a failure ("bad minor" or
something like that), so then updated to the Oct 3 snapshot today.

# uname -prsv
OpenBSD 6.0 GENERIC.MP#2525 amd64


This time, updating of net-snmp was successful, but "rcctl start netsnmpd" still
returns "failed."

# pkg_info | grep net-snmp
net-snmp-5.7.3p9extendable SNMP implementation

But,

# rcctl -d start netsnmpd
doing _rc_parse_conf
doing _rc_quirks
netsnmpd_flags empty, using default >-u _netsnmp -I -ipv6<
doing _rc_parse_conf /var/run/rc.d/netsnmpd
doing _rc_quirks
doing rc_check
netsnmpd
doing rc_start
doing _rc_rm_runfile
(failed)


# /usr/local/sbin/snmpd -L e
kvm_openfiles: Operation not permitted
kvm_openfiles: /dev/mem: Operation not permitted


I found openbsd-rcd-EuroBSDcon2016.pdf under
https://www.openbsd.org/events.html, and I added a login class for netsnmpd to
/etc/login.conf
---
netsnmpd:\
:openfiles-cur=512:\
:tc=daemon:
---

I didn't think this login.conf change would make a difference, but I did not
think it would hurt either.

I have added "wxallowed" to /usr/local in fstab.

I have no idea what the "kvm_openfiles" errors mean; let alone how to address
it/them.

I would appreciate any advice on how to proceed.

Thanks
Ted