I am soo sorry for the noise. doas works as expected, my tar command
just exited silently with an error and rcctl never run as it should.
So sorry for the noise, for the history archives, doas works as expected!
Am 10.02.2021 um 19:25 schrieb Leo Unglaub:
Hey,
i have a problem restarting nsd from a script that is run as doas. I
have read the man page of doas several times, but i dont understand what
i am doing wrong. Maybe someone of you could help me out. That would be
so nice.
My problem is": I have a script called "worker" and i invoce that script
via
doas sh /home/leo/bin/worker
The script looks like this:
#!/bin/sh
tar xf /tmp/queue.tar -C /var/nsd/zonefiles/master
rcctl restart nsd
The tar command gets successfully executed as root and the files get
extracted fine. But the rcctl command does not restart nsd. It just does
nothing. Like it is not executed as root. Do you know what i am doing
wrong here?
My /etc/doas.conf looks like this:
permit nopass leo as root cmd sh args /home/leo/bin/worker
I am sure i am doing a very simple mistake here. But i cannot figure out
what i am doing wrong. Could someone of you please be so kind to send me
to the right direction?
Thanks so much and greetings
Leo