Hello, I will start from the beginning in hope that someone can make some
sense of this.
I have a very simple ruby script that lives in sbin. It sends a get request
every x minutes to ifconfig to check if the pub ip of the machine changed
and sends another get request to no-ip to notify any changes.
the script lives in /usr/local/sbin/ and the script that I wrote under
rc.d/ looks like this:
/etc/rc.d/dynaruby
```
#!/bin/ksh daemon="/usr/local/sbin/dynaruby" name="dynaruby" .
/etc/rc.d/rc.subr rc_start() { echo "Starting $name with key:
$DYNARUBY_KEY" >> /var/log/dynaruby.log /usr/local/sbin/dynaruby } rc_cmd
$1 ```
Following the man page of rc.d and login.conf, I created an entry like this
under /etc/login.conf.d/dynaruby:
dynaruby:setenv=DYNARUBY_KEY=BupCxeBEflVyNK05ypuz25bXuoRc9Rg61qKnOBohyH0=,Xwsirr99KDqkz3Ncytn2AA==:tc=default:
Then, I set dynaruby_flags and pkg_scripts in /etc/rc.conf.local like this:
dynaruby_flags="" dynaruby_enable=yes pkg_scripts=dynaruby
This is everything right? Shouldn't it just work? However when I do "rcctl
start dynaruby" I just get "dynaruby(failed)" (failed because the ruby
script can't find the env variable and it exits with 1).
In /var/log/dynaruby.log, "$DYNARUBY_KEY" is empty, the variable is not
being passed.
I tried having the same entry just in login.conf but with the same results.
I also did the db, did "cap_mkdb", then wiped the whole laptop with a fresh
install and did the configuration you see above. Still the same results.
I will pay someone to take 15 minutes of their time to walk through this
with me in a call while watching the terminal together. I'm really
desperate and I've been hung up on this for over a month.
I'm seriously considering just ditching rc.d and have a "launcher" ksh
script that just exports the env variable to the ruby script, then having
it called by cron on startup and reboot.
--
-DillonWreek