Conversation with #inferno at Sat Dec 25 15:57:29 2010 on powerman-asdf@irc.freenode.net (irc) (15:57:29) hubbard.freenode.net: (notice) [freenode-info] if you're at a conference and other people are having trouble connecting, please mention it to staff: http://freenode.net/faq.shtml#gettinghelp (15:57:44) base2design [~stewarj@97-80-161-40.dhcp.gwnt.ga.charter.com] entered the room. (16:00:59) base2design: i'm starting emu and a test app from a shell script and want to return an exit code back to that shell when the emu session is done. is this a "standard practice" and if so, how do you accomplish this? (16:01:37) base2design: (i have not RTFS, ;-)) (16:13:17) base2design left the room (quit: Quit: base2design). (16:22:14) base2design [~stewarj@97-80-161-40.dhcp.gwnt.ga.charter.com] entered the room. (16:34:09) base2design: Mechiel, you're awesome... thanks for posting all your code. You're really giving me a great jumpstart on my limbo experiments! (16:40:05) powerman: base2design: I don't think it's possible to control emu's exit status (16:41:17) powerman: If you can control stdout/stderr output of your test app, then you can output exit status to, say, stderr, and then catch stderr's output of emu in shell script (16:41:24) base2design: that was my guess although i was hoping... (16:41:59) base2design: yeah, stdout or other file output is probably the most portable option. (16:42:19) base2design: thanks powerman! (16:42:21) powerman: I usually run emu as a service, so if it exits - something goes wrong, and it should be restarted. (16:42:46) base2design: what host os are you using? (16:42:50) powerman: Linux (16:43:01) base2design: so is it started as root? (16:43:25) powerman: No. I run emu under service supervisor - runit's runsv (fork of DJB's daemontools). (16:45:25) base2design: hmmm... need to look at that closer... and best-practice for letting emu use socket ports < 1024? (16:47:14) powerman: It can be started as root, but I prefer to avoid starting as root services which doesn't need root privileges. So, I run runsvdir from usual user's crontab every minute, using file locks to guarantee only one runsvdir will be started simultaneously. This way user's services and their supervisors will be automatically started after server's reboot. Using something like this in cron: (16:47:14) powerman: */1 * * * * cd /path/to/project/dir || exit; exec chpst -L var/.lock.service runsvdir service/ &>/dev/null (16:49:02) powerman: Personally, I prefer to setup port forwarding from privileged ports as root to non-privileged port at localhost. But this may be security risk if there untrusted users on same server who may intercept this port. (16:51:27) base2design: in the past (at least for my non-inferno toys), i've used port mapping. just didn't know if that was still the best way. i never like to run anything as root if i don't have to. (16:58:33) powerman: but, which privileges ports you need for inferno? if you wanna run it as main http server, for example, I think it's better to run emu as root's service. I think it even may be possible to drop privileges after opening privileges port for listening - see runas(1) (17:30:28) Fish [~Fish@ARennes-752-1-23-56.w90-32.abo.wanadoo.fr] entered the room. (18:16:28) base2design left the room (quit: Quit: base2design). (18:23:20) fdd [~algol@unaffiliated/fdd] entered the room. (20:06:57) stevie77de [none@brln-4db9ddff.pool.mediaWays.net] entered the room. (20:51:11) Fish left the room (quit: Ping timeout: 265 seconds). (20:53:34) Fish [~Fish@ARennes-752-1-23-56.w90-32.abo.wanadoo.fr] entered the room. (21:16:43) Fish left the room (quit: Ping timeout: 276 seconds). (21:18:26) Fish [~Fish@ARennes-752-1-23-56.w90-32.abo.wanadoo.fr] entered the room. (21:40:56) Fish left the room (quit: Ping timeout: 250 seconds). (21:43:18) Fish [~Fish@ARennes-752-1-23-56.w90-32.abo.wanadoo.fr] entered the room. (23:04:48) bvalek2 left the room (quit: Quit: Page closed). (00:04:04) Fish left the room (quit: Quit: So Long, and Thanks for All the Fish). (00:30:49) stevie77de left the room. (01:13:07) fdd left the room (quit: Quit: 10100011010101000011100101.00.). (02:34:04) mjl-_ [~mjl@541B0E79.cm-5-4a.dynamic.ziggo.nl] entered the room. (02:39:10) mjl- left the room (quit: *.net *.split). (12:39:56) The account has disconnected and you are no longer in this chat. You will be automatically rejoined in the chat when the account reconnects.