/srv/irclogs.ubuntu.com/2016/07/23/#upstart.txt

AnrDaemon:F00:00
AnrDaemonhttp://upstart.ubuntu.com/cookbook/#env00:01
SteenJobswell there ya go haha00:01
SteenJobsAnrDaemon: dude!!!!!00:07
AnrDaemonSure?00:07
SteenJobsok - i finally got running bundle exec god status in the proj dir to == service god status00:07
SteenJobsand starting the job works00:07
SteenJobsonly odd thing, is once again after running service god start, i run service god status and it returns stop/waiting00:08
AnrDaemonI hear "but" in your wake.00:08
SteenJobshaha00:08
AnrDaemonSounds like it is detaching.00:08
AnrDaemonWhen you initctl stasrt, it tells you the PID it was tracking.00:08
SteenJobsyet bundle exec god status still knows that it’s running somehow00:08
SteenJobsyep00:09
AnrDaemonCheck the running bundle, and its pid/ppid.00:09
AnrDaemonIf it forks regardless of your intent and specification, you may either need to revise your switches, or play with expect.00:09
SteenJobswhen i started, PID was 22221, but checking ps aux has “root 22512 /home/root/apps/my_app/shared/bundle/ruby/2.3.0/bin/god00:10
AnrDaemonppid?00:14
SteenJobsfixed00:14
SteenJobsplease don’t kill me00:14
SteenJobsi forgot the -D00:15
SteenJobs:-D00:15
SteenJobsi meant that to come out in text form, it would’ve been an emoji pun00:15
SteenJobsok, adding respawn and let’s see what happens when i kill it00:15
SteenJobsthis 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:15
AnrDaemonThat's wrong line.00:16
SteenJobsholy crap it all works00:16
AnrDaemonRemove bash, start it directly.00:16
SteenJobsbut i’m listening00:16
AnrDaemonElse it will be tracking bash PID, not your service PID.00:17
SteenJobsAnrDaemon: 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
SteenJobsalthough i ran kill -9 PID after adding respawn, checked status, and it’s running00:17
AnrDaemonThey are deeply mistaken, that's all.00:18
AnrDaemonIf it needs $HOME, then define env HOME=/...00:18
SteenJobsright00:18
SteenJobslearned that already :)00:18
SteenJobsbut i meant at the bottom, they explain the bash line00:18
AnrDaemonbash -l makes it act as login shell, settign environment and all that stuff.00:19
AnrDaemonSuffice to say, I've managed to start VirtualBox via upstart :P00:19
SteenJobshaha word00:19
SteenJobsyea, but rvm requires that kind of enivornment loading00:20
SteenJobsi removed bash -l -c00:20
SteenJobsand it broke things00:20
SteenJobsit now shuts down immediately again00:20
AnrDaemonIf it actually reuires that, whoever wrote it must be lashed and chained to the table until it fix the thing right.00:21
SteenJobsi lied00:22
SteenJobsit’s because i didn’t remove the quotes00:22
SteenJobssmh00:22
SteenJobswe’re in business00:22
SteenJobsyou are a champ, truly00:22
SteenJobsAnrDaemon: 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.00:24
=== JanC is now known as Guest34809
=== JanC_ is now known as JanC
SteenJobshey 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:45
AnrDaemonDid you set HOME to an absolute path in your job config?16:52
SteenJobshaha hey :)17:00
SteenJobsnope - ran echo $HOME and it gives me /home/deploy17:01
SteenJobsso it’s not even set within the God config file17:01
SteenJobsmeaning i don’t set it there, since it’s already set17:01
SteenJobs(tried adding HOME anyway, as /home/deploy, and it didn’t work either…only thing that worked was removing setgid/setuid)17:01
AnrDaemonI mean, did you set "env HOME=/whatver/something" in the init script?17:05
SteenJobsAnrDaemon: ahh, no, i was setting RAILS_ROOT which i thought was missing, but that sounds like what was missing - will give it a go17:08
AnrDaemonIf these idiots run "bash -l" to start their service, then the most likely missing bit is user environmant, particularly $HOME.17:09
SteenJobshahah17:11
SteenJobstis 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 find17:12
SteenJobsIRC is basically how i learned how to legitimately code17:12
AnrDaemonLegi... wat.17:21

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!