/srv/irclogs.ubuntu.com/2013/04/17/#upstart.txt

twbAs at Ubuntu 10.04 (upstart 0.6.5-8), where do default ulimits come from, when they're not set in the init job?  Is it just /etc/security/limits.conf like normal?02:11
twbApparently I have a python daemon that's cracking the shits about only being allowed to open 500 files at once, and I can't see where that's being set on my server.02:12
twbHm, /proc/N/limits says $user is lying, since that limit is set to 1024/409602:13
salty-horsehi. this is a bit off-topic. does start-stop-daemon allow two separate services that use the same <command> in "start-stop-daemon --exec <command>" ?10:03
xnoxsalty-horse: sure, why wouldn't it? each invocation of start-stop-daemon doesn't know about any other invocations.10:07
xnoxsalty-horse: make sure you use more parameters to identify which instance is which (e.g. using pidfiles, etc)10:08
xnoxjodh: awesome inotify branch !10:08
jodhxnox: thanks :)10:08
salty-horsexnox, thanks! so should I use --pidfile instead of --exec? what if both commands have the same --exec but different --pidfiles? would that be enough to differentiate them? or does it make no sense to have several "matching" flags?10:10
xnoxsalty-horse: "--exec foo --pidfile minifoo.pid" and "--exec foo --pidfile bigfoo.pid" are different and thus correct one will be stopped/reloaded/restarted/etc10:13
xnoxsalty-horse: but e.g. I'd rather recommend you to use upstart & it's support for instances =)10:13
salty-horsexnox, in my case, each so called "instance" has different flags. does this still fit the definition of upstart instances?10:16
salty-horseI'm specifically trying to run both a mongodb "regular server" and a mongodb "config server". someone copied the upstart conf file, and modified it, but now both files have the same --exec, and only one of them has a --pidfile. so they stepped on each other's toes and I could not start both at the same time10:17
salty-horseI sense setting a --pidfile on both is the simplest solution10:17
xnoxsalty-horse: it should, but it all depends on your usecase. E.g. /etc/init/network-interface.conf defines "instance $INTERFACE" thus one gets a running job per each configured network interface. There are other examples, just grep for "instance" in /etc/init/10:18
xnoxsalty-horse: using a human-identifiable "instance $NAME" will get you what you want, e.g. "production", "staging", "testing", "dev" ...... mongodb servers =)10:19
xnoxbut it kind of assumes that you can structure all your mongodb servers in a homogenic way. E.g. for each of them you start up with --config /etc/mondonbd/$NAME.config10:19
xnoxor shell you have shell to select what ever you need based on the instance name =)10:20
xnox(e.g. any options, ports, etc....)10:20
salty-horsexnox, from what I'm reading about isntances, they require an extra parameter on the startup command. I'd rather not deal with variables. I want a simple "service NAME start"10:23
xnoxsalty-horse: then create different jobs for each one. Or you can create wrapper jobs: e.g. configmongodb.conf will simply have "start mongodb NAME=config", and all the common-logic will be in the mongodb.conf10:34
xnoxsalty-horse: that way you aid maintainance, by not repeating the same snippet in each job.10:35
xnoxsalty-horse: or have normal jobs, without instances, but source shell in pre-start script if there is anything significant to share between each mongo jobs.10:36
salty-horsethat seems overkill for my current problem, but I appreciate the knowledge for future configurations. if a job only has "start ..." does upstart still knows how to shut it down correctly?10:37
xnoxsalty-horse: good point. i think one would also need similar stubs for "stop/restart/reload mongo NAME=config" then in pre|post-start|stop =( 10:39
salty-horse:)10:39
xnoxpossibly something like 5-6 lines in total for the whole conf.10:39
xnoxcause one would simply test what the goal is in "pre-start" & "pre-stop" & "post-start"10:39
xnox*sigh*10:40
salty-horsethanks a bunch. sorry for depressing you about upstart inflexibility. at least now you can add a new keyword that does that magic10:52
xnoxsalty-horse: nah, it's ok =) if I complain about upstart, I'm the one who has to implement features in it ;-)11:04
leandrosansilvaHello. Is it possible to create custom events? I created a service called service1 and put the code "emit my_event" and I also created another one called service2 and put "start on my_event". But, when I start service1, service2 doesn't start. Probably I'm doing something (everything) wrong, but what?11:28
leandrosansilvaCurrently I'm reading the upstart cookbook, but there's much do be seen there11:28
xnoxleandrosansilva: instead of emitting & catching events you can simply do: "start service2" in service1.conf, or in service2.conf "start on started service1"11:29
xnoxleandrosansilva: can you please pastebit full jobs. Did you declare that service1 emits events using "emits" stanza? http://upstart.ubuntu.com/cookbook/#emits11:30
leandrosansilvaThe problem this is just a test. I really don't need these services. In fact I need to start a service as soon the network starts (it's a daemon which needs to access some external services on the local network), and I'd like it started on event static-network-up, but it didin't work11:31
leandrosansilvaand I don't want to change the networking service11:31
leandrosansilvaoks, just a minute11:31
xnoxleandrosansilva: please note that once an event is emitted - it's gone, adding new jobs will not "magically notice the event"11:34
xnoxyou can download upstart-gui to monitor the events emitted on the buses.11:35
leandrosansilvaSo I think I must solve my problem in another way11:35
leandrosansilvawhat I need is just this: my daemon must start just after the network is up11:35
xnoxleandrosansilva: please paste your jobs, or describe your problem.11:35
leandrosansilvaand I wouldn't like to change networking.conf to start my daemon there11:36
xnoxleandrosansilva: "start on (local-filesystems and net-device-up IFACE!=lo)"11:37
leandrosansilvamy idea is making my daemon (called capturad) depends on networking11:37
xnoxthat means start onces file-systems got mounted & there is any kind of network connection (non-localhost only)11:37
xnoxleandrosansilva: documented at http://upstart.ubuntu.com/cookbook/#normal-start11:38
leandrosansilvaoh, it's easier than I thought11:38
leandrosansilvaI'll try this11:38
leandrosansilvaa moment...11:38
xnoxleandrosansilva: well you need to reboot to test / generate those events properly =))))11:39
leandrosansilvahum.. So it may be the problem11:39
leandrosansilvaI haven't restarted11:40
leandrosansilvaxnox, wIth a simple daemon, "start on (local-filesystems and net-device-up IFACE!=lo)" seems to work. Let me check with the real daemon. Anyway, thanks a lot for your help!11:45
xnoxno problem11:45
leandrosansilvaxnox, I've tested with the real daemon and it worked correctly. Thx again11:58

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