Re: rc.subr: $pexp does not always contain daemon flags?

2015-06-20 Thread nusenu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

 On Tue, Jun 16, 2015 at 01:32:11PM +, nusenu wrote:
 Rebooting (without changing the config) solves the issue
 but is not really an option.
 
 I cannot reproduce here.
 
 I can reproduce it every (first) time on multiple fresh OpenBSD
 5.7 machines. I'm using ansible to automate the entire setup. I
 assume timing plays a role here (that is probably why automation
 matters).
 
 If you want to try to reproduce it (on a test machine) with
 ansible. You can find the ansible role here:
 
 Thanks. I will have a look then. But do note that I am using
 current -- so that may explain why I did not see this issue.

Problem solved.

My ansible role reloaded the service before setting the flags.
-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVhY7/AAoJEFv7XvVCELh05gkQAJXcLrxnsVtLxTeyuv4MCNPL
8pUZ+L4I02aPtCruozvSTVTV1+8kV8+U+wd479KuZVh2G6gTufosQT9twNduRdIY
BVxhCe9vD842FZ9AVNLs1ACdWmrAW3zwdoDqm6AXBinEoCo92JjElNefYGxJdHFg
gi9HSJPz+q2OYjetHejCDmdqGi4MXQ2Un/J7hm0+Gey8/1UeWYKQ6I6Opob0bwzj
DUX0J+aRKQ93nnRkY1LPI/KPi9E+XrtratGkaDAsxEKO57nzgPkRv97ROyHD5DN/
wk/EZNdsCKuYFcKsdN5BprXP5AWlmC+Ci9G4fs7/4irAY1BbVLxrzeQn+Hdy6JG8
hjNqz4/Xg/pIGuoOoMpf4IU52XlRjt5B9VWdFcwL+1URftk2Z7eXfTHmBs/KLGtN
q/BWte6a0J1Bxsp0OpM5E66KI8MvoQyk2zZiFAPPfpqtiN5bAc907xzyFX9hwWd5
4RytEp8aLGsXNk5rVuMXcTrL/II9sYdkGXaZyVtrNd/i/vDzt2vDwkk8/F/w2eTs
QjT3aUR/s/Fz20BYeOHKhLi5T+dP69iMYvI0y1aEKMST5nYUZs/ZkjhSrCr3RheD
zV3hR8MPsmyt6f5/hvSYlnkS5yH4ntorFuIu2YSb9Hwfe7SFLY8X962pioD25grQ
cSNqs88bMaaTOmsignyt
=nLZJ
-END PGP SIGNATURE-



Re: rc.subr: $pexp does not always contain daemon flags?

2015-06-16 Thread nusenu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

 Rebooting (without changing the config) solves the issue but is
 not really an option.
 
 I cannot reproduce here.

I can reproduce it every (first) time on multiple fresh OpenBSD 5.7
machines.
I'm using ansible to automate the entire setup. I assume timing plays
a role here (that is probably why automation matters).

If you want to try to reproduce it (on a test machine) with ansible.
You can find the ansible role here:

https://github.com/nusenu/ansible-relayor
(dependency: /usr/ports has to be in place already)
running the openbsd tag is enough:
ansible-playbook tor.yml --tags openbsd

but I'll also try to provide a reproducer without ansible.
-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVgCVbAAoJEFv7XvVCELh0jewP/Rfsallexgu4DaiC6tajSecp
Of7f/XkcO9Ag9O2MO6bZrkZy/tr1SsMXUPly1Ewb2KdlyjUsYLy5/CLy+BcTLS11
gel7xMPkhO21i7udbXQFX9IS2tSlwJ/pHZLvgEgXZSQE6xnbprPJV9LzMPoSG2e3
+Z4hR/iNv78L0MwPnTe4AfNg0mNYmWclPJc7PDI29tm1dDQhgNQZculqFp9zdTvJ
ofsxqvd5j+0mYnfeFGwCbnh58j0zST4oB5mcijuVLVICl9rjwcZOrDG1cGfjbnhX
ke4gZCJxPxqOvR3lcG4xemGILi2AaIu7raxBBEyuXAZDx8Ty4j68haiEp4Oo1DoD
s6adSKQJrSDBKst171al/CRmbd9HI+KVY5/PMp3tYTfxrgVn4RI3Ax0LPLKA/qa0
HZLoKC7FKrlOVVAvdvUx1uaVlYdoZB2vfYDYzLh+9J4DuUQuUyTbXa0TqtsLR3oR
jWGOOwP2SvBGxztigbDBEBEg7QKAW9C7y3on/0TFYEvQ8FvycuvomRpq+/9zVW8H
c2XIYMzMX/Tji5nkpHhR6hVjbL46rkSCgLvsLyTMES4OS1GozXAH2m+tAza8yBaq
iSxSsJNDQKn+sJYWEh4Cgw1VnOKAf47JQ3tAKUpjKQrUSe+NCAM0yS475ZnCE+W1
yS62+HxyxC1YXqhMb1oL
=lZr/
-END PGP SIGNATURE-



Re: rc.subr: $pexp does not always contain daemon flags?

2015-06-16 Thread Antoine Jacoutot
On Tue, Jun 16, 2015 at 01:32:11PM +, nusenu wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512
 
  Rebooting (without changing the config) solves the issue but is
  not really an option.
  
  I cannot reproduce here.
 
 I can reproduce it every (first) time on multiple fresh OpenBSD 5.7
 machines.
 I'm using ansible to automate the entire setup. I assume timing plays
 a role here (that is probably why automation matters).
 
 If you want to try to reproduce it (on a test machine) with ansible.
 You can find the ansible role here:

Thanks. I will have a look then.
But do note that I am using current -- so that may explain why I did not see 
this issue.


 
 https://github.com/nusenu/ansible-relayor
 (dependency: /usr/ports has to be in place already)
 running the openbsd tag is enough:
 ansible-playbook tor.yml --tags openbsd
 
 but I'll also try to provide a reproducer without ansible.
 -BEGIN PGP SIGNATURE-
 
 iQIcBAEBCgAGBQJVgCVbAAoJEFv7XvVCELh0jewP/Rfsallexgu4DaiC6tajSecp
 Of7f/XkcO9Ag9O2MO6bZrkZy/tr1SsMXUPly1Ewb2KdlyjUsYLy5/CLy+BcTLS11
 gel7xMPkhO21i7udbXQFX9IS2tSlwJ/pHZLvgEgXZSQE6xnbprPJV9LzMPoSG2e3
 +Z4hR/iNv78L0MwPnTe4AfNg0mNYmWclPJc7PDI29tm1dDQhgNQZculqFp9zdTvJ
 ofsxqvd5j+0mYnfeFGwCbnh58j0zST4oB5mcijuVLVICl9rjwcZOrDG1cGfjbnhX
 ke4gZCJxPxqOvR3lcG4xemGILi2AaIu7raxBBEyuXAZDx8Ty4j68haiEp4Oo1DoD
 s6adSKQJrSDBKst171al/CRmbd9HI+KVY5/PMp3tYTfxrgVn4RI3Ax0LPLKA/qa0
 HZLoKC7FKrlOVVAvdvUx1uaVlYdoZB2vfYDYzLh+9J4DuUQuUyTbXa0TqtsLR3oR
 jWGOOwP2SvBGxztigbDBEBEg7QKAW9C7y3on/0TFYEvQ8FvycuvomRpq+/9zVW8H
 c2XIYMzMX/Tji5nkpHhR6hVjbL46rkSCgLvsLyTMES4OS1GozXAH2m+tAza8yBaq
 iSxSsJNDQKn+sJYWEh4Cgw1VnOKAf47JQ3tAKUpjKQrUSe+NCAM0yS475ZnCE+W1
 yS62+HxyxC1YXqhMb1oL
 =lZr/
 -END PGP SIGNATURE-
 

-- 
Antoine



Re: rc.subr: $pexp does not always contain daemon flags?

2015-06-16 Thread Antoine Jacoutot
 Rebooting (without changing the config) solves the issue but is not
 really an option.

I cannot reproduce here.

# /etc/rc.d/tor1921682553680 -d check 
doing _rc_parse_conf
doing _rc_quirks
tor1921682553680_flags -f /etc/tor/enabled/192.168.255.36_80.torrc
doing _rc_read_runfile
tor1921682553680
doing rc_check
DEBUG: rc_check: pexp: /usr/local/bin/tor -f 
/etc/tor/enabled/192.168.255.36_80.torrc
(ok)
# /etc/rc.d/tor19216825536443 -d check
doing _rc_parse_conf
doing _rc_quirks
tor19216825536443_flags -f /etc/tor/enabled/192.168.255.36_443.torrc
doing _rc_read_runfile
tor19216825536443
doing rc_check
DEBUG: rc_check: pexp: /usr/local/bin/tor -f 
/etc/tor/enabled/192.168.255.36_443.torrc
(ok)


Check the content of /var/run/rc.d/tor*, it lists the pexp.

-- 
Antoine



rc.subr: $pexp does not always contain daemon flags?

2015-06-15 Thread nusenu
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Hi,

I'm having a problem with rc.subr to start two instances of a tor
daemon with distinct daemon flags.

I'm simply linking to /etc/rc.d/tor:
ls -l /etc/rc.d/tor*
/etc/rc.d/tor
/etc/rc.d/tor192168028443 - /etc/rc.d/tor
/etc/rc.d/tor19216802880 - /etc/rc.d/tor

/etc/rc.conf.local contains (managed via rcctl):

pkg_scripts=tor19216802880 tor192168028443
tor192168028443_flags=-f /etc/tor/enabled/192.168.0.28_443.torrc
tor19216802880_flags=-f /etc/tor/enabled/192.168.0.28_80.torrc

the *443 instance works as expected ($pexp contains flags):

# /etc/rc.d/tor192168028443 -d check

doing _rc_parse_conf
doing _rc_quirks
tor192168028443_flags -f /etc/tor/enabled/192.168.0.28_443.torrc
doing _rc_read_runfile
tor192168028443
doing rc_check
DEBUG: rc_check: pexp: /usr/local/bin/tor -f
/etc/tor/enabled/192.168.0.28_443.torrc
(ok)


but why are the daemon flags not included in the second case?

# /etc/rc.d/tor19216802880 -d check
doing _rc_parse_conf
doing _rc_quirks
tor19216802880_flags -f /etc/tor/enabled/192.168.0.28_80.torrc
doing _rc_read_runfile
tor19216802880
doing rc_check
DEBUG: rc_check: pexp: /usr/local/bin/tor
(ok)



I added that debug line via:

diff rc.subr.orig  rc.subr
152a153
 echo DEBUG: rc_check: pexp: $pexp


Rebooting (without changing the config) solves the issue but is not
really an option.

thanks,
nusenu


-BEGIN PGP SIGNATURE-

iQIcBAEBCgAGBQJVfvZIAAoJEFv7XvVCELh0KrcP/jN78dXKYGY+Xf0BUBb6RaNp
hE8hRdqO00CfrmzyA/DvwAWej2PJaO3QmjGxLam538K1hQvUILqW4EGQSASjEQn2
IiuBFMlQIxhBqwRrolOdMNdmfNhNqpdsFDLX/8TvEDDno+2FUIlidPrLRrhdTI6s
Lbxw0BgvhR00Y8n1jk3wBKVXXCOQlNs6jd1x7aNWR4yNuXGLtkcIIZYOQ6fojhJc
d/InkJUfx4F2EARfKOSs8e4727ROahWEKYbhEzxyTfw8POsAUC9eF2roiQRtzYJS
1LgspAcnbUUUF85hMtMFZK/sz3jgCl6BqrxtLWuj/lcXZ7EsLC+EN8zqZiBwX9oU
vG4c+tvs8HkLeqq+7gCN382uZHjjY8LoYYQkzbSuLxjOdotQwnEpCMEv1xbyudq0
X+pPPFIADRtHRKVm6YjfltQv0C5pff5cNbXP5EXDnsFLqbipXdn9RIVuEQ/P9onQ
hbwJrHfOlJWN2aGSljtbiVUV610cZWUc6kHu40LGnLwdiGzVFO89JntXzyfXPQuR
NrVXbeG1tS9s1ApSCjkj8VNZojsDBTDt/Jt3eWNqC3q+b7d2OgXr+9HLBpg7J7v3
WCcwVu3DYjsyTdJTtefGDdA/La5ihjwvFMBq2BYTLgatpUyO6ffrjTac5dPZg8Er
kzv+VNV0nVYxTGGabWMq
=SiB1
-END PGP SIGNATURE-