/srv/irclogs.ubuntu.com/2010/10/18/#upstart.txt

Benkinoobyhi, i don't have a /etc/init.conf file (the upstart man page (== init man page) lists it under FILES). what is it good for? i have all /etc/init/*.conf files which seem to save the start/stop instructions for each service.10:15
Benkinoobyhello?10:20
phretorhi, this script http://paste.pocoo.org/show/276963/ fires an error due to exec: "Sorry, root is not allowed to run "/usr/bin/Xvfb :99 as foo:bar on host". Any help?14:49
phretoranybody?16:09
Keybukyo16:19
phretorhey Keybuk16:22
Keybukhow goes it?16:22
phretorKeybuk: ah, not bad. Could be better, though16:23
phretorKeybuk: for instance, I could have my Upstart script working properly :) *that** would be "going good"16:24
Keybuk:-)16:24
phretorKeybuk: http://paste.pocoo.org/show/276963/ in case you can spare a few minutes16:25
Keybukthere are many many problems with that script16:25
phretorKeybuk: I bet, it's my first one.16:26
Keybuk"start on startup" is before anything like filesystems are checked or mounted, you better not need to use the disk16:26
Keybukyou don't specify an Upstart version, in the current the second start on will replace the first16:26
Keybukstop on "[016]" doesn't mean anything16:26
Keybukthere is no "pid file" stanza16:27
Keybukeverything between script...end script is a shell script16:27
Keybukcalling exec on the first line means the second won't ever run16:27
Keybukthere is no "emit" command - did you mean "initctl emit" ?16:27
Keybukthere's no need to emit an event when a job is running - Upstart takes care of that for you16:27
Keybuk(on started YOUR_JOB_NAME)16:27
Keybukoh, and does Xvfb _really_ fork?!16:28
phretorKeybuk: it doesn't fork, but from a tutorial I've understood that expect fork has to do with creating a daemon. I felt it wasn't a good idea, but I decided to give it a try.16:28
phretorKeybuk: (actually, there is a pid file stanza)16:29
Keybukthere isn't :p16:29
phretormh, line 10?16:29
KeybukUpstart doesn't recognise it16:30
Keybukit was an early idea for doing fork following16:30
Keybukbut never implemented16:30
phretorKeybuk: ah, you mean that I cannot use it.16:30
Keybukright16:30
Keybukat best it'll ignore it16:30
Keybukat worst it'll error16:30
KeybukI'm pretty sure it'll just error16:30
phretorKeybuk: this is slightly better, not final, though. http://paste.pocoo.org/show/277005/16:31
phretor(it doesn't complain on 10.04 server)16:31
Keybukright, that's better16:31
Keybukstop on [016] should probably be stop on runlevel [016] I'm guessing16:32
phretorstill I'm not sure about sudo - I just need to run Xvfb as worker:worker and keep it running in case it fails (respawn)16:32
Keybuksince it's clearly a user thing, maybe you mean:16:32
Keybuk  start on runlevel [2345]16:32
Keybuk  stop on runlevel [!2345]16:32
Keybuk?16:32
Keybukyeah, you need sudo or su there16:32
Keybukor start-stop-daemon which has insane syntax16:32
phretorKeybuk: w/o exec?16:32
Keybukexec doesn't make much difference there, it'll save a pid though16:33
phretorI was told not to mix Upstart with start-stop-daemon16:33
phretorand damn it "Sorry, user worker is not allowed to execute '/usr/bin/Xvfb :99' as worker:worker on hostname"16:35
Keybukthat's a sudoers issue16:35
phretorand it clearly won't start16:35
phretorwell, I have "root    ALL=(ALL) ALL"16:36
Keybukmight be an X issue of course16:37
Keybukbut that's not an upstart problem :)16:37
phretorKeybuk: let me try with another command16:39
phretorKeybuk: "Sorry, user worker is not allowed to execute '/usr/bin/lsof' as worker:worker on hostname"16:39
Keybukthen it's sudoers16:39
phretorKeybuk: dear lord :)16:41
Keybukmaybe it's deciding based on the arguments ?16:41
Keybukie "as worker execute foo" so worker needs permission to execute foo?16:41
phretor-rwxr-xr-x 1 root root 1688032 2010-07-21 08:53 /usr/bin/Xvfb16:42
phretorand worker has ALL=(ALL) ALL16:42
Keybukno idea16:43
KeybukI'm not a sudo expert16:43
phretorKeybuk: ok, I will look at that. So, Upstart doesn't expose any feature for lowering the privileges, right?16:45
Keybukright16:45
phretorKeybuk: I need to spawn the same server (i.e., same executable) on different ports and have Upstart to respawn each instance if it dies. Do I have to create multiple scripts (one for each port) or what?17:19
Keybukno, you can use INSTANCE17:19
Keybukthough you would obviously need a master script to start each one17:19
Keybuke.g. you could add17:19
Keybuk  instance $DISPLAY17:19
Keybukand then17:19
Keybukstart YOUR_JOB DISPLAY=:100.017:19
Keybukstart YOUR_JOB DISPLAY=:101.017:19
Keybuketc.17:19
Keybukand you'll get two copies with different $DISPLAY variables17:20
Keybukthey'll show up in lists as YOUR_JOB (:100.0) ...17:20
phretorKeybuk: and Upstart will take care of each of them individually?17:21
Keybukyes17:21
phretorso sweet17:22
phretorKeybuk: and with "start on ls_screen" I will make it starting when my other script ls_screen has started. Right?17:23
Keybukerr, no, because that will only start one instance17:24
Keybukyou'd have to have an /etc/init/somejob.conf that had:17:24
Keybukstart on filesystem17:24
Keybukscript17:24
Keybuk  start otherjob DISPLAY=:100.017:24
Keybuk  start otherjob DISPLAY=:100.117:24
Keybukend script17:24
Keybuketc.17:24
Keybukin it17:24
phretormh, but I want each otherjob to start as soon as ls_screen is running17:25
phretorah ok, I got that17:25
phretorso I will have to make allotherjobs.conf17:25
Keybukright you have one start the other17:25
Keybukif you need it to wait, use an event, e.g.17:26
Keybuk  initctl emit --no-wait start_other_job DISPLAY=:100.017:26
Keybukand then17:26
Keybukstart on start_other_job17:26
Keybuk  \ and some_other_event17:26
Keybuk(you'll get $DISPLAY from the event for free)17:26
phretorthe pool of otherjob is actually a set of firefox instances, and the first job is Xvfb17:26
phretorso, yes, I need Xvfb to be available before starting the pool of browsers.17:27
Keybukright, so you could have the job that starts the others started on xvfb17:27
phretorso, start browser PORT=1234, start browser PORT=2345, ...,  within script/end script or outside script/end script?17:28
Keybukright17:30
Keybukwithin17:30
phretorKeybuk: and, how do I prevent it to run "spontaneously"? I just omit the start on [...] right?17:30
Keybukright17:32
phretorKeybuk: in this case I am lucky, because if Xvfb dies also firefox dies. But, what if I wanted to make process P2 stop when P1 stops? Is "stop on stopped P1" implemented already?17:38
Keybukyes17:38
Keybukor on stopping17:38
Keybukif you want "stop Xvfb" (explicit) to explicitly wait for the firefoxes to die17:38
phretorKeybuk: and I can leave the stop on runlevel [!2345] on firefox right?17:39
Keybukyou can17:39
phretorI know, it won't ever happen17:39
phretorbecause Xvfb stops when !2345 (i.e., before firefox)17:39
Keybuksame time as ?17:42
phretoryep17:42
phretorKeybuk: http://paste.pocoo.org/show/277025/17:42
Keybukok?17:43
phretorls_browser PORT=4242 works fine, but for P in $PORTS; do start ls_browser PORT=${P}; done in ls_screen's script/end script won't start themm17:44
Keybukerr I'm not sure what ls_screen is?17:47
Keybukisn't that ls_screen above>17:47

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