[21:48] I'm trying to run my script as a user ("ubuntu", on AWS) but get "unable to find setuid user" in my syslog [21:49] any ideas? i'm definitely running as ubuntu [21:49] moreso, there's definitely a user named ubuntu [21:52] blah, disregard, needed to reload configuration [21:59] :D [23:16] is anyone here? [23:22] No. Everyone's there. [23:26] haha [23:26] i’ve been struggling for almost two days with an upstart issue, ran into the notorious stop/killed bug, etc. [23:27] and i need to get this working - trying to write an Upstart script for God (the ruby monitoring library, not the Almighty) [23:27] pastebin your progress. [23:27] AnrDaemon: if you have a minute, i’ll gist the script [23:27] ahhhh you’re the best [23:28] thank you thank you. being the only dev at the company right now is no easy task ): [23:30] AnrDaemon: https://gist.github.com/jesiegel1/2ba88ccff85001f3be57c2e2debca893 - i’ve tried multiple iterations of the gisted file - i’ve tried both the approach of using expect fork, and the approach of running god not-daemonized. with the former, running god status within my project dir doesn’t seem to match/recognize the running process from the upstart script, and with the latter, the service stops immediately after starting, [23:30] error. [23:30] (also the exec echo bit was st i only tried a second ago, in a desperate attempt, so you can ignore that) [23:30] Your problem is that you're doing too much in exec. [23:31] 1. Remove respawn, expect. [23:31] 2. Write all preparations in pre-start. [23:31] Is your script intended to run as root? [23:31] AnrDaemon: what about placing it inside a script block? [23:31] and yea - only bec this is the staging server [23:31] on production it’s not root [23:32] Then don't run it as root. [23:32] this is on staging [23:32] Don't use script/end script, if you can avoid it. [23:32] ah ok [23:32] cause that didn’t work either, also stopped immediately [23:32] Doesn't matter. It's much easier to get it working right straight away. [23:32] running as root bec everything is pretty much run as root on staging [23:32] including the location of the app [23:32] -D - is that "daemonize" ? [23:33] and the permissions [23:33] yessir/maam [23:33] Remove it. [23:33] no [23:33] sorry [23:33] opposit [23:33] Ok-ok. [23:33] it’s to run in foreground [23:33] Then that one is right. [23:33] and wouldn’t removing respawn defeat the purpose of making sure God is always running? [23:33] end goal being kill -9 god should result in the process being restarted [23:36] Removing respawn will prevent it respawning endlessly with bad job config. [23:36] Don't add anything like that, until you know you have right syntax and the job generally works. [23:36] Hold a moment, I'll have smth for you to try. [23:37] you are a righteous man my friend [23:39] https://gist.github.com/jesiegel1/2ba88ccff85001f3be57c2e2debca893#gistcomment-1832245 [23:39] Always use absolute paths in init scripts. [23:40] Unless you 100% know what you are doing. [23:40] ah ok cool. good to know. im fairly new to it, although i’ve crammed well, bec the dev in charge of production quit [23:40] gimme a sec, gonna plug it in now [23:40] i need to cd because of running “bundle exec" [23:41] although that’s a lie, i can supply the path for rvm/bundler for it to run [23:41] chdir [23:41] Seriosuly, check the cookbook. [23:42] yea, i’ll read thru it [23:42] i saw you added that, which is why i brought it up [23:42] k trying now [23:43] chdir will change directory before invoking every part of script. [23:43] pre-start, exec, post-start, pre-stop, stop, post-stop… [23:45] very cool - only thing i’m not sure what to plug in is the bundle exec part - i use capistrano for deployment, and in my custom task i run /usr/local/rvm/bin/rvm default do bundle exec, so i’m not quite sure what the path is for bundle. trying to figure that out now [23:45] And check /var/log/upstart/yourjob.log for any clues if it would not start like that. [23:45] yep, that’s what i was doing about 10 minutes ago, finally found it ha [23:46] Here I can't help you, sorry. Not familiar with railcraft. [23:46] haha [23:46] i think i found it - gonna try now [23:46] what’s your jam? do you do web dev? [23:47] I'm using PHP for web. But mainly I do IT support and a little devops. [23:51] nice [23:51] i’m getting job failed to start - nothing in the logs [23:52] That means it either didn't find anything to exec, or there was a very bad initial config. [23:52] wouldn’t it log that though? [23:53] Keep in ming, jobs start with nearly empty environemnt, and no HOME/USER defined. If you need them you gotta defien them by hands. [23:53] It may, but not into job log. And you'd have to run upstart with higher verbosity, probably. [23:54] Sorry, if I'm guessing much, my attempts are normally more successful :) At least, I get something in the log. [23:55] If you failing badly to even get your app to start in the job, try this: [23:55] exec /bin/sh -c 'set' [23:56] Get the environment from the log, and use /usr/bin/env to run your app with a copy of the job's environment. [23:59] when you added env RAILS_ENV=staging, what does that do exactly? [23:59] eh i can just check the docs