[00:00] <AnrDaemon> :F
[00:01] <AnrDaemon> http://upstart.ubuntu.com/cookbook/#env
[00:01] <SteenJobs> well there ya go haha
[00:07] <SteenJobs> AnrDaemon: dude!!!!!
[00:07] <AnrDaemon> Sure?
[00:07] <SteenJobs> ok - i finally got running bundle exec god status in the proj dir to == service god status
[00:07] <SteenJobs> and starting the job works
[00:08] <SteenJobs> only odd thing, is once again after running service god start, i run service god status and it returns stop/waiting
[00:08] <AnrDaemon> I hear "but" in your wake.
[00:08] <SteenJobs> haha
[00:08] <AnrDaemon> Sounds like it is detaching.
[00:08] <AnrDaemon> When you initctl stasrt, it tells you the PID it was tracking.
[00:08] <SteenJobs> yet bundle exec god status still knows that it’s running somehow
[00:09] <SteenJobs> yep
[00:09] <AnrDaemon> Check the running bundle, and its pid/ppid.
[00:09] <AnrDaemon> If it forks regardless of your intent and specification, you may either need to revise your switches, or play with expect.
[00:10] <SteenJobs> when i started, PID was 22221, but checking ps aux has “root 22512 /home/root/apps/my_app/shared/bundle/ruby/2.3.0/bin/god
[00:14] <AnrDaemon> ppid?
[00:14] <SteenJobs> fixed
[00:14] <SteenJobs> please don’t kill me
[00:15] <SteenJobs> i forgot the -D
[00:15] <SteenJobs> :-D
[00:15] <SteenJobs> i meant that to come out in text form, it would’ve been an emoji pun
[00:15] <SteenJobs> ok, adding respawn and let’s see what happens when i kill it
[00:15] <SteenJobs> this is the line that saved it btw: exec bash -l -c '/usr/local/rvm/bin/rvm default do bundle exec god -D -c config/app.god -l log/god.log'
[00:16] <AnrDaemon> That's wrong line.
[00:16] <SteenJobs> holy crap it all works
[00:16] <AnrDaemon> Remove bash, start it directly.
[00:16] <SteenJobs> but i’m listening
[00:17] <AnrDaemon> Else it will be tracking bash PID, not your service PID.
[00:17] <SteenJobs> AnrDaemon: look at the bottom of this - http://www.grant-olson.net/news/2014/03/20/upstart_config_for_god.html - i wasn’t sure exactly why they use that, but i figured i’d give it a shot. i’ll remove it and see what happens.
[00:17] <SteenJobs> although i ran kill -9 PID after adding respawn, checked status, and it’s running
[00:18] <AnrDaemon> They are deeply mistaken, that's all.
[00:18] <AnrDaemon> If it needs $HOME, then define env HOME=/...
[00:18] <SteenJobs> right
[00:18] <SteenJobs> learned that already :)
[00:18] <SteenJobs> but i meant at the bottom, they explain the bash line
[00:19] <AnrDaemon> bash -l makes it act as login shell, settign environment and all that stuff.
[00:19] <AnrDaemon> Suffice to say, I've managed to start VirtualBox via upstart :P
[00:19] <SteenJobs> haha word
[00:20] <SteenJobs> yea, but rvm requires that kind of enivornment loading
[00:20] <SteenJobs> i removed bash -l -c
[00:20] <SteenJobs> and it broke things
[00:20] <SteenJobs> it now shuts down immediately again
[00:21] <AnrDaemon> If it actually reuires that, whoever wrote it must be lashed and chained to the table until it fix the thing right.
[00:22] <SteenJobs> i lied
[00:22] <SteenJobs> it’s because i didn’t remove the quotes
[00:22] <SteenJobs> smh
[00:22] <SteenJobs> we’re in business
[00:22] <SteenJobs> you are a champ, truly
[00:24] <SteenJobs> AnrDaemon: aright, i’m really really late for my dinner so i gotta run, but honestly thank you so much. you can’t even begin to understand how much i appreciate the help.
[16:45] <SteenJobs> hey room that saved my butt yesterday - when setting setuid/setgid to deploy on my production server, when starting my service, my Rails config files throw a “non-absolute home” error…any idea why?
[16:52] <AnrDaemon> Did you set HOME to an absolute path in your job config?
[17:00] <SteenJobs> haha hey :)
[17:01] <SteenJobs> nope - ran echo $HOME and it gives me /home/deploy
[17:01] <SteenJobs> so it’s not even set within the God config file
[17:01] <SteenJobs> meaning i don’t set it there, since it’s already set
[17:01] <SteenJobs> (tried adding HOME anyway, as /home/deploy, and it didn’t work either…only thing that worked was removing setgid/setuid)
[17:05] <AnrDaemon> I mean, did you set "env HOME=/whatver/something" in the init script?
[17:08] <SteenJobs> AnrDaemon: ahh, no, i was setting RAILS_ROOT which i thought was missing, but that sounds like what was missing - will give it a go
[17:09] <AnrDaemon> If these idiots run "bash -l" to start their service, then the most likely missing bit is user environmant, particularly $HOME.
[17:11] <SteenJobs> hahah
[17:12] <SteenJobs> tis why despite using resources i find online, IRC is always my last step, both to learn things that i couldn’t find, and to verify those things i did find
[17:12] <SteenJobs> IRC is basically how i learned how to legitimately code
[17:21] <AnrDaemon> Legi... wat.