[16:14] hi, is there a way to get dbus signals as events in the upstart daemon? [16:15] fairly trivially with some python [16:16] this is for a embedded device and i don't have any python on that :-( [16:17] i have seen there is s.t. like a upstart-udev-bridge under lucid, would this be a good template to get this [16:17] C? [16:17] yeah, exactly [16:17] functionality into dbus [16:17] you connect to the bus, add a match on the signal, and when you get the signal, you make a method call to Upstart to emit the event [16:20] so it might also be possible to use the upstart dbus interface to emit a new event? [16:20] it is [16:20] com.ubuntu.Upstart0_6.EmitEvent [16:21] http://upstart.ubuntu.com/wiki/DBusInterface [16:28] nice, i think i will use the dbus interface, thanks [16:28] i have btw. integrated upstart into ptxdist.org which is a build system for embedded systems. [16:29] i am planning to get the patches upstream. [16:46] cool [16:55] good bye [17:39] I would like to start the unicorn web server for my rails environment at stat startup as a specific user. Can you point me in the right direction? [17:39] I have found docs for creating startup commands with exec, but nothing that specifies the user [17:41] For now, use su. [17:41] ok, will give that a try. thx [18:23] created a configuration file ( http://pastie.org/980315) in /etc/init. But I'm not sure how to test it. I tried -- sudo start priver -- but get --- start: Unknown job: priver [18:24] per the docs here : http://upstart.ubuntu.com/getting-started.html [18:24] I'm sure I'm missing something simple. [18:28] ion: any ideas? [18:33] 0) Unicorn is a service, not a task. 1) Running su in a pre-start script has no effect on the exec. (Btw, you can use ; instead of && since the script is run with set -e.) 2) The specific problem that caused Upstart not to recognize the job at all is a syntax error (as you’ll find in your syslog), namely that ‘pre-start blah’ is invalid syntax; you’d use ‘pre-start exec blah’ or a pre-start script. [18:34] exec su -c 'set -e; ...' username, or something like that [18:36] ion: Thanks! I will work on that and see if I get any further :) [18:38] exec su -c 'set -e; cd PATH; exec unicorn_rails blahblah' username, where the parameters for unicorn_rails make it not daemonize/fork. [18:39] Also, you probably don’t want it to start on startup, but instead when there’s a writeable filesystem etc. [18:39] ‘start on filesystem’ may or may not suffice. [19:24] ion: Making some headway! But when I run the job --> start priverpriver I get --> start/running, process 4954, but the process isn't in the process list. I've tested this --> set -e; cd /home/prweb/priver_002/; unicorn_rails -p 59504 directly on the command line and it works. [19:25] unicorn_rails probably forks then. You’ll need to make it not fork/daemonize. :-) [19:27] I think by design unicorn creates a fork(s). Would it be better to use script instead of exec, if thats the case? [19:28] That’s not relevant. [19:29] Judging from http://unicorn.bogomips.org/unicorn_rails_1.html, it shouldn’t daemonize without -D. Dunno why it does, then. [19:30] Ok, so that I understand this a little better, why can't it start as a daemon? [19:30] What does status priverpriver say? [19:31] status: Unable to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [19:31] Your dbus service seems to be dead. Try sudo status priverpriver for now. [19:33] sudo status priver --> priver stop/waiting [19:34] Just as an FYI, I'm on a new Ubuntu 10.04 server install with all current updates. [19:34] If you run unicorn_rails -p 59504 from the command line, does it daemonize or stay in the foreground? [19:37] it stays in the foreground. [19:40] Here is the example output from my test server --> http://pastie.org/980495 [19:46] Ok, so daemonizing is not the problem. [19:46] Please share your current job definition. [19:48] Here is my current def --> http://pastie.org/980518 [19:51] (You may want to change ‘...; unicorn_rails ...’ to ‘...; exec unicorn_rails ...’, but that’s not the problem here, it just doesn’t leave an extra shell process running that way.) [19:52] script [19:52] exec >/home/prweb/priver_002/job.log 2>&1 [19:53] set -x [19:53] exec su -c 'set -ex; cd /home/prweb/priver_002/; exec unicorn_rails -p 59504 --host 192.168.1.15' prweb [19:53] end script [19:53] Try that. Anything interesting in job.log? [19:57] This was in the log -- bash: line 0: exec: unicorn_rails: not found [19:57] It doesn't seem to be getting the users environment ? [19:57] Ok, try /path/to/unicorn_rails [20:02] I tried it with the full path to unicorn_rails, and I'm getting the same results.. [20:03] Of course everything works correctly when I execute the command directly from the shell. [20:04] It says “exec: /.../unicorn_rails: not found”? [20:09] Getting this in the log --> /home/prweb/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/site_ruby/1.9.1/rubygems.rb:779:in `report_activate_error': Could not find RubyGem unicorn (>= 0) (Gem::LoadError) [20:12] Ok, you’ll need to insert a command to load the rvm environment before executing unicorn_rails. [20:13] exec su -c 'set -e; . /home/prweb/.rvm/scripts/rvm; exec ...' prweb [20:13] it seems [20:19] Excellent!!! That finally did the trick.. Couldn't have done this without you help. Many, Many Thanks!!! [22:27] um [22:28] I'm trying to boot up Linux on a USB stick with Upstart as the init daemon [22:28] but for some reason, it's not doing any jobs nor listening for ctrl-alt-del (it doesn't trigger a reboot) [22:29] it seems like it dies right after startup [22:29] any ideas?