Open nyxnor opened 2 years ago
Now if I do /etc/rc.d/vanguards
#!/bin/ksh
#
# $OnionJuggler: Vanguards,v ${vanguards_version} $(date +%Y/%m/%d' '%H:%M:%S) rpe Exp $
daemon="/usr/local/bin/vanguards"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1
and in /usr/local/bin/vanguards
#!/usr/bin/env sh
python3 /var/tor/vanguards/src/vanguards.py --config /etc/tor/vanguards.conf --logfile /var/log/vanguards
I see on /var/log/vanguards:
NOTICE[Tue Dec 21 2021]: Vanguards 0.4.0-dev1 connected to Tor 0.4.6.7 using stem 1.8.0
NOTICE[Tue Dec 21 2021]: Vanguards successfilly applied config options from /etc/tor/vanguards.conf
NOTICE[Tue Dec 21 2021]: Connected to Tor via 127.0.0.1 control port
NOTICE[Tue Dec 21 2021]: Connected to Tor via 127.0.0.1 control port
NOTICE[Tue Dec 21 2021]: Vanguards 0.4.0-dev1 connected to Tor 0.4.6.7 using stem 1.8.0
NOTICE[Tue Dec 21 2021]: Vanguards 0.4.0-dev1 connected to Tor 0.4.6.7 using stem 1.8.0
Fortunately it does not quit after rc fails, but it means it is connecting to vanguards at least but not working as an rc script
$ doas rcctl -d restart vanguards
doing _rc_parse_conf
doing _rc_quirks
vanguards_flags empty, using default ><
doing _rc_parse_conf /var/run/rc.d/vanguards
doing _rc_quirks
doing _rc_parse_conf
doing _rc_quirks
vanguards_flags empty, using default ><
doing _rc_parse_conf /var/run/rc.d/vanguards
doing _rc_quirks
doing rc_check
doing _rc_parse_conf
doing _rc_quirks
vanguards_flags empty, using default ><
doing rc_check
vanguards
doing rc_start
doing _rc_wait start
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
doing rc_check
Alarm clock
/etc/rc.d/vanguards: kill: 95135: No such process
doing _rc_write_runfile
(timeout)
$ doas rcctl -d check vanguards
doing _rc_parse_conf
doing _rc_quirks
vanguards_flags empty, using default ><
doing _rc_parse_conf /var/run/rc.d/vanguards
doing _rc_quirks
vanguards
doing rc_check
(failed)
I am trying to run Vanguards and restart/start/stop as a daemon on OpenBSD. Currently it is failing. File inside /etc/rc.d/vanguards mod 755 root:wheel
the error: probably because it is a python script, not shellscript
I have to reassign rcexec because it expects /bin/sh, which will faill of course. Alternatively, I could include a start script inside vanguards repository for calling the python interpreter.