/srv/irclogs.ubuntu.com/2010/05/25/#upstart.txt

hrwhi10:41
Keybukhrw: hey, how's it going?10:41
hrwmoment, waiting for ogra10:41
* ogra_tb waves10:41
hrwKeybuk: we want to add extra service to upstart10:41
hrwKeybuk: http://marcin.juszkiewicz.com.pl/tmp/ogra/ogra.tar.bz210:42
ogra_tbKeybuk, though for upstream inclusion i'm recommending to not use root autologin indeed :)10:42
Keybukexplain?10:42
hrwKeybuk: it allows to start getty on serial console given by kernel cmdline. useful for ARM people mostly but I think that there will be other users too10:42
ogra_tbKeybuk, it [arses console= and if it finds a serial definition it spawns a serial getty10:43
ogra_tb*parses10:43
hrwKeybuk: by default service is disabled and user can define which tool to run (so can be autorootlogin or normal getty/login combo)10:43
ogra_tbso we dont need to manually add a ttyS*.conf file all the time10:43
Keybukyou don't need to parse /proc/cmdline for that10:43
KeybukI think you can just put in "env console" and read $console10:43
ogra_tbon arm you usually use multiple console args10:43
Keybukwhich one wins?10:44
ogra_tbfirst console is usually serial, second is a tty10:44
hrw"console=tty1 console=ttyS2" like10:44
ogra_tbthe second one10:44
KeybukI think that works with the environment variables too10:44
ogra_tbas soon as the kernel has uncompressed it switches to the second console10:44
ogra_tbso for debugging you usually need serial10:45
ogra_tbfor login you then get the second one ... if you also want a login prompt on the first defined console yu need to create an init .conf file10:45
ogra_tbthe code above avoids that10:45
Keybukunsure which one the kernel passes as $console to init10:46
ogra_tbthe second one i think10:47
hrwbut it also checks is there a service for console and exit if there is10:47
ogra_tbroot@touchbook:~# env |grep console10:47
ogra_tbroot@touchbook:~# 10:47
ogra_tbhmm, where would that variable exist ?10:47
Keybukin pid 1's environment10:48
ogra_tbah10:48
Keybukunless it doesn't, of course10:48
ogra_tbso apart from the parsing of cmdline, would you think such an addition would be possible upstream ?10:49
Keybuknot in its current form, no10:49
ogra_tb(/me disagrees with the way of calling an external binary though, i'd just use an upstart script/end script section here)10:49
Keybukit should be possible to do it without the script in /bin10:49
ogra_tbheh10:50
Keybukand definitely without anything in /etc/default - which is a complete violation of Upstart policy ;-)10:50
ogra_tbwell, i want the serial detection 10:50
Keybukplus it doesn't take into account when the device is ready10:50
ogra_tbthe arm project guys want to additionally have a root autologin for their images10:50
ogra_tbthat caused the default file10:51
ogra_tbi think the serial detection is a valid upstream addition while the rootlogin should be a project thing10:51
hrwso I will check value of $console10:52
ogra_tbinit will likely only see the second one, but test it10:52
ogra_tbKeybuk, the device has to be ready anyway, the kernel messaages go to the serial consolle 10:56
ogra_tb-l10:56
hrweven with one entry I got empty value for "echo $console >>/tmp/test" in /etc/init/auto-serial-console.conf10:57
* ogra_tb hates the touchbook kbd with passion10:57
Keybukogra_tb: not necessarily10:57
ogra_tbwell, for our kernels at least we can rely on having serial console support built in10:57
Keybuksure, you can ship that in Ubuntu ;-)10:58
hrwKeybuk: and we can add "[ ! -f /dev/$tty ] && exit"10:58
Keybukhrw: that would be a race condition10:58
hrwok10:58
ogra_tbso with devtmpfs we can be sure the device exists from the start10:58
Keybukno you can't, the console device driver may not have been loaded yet10:58
hrwKeybuk: unless it is in-kernel?10:59
ogra_tbdoesnt that get loaded as fisrt thing by the kernel ? 10:59
Keybukhrw: for something upstream, I can't rely on that guarantee10:59
Keybukthe kernel will cause (via kmod) a char-major-x style probe the first console message that needs to be emitted11:00
Keybukit may be sometime before userspace responds to that11:00
ogra_tbyeah, its far before userspace11:00
Keybukno it isn't11:00
ogra_tbkernel messages are output right after uncompressing where would there be userspace ?11:01
Keybukwhat kernel messages?11:01
ogra_tball stuff that ends up in the ringbuffer11:01
ogra_tbfrom line 1 on11:01
Keybukwhat stuff?11:02
ogra_tball kernel output11:02
Keybukthere is no kernel output in Ubuntu by default ;)11:02
ogra_tb/var/log/dmesg if you want it like that :)11:02
hrwKeybuk: by default there are many things in other way11:03
ogra_tbwith queit its indeed quietened down, but the device should exist at that point regardless11:03
Keybukwhy should it exist?11:03
Keybukwhat will make it? :p11:03
ogra_tbbecause there is output directed to it 11:03
ogra_tbthe kernel11:03
Keybukno it won't11:03
Keybukbecause the driver won't be available11:03
Keybuketc.11:03
ogra_tbhmm11:04
ogra_tbso what do you propose 11:04
ogra_tbhaving a package with just one .conf file ?11:04
Keybukyes11:04
ogra_tbhmm11:04
hrwKeybuk: no chance to integrate it into upstart then?11:05
Keybuknot in its current form, no11:05
hrwso which suggestions for changes?11:06
Keybukneeds to be a single upstart .conf file, with the desired console available to upstart itself so that the "start on" bit can reference it11:06
ogra_tbi doubt you can change it in a way that would please Keybuk 11:06
ogra_tbsince you cant know if the device exists at the point you need to know it11:06
Keybuksure you can, there are events for that11:07
hrwKeybuk: single conf file is easy. but on my beagleboard $console var is empty11:07
Keybukhrw: may require kernel and/or upstart patches to make it work11:07
hrwweek ago I used sysvinit11:07
hrwand was happy with it ;D11:07
Keybukgo use that then11:08
hrwKeybuk: then this system will not be *buntu11:08
* ogra_tb doesnt want to add sysvinit stuff to ubuntu :)11:08
ogra_tbandd i really want the automatic detection stuff 11:08
Keybukso stop whining then - if you want to do something properly, do it properly11:08
Keybukfigure out why the kernel doesn't tell userspace which console it's created, etc.11:08
Keybukand fix that11:09
Keybukwe have a kernel team, they'll help you get the patch upstream too11:09
Keybukso everyone can benefit11:09
ogra_tbyeah11:09
hrwmkey11:09
ogra_tbjust more time consuming11:09
Keybukyes, it takes time to do things properly11:09
Keybukthat's not an excuse11:10
ogra_tbi didnt mean to use it as one :)11:10
hrwneither did I11:10
ogra_tbthough the arm project guys might have some time pressure11:10
Keybukwe're trying to make the best *Operating System* that we can11:10
ogra_tbnot sure about their timelines11:10
Keybukso it's important to think about everything and do it the right way11:10
ogra_tbindeed11:11
hrwbtw - /etc/init/tty1.conf autoassumes that /dev/tty1 exists?11:13
Keybukthat job isn't shipped upstream ;)11:13
ogra_tboh, but its in our upstart package11:15
Keybukright11:15
Keybukwe have patches to upstart ;)11:15
* ogra_tb wasnt aware you add patches :)11:15
Keybukbut again, I think this is just something you should ship yourselves in your own packages for now11:16
ogra_tbso once we have a reliable way to detect the device you would be willing to ship it too ?11:16
Keybukyup11:16
ogra_tbok11:16
Keybukonce the "start on" can reference the detected console device, I'm happy11:16
ogra_tbgood11:16
ogra_tbwe'll hunt down the kernel team for it then 11:16
Keybukit may be fixed as part of the "pass all options to init" patch11:17
ogra_tbthough it will be tricky since we only want certain console devices11:17
ogra_tbthat patch reads the cmdline ?11:17
ogra_tbor the kernel events 11:18
Keybukthat patch is in the part of the kernel code that generates init's cmdline from its own11:18
ogra_tbah11:18
ogra_tbyeah, then we should have $console ... the question is just which one we get :) 11:18
ogra_tbat the pointinit starts the first console entry will be ignored already11:19
ionkeybuk: How’s Upstart 10’s sysvrc loader going to know whether an init script is a task or a service, btw?14:26
ionJust wait until the main process returns with zero and if it has left any children running, it’s a service?14:27
ionI take it respawn won’t be used for that stuff?14:28
Keybukconsider the start and stop bits equivalent to pre-start and post-stop14:29
Keybukso they always hold up running/stopped14:30
ionSo Upstart won’t track any child processes they left behind at all?14:30
Keybukyeah it will14:30
Keybuk"equivalent to"14:31
ionOk :-)14:31
Keybukprocess tracking is a bit different in 0.1014:31
zer0c00lHow do i use upstart to restart a crashing application?17:12
zer0c00lFor example transmission-daemon17:12
JanCrespawn17:19
zer0c00lok17:20
zer0c00lRead the docs17:20
zer0c00lJanC: thanks 17:20
zer0c00lJanC: I read http://code.alexreisner.com/articles/upstart.html17:20
JanCin recent versions of upstart you have to put de .conf file in /etc/init/ and not /etc/event.d/ though17:22
zer0c00lJanC: ok :)17:24
zer0c00lJanC: I don't see /etc/init/ in my system17:28
zer0c00lJanC: i am using Fedora 12, /etc/init.d/ is available17:28
JanCzer0c00l: it depends on what version of upstart you use, older versions had /etc/event.d, newer have /etc/init, and I don't know which one Fedora 12 has17:30
zer0c00lJanC: it has 0.3.1117:31
JanCthen it's still event.d17:31
zer0c00lJanC: ok 17:32
zer0c00lJanC: I  just followed that blog post , I am getting some issues, http://fpaste.org/JFC4/17:34
JanCit needs a *.conf filename17:34
zer0c00lJanC: works :)17:35
zer0c00lGreat Thanks17:36
zer0c00lJanC: One doubt, whether it the process will be monitored an restarted after a reboot?17:36
zer0c00ls/it/17:37
JanCif you want to be sure, try it  ☺17:38
zer0c00lJanC: Ok ;)17:39

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