/srv/irclogs.ubuntu.com/2006/10/27/#upstart.txt

=== laszlop [n=laszlo@CPE0015e976f21f-CM0017ee427a40.cpe.net.cable.rogers.com] has joined #upstart
=== laszlop [n=laszlo@CPE0015e976f21f-CM0017ee427a40.cpe.net.cable.rogers.com] has left #upstart ["Konversation]
=== jme [n=jme@c-24-7-89-173.hsd1.ca.comcast.net] has joined #upstart
[chaoticg33k(n=chaoticg@alphabox.cxw.utoledo.edu)] hello12:54
=== mbiebl [n=michael@e180086068.adsl.alicedsl.de] has joined #upstart
=== justin__ [i=justin@59.92.143.121] has joined #upstart
jmeI suppose this is the wrong place to ask re Usplash configuration01:49
=== jme [n=jme@c-24-7-89-173.hsd1.ca.comcast.net] has left #upstart ["Leaving"]
=== Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart
=== tapas [n=tapas@affenbande.org] has left #upstart []
=== oneman [n=oneman@ip24-254-239-184.hr.hr.cox.net] has joined #upstart
onemanmy upstart jobs in edgy are not starting on startup..05:45
onemanit works with start and stop05:45
onemani also notice it doesn't work with daemons that fork off and become a session leader..05:46
_ionAdd something like 'start on runlevel-2'05:47
_ionAdd 'daemon' for a forking daemon.05:47
onemanive got start on startup :P05:51
onemanwhere do i put daemon, just anywhere?05:51
_ion"start on startup" means that it's started before filesystems have been checked, or networking has been started, or syslogd has been started etc.05:59
_ionYes.05:59
_ionI'd put it just before or after the 'exec foo' or 'respawn foo' line, or just before the 'script' block.05:59
onemanohh06:01
onemanok, for lighttpd06:02
onemandaemon worked for starting, but it doesn't kill it on stop06:02
=== Amaranth [n=travis@ubuntu/member/amaranth] has joined #upstart
=== cfedde [i=cfedde@fedde.littleton.co.us] has joined #upstart
=== Seveas [n=seveas@ubuntu/member/seveas] has joined #upstart
onemanupstart is cool07:00
onemanbut its apha betaboy stuff07:00
onemanand you have to go talk to the developers themselfs on internet chat to get them to tell you secret undocumented information to really do anything07:01
=== Keybuk [n=scott@quest.netsplit.com] has joined #upstart
=== H__2 [n=hans@mail.sangine.com] has joined #upstart
H__2anyone awake ?10:56
Keybukyup11:02
Keybukwhat's up?11:02
H__2i have a question about the new developments : the job-starting and such. Is the following planned : when service A requires service B, and B is restarted, is then A stopped before B stops and A started after B started again ?11:04
Keybukit depends11:05
H__2;-)11:06
Keybukif A wants to be restarted when B is restarted, it would indicate as such in its job definition11:06
Keybuke.g.11:06
Keybukstop on job-stopped B11:06
Keybukstart on job-started B11:06
H__2ok, does "stop on job-stopped B" mean that A stops after B stopped ?11:06
Keybukno11:07
Keybukit means B stops because A is11:07
H__2Can't follow you there. This is the scenario : A requires B. B is restarted, the question is what happens to A, and in what order11:08
KeybukB is stopped11:08
KeybukA is stopped11:08
KeybukB is started11:08
KeybukA is started11:08
Keybukwith that example11:08
H__2exactly, so  A stops after B stopped. I think that is wrong.11:09
Keybukif you needed it in the other order, you'd use "stop on job-pre-stop B" or similar11:09
Keybukupstart doesn't enforce any of this, it simply issues sufficient events for you to define the behaviour11:09
H__2ah, perfect :)11:09
H__2very interesting11:10
H__2another small question : from the website "being developed for the Ubuntu distribution" does that mean that Ubuntu now actively uses it, or that it is targetted to replacing the system currently present in ubuntu ?11:11
thomH__2: ubuntu now uses it11:12
H__2nice, thanks. Will look into it.11:13
Keybuk(as of the release of edgy, yesterday)11:14
H__2is there a way in upstart to draw a dependency graph of a bunch of scripts that subscribed to upstart's events ?11:20
Keybukthere may be eventually, yes11:20
KeybukI think that such a thing would be useful11:20
H__2heh :) I've been drawing those by hand and sometimes using graphviz ;-)11:21
=== Keybuk uses graphviz
KeybukI figured upstart would output dotty11:21
H__2the example jobs from the homepage (http://upstart.ubuntu.com/download/example-jobs-2.tar.gz) don't have "job-pre-stop"-level rules, is there a second list of examples available for download perhaps ?11:29
Keybukjob-pre-stop rules don't exist yet11:31
Keybukupstart's still in heavy development11:32
Keybukthey're planned for the 0.3 series11:32
H__2ow ;-)11:32
H__2I got the impression from your ' you'd use "stop on job-pre-stop B" ' that it was already available ;-)11:33
Keybukyou'd use "stop on B/stopping" at the moment11:33
Keybuk(and "start on B/starting")11:34
Keybukthey mean about the same thing11:34
H__2well, it's a race we suffer from at the moment. So we still must use our proprietary solution11:34
H__2another question : is the event queue re-read and any new (or removed) subscriber results merged with the active queue after any upstart action ?11:39
Keybuknot sure I understand the question>?11:39
H__2ok, i'll make up an axample :11:39
H__2let's say that upstart is active and it as to start scripts A, B, C and D (in that order). And it just finished starting B. This script B has enabled another event script called X. The dependency order of X is that it has to start before C. What does upstart do ?11:41
Keybukupstart doesn't have dependency orders11:42
Keybukit's not a dependency-based init system11:42
Keybukit would be better if you phrased your question in terms of a real example11:42
H__2well, it is actually a real example, but from a proprietary system I wrote11:43
Keybukok11:43
Keybukso you have four jobs, A, B, C and D11:43
H__2yes11:44
KeybukB starts on job-started A, C starts on job-started B, D starts on job-started C11:44
H__2yes11:44
Keybukwhat do you mean by "enabled another event script" ?11:44
H__2Let's say that script B wrote a script X (or copied it into place), and if available then C wants X to have started before C itself starts.11:46
Keybukso C should be started by the "X started" event11:47
Keybuknot the one for B11:47
H__2the C - B relationship is not changed, there is a new one inserted halfway11:48
H__2and indeed, 'C should be started by the "X started" event'.11:48
Keybukyou're confusing relationships and events11:50
Keybukupstart isn't a dependency-based init system ;)11:50
Keybukit doesn't have relationships11:50
H__2possibly, i'm new to upstart terminology11:50
Keybukit takes a little bit of a backstep to understand how to translate dependency-based information into event-base11:51
Keybukthey're not a 1:1 mapping by any means, and are quite different11:51
Keybukwe're convinced event-based is better11:51
Keybukbut it does mean that if you come from init-ng, gentoo, etc. you can't just run some perl/sed over the init script to get an upstart one -- you have to rethink how the service is started11:52
Keybukand how multiple jobs interact (rather than depend)11:52
H__2ok11:54
H__2(I don't come from  init-ng, gentoo, etc, it's my proprietary development. And I'm wondering whether it can be replaced)11:55
Keybukso the basic theory of upstart is not that services depend or require one another11:56
H__2so far upstart comes closest :)11:56
Keybukbut that services are started because other things happen11:56
Keybukthis is because in reality most things don't depend on another service, but an abstract concept11:56
Keybuke.g. "on battery power"11:56
H__2well11:57
H__2what we have is fi. a script that creates an tunnel device, to which other services want to bind. I call that a dependency.11:57
Keybukright11:57
Keybukso the obvious change there is11:58
Keybukother services do not depend on a script that creates a tunnel device11:58
H__2and if this tunnel device disappears, then the others are in trouble, they must be stopped upfront11:58
Keybukinstead, other services need the tunnel device!11:58
Keybukso in upstart, you'd do "on network-device-added tun0"11:58
Keybukand make sure udev sent that event to it11:58
Keybukthat way the services come up with the tunnel11:58
Keybuklikewise, you'd stop them because the tunnel device went away11:59
Keybukwhich means even if the user ifconfig'd it down, the services would stop11:59
H__2went away is too late ;-) will go away is what we need11:59
Keybukthere's no way to know it "will go away"11:59
Keybukifconfig tun0 down11:59
Keybuk*boom*11:59
Keybukyou can have a "bring tunnel down safely" script11:59
Keybukthat can issue a "going to take tunnel down" event which stops the services12:00
Keybukbut they should also be stopped if the tunnel goes away unexpectedly12:00
=== hunger [n=tobias@pd95b0676.dip0.t-ipconnect.de] has joined #upstart
H__2yes the 'die unexpectedly' is a different problem12:00
Keybukwe think it's the same one12:00
H__2interesting :)12:01
Keybukso how I'd do that would be have12:01
Keybuk/sbin/remove-tunnel which is a script that does12:01
Keybukinitctl emit network-device-going-down tun012:01
Keybukifconfig tun0 down12:01
Keybuk--12:01
Keybukand then have the services include both12:01
Keybukstop on network-device-going-down tun012:01
Keybukstop on network-device-down tun012:01
Keybuk--12:01
Keybukthat way your services can safely come down if the script is used12:02
Keybukbut also come down if the script isn't used12:02
Keybukone should try one's best to have the services at least deal with that sanely, where sane can include logging an error in syslog12:02
hungerKeybuk: Did you upstartify ifup/ifdown?12:02
Keybukhunger: not yet, https://launchpad.net/distros/ubuntu/+spec/replacement-network-events12:02
H__2the " have the services at least deal with that sanely" is indeed what we want, sadly that piece of software is out of our control :-/12:03
=== hunger is looking forward to seeing upstart develop in feisty.
=== badock [n=badock@h235.net48.bmstu.ru] has joined #upstart
hungerIs there a timeline for upstart in feisty yet?12:06
H__2why don't you call the " stop on network-device-going-down tun0" a dependency ? to me that is a fine example of a dependency12:06
Keybukhunger: what kind of timeline?12:06
KeybukH__2: because dependency infers in people's mind certain semantics; which don't exist in this case.  "network-device-going-down" is an event, it's something that happens12:07
hungerKeybuk: Like what is planned for when. On second thought I guess that will be in the specs once they become available.12:07
Keybukhunger: the specs are already registered, just not yet written12:07
hungerKeybuk: I noticed:-)12:07
hungerI think I'll need to spend some time hacking my cryptdisk setup into your scripts when those hit the repositories.12:08
H__2heh :) and if others want to be notified of such events you still don't call that a dependency ? A subscription then perhaps ?12:08
KeybukH__2: the particular case is "start on foo"12:08
Keybukif bar depends on foo, people assume that even if bar is created after foo has been started, bar will be started12:09
Keybukwhereas when "foo" is an event, people realise that it's forgotten about once it happens12:09
H__2I don't get this "if bar depends on foo, people assume that even if bar is created after foo has been started, bar will be started" If bar depends on foo, then bar cannot be started if foo's not there. But if foo is there then bar can start.12:11
Keybukyes12:12
Keybukexactly12:12
Keybukthat's what dependency infers12:12
Keybukwhich is why we don't use that term for upstart12:12
Keybukbar can be started manually at any time12:12
Keybukit's up to bar to decide whether it should fail to start because foo is not running12:13
H__2in my world it can not12:13
H__2but I think I see what you mean12:13
Keybukunfortunately, without you elaborating on what your world is, I can't understand12:13
Keybukif a service depends on a tunnel device, and that tunnel device is not present when it is started, /it should fail anyway!/12:14
Keybukand it should present a useful error message to debug that failure12:14
H__2it should not even try to start, controlled by the service trying to start it12:14
Keybukwhy not?12:14
Keybukthe sysadmin should always be able to get their hands dirty and try things12:15
H__2because we know it will fail12:15
Keybukyou don't know it will fail12:15
Keybukthe sysadmin may have created the tunnel by hand12:15
H__2true, interesting. Let's say "there is no sysadmin". these are embedded systems.12:15
Keybukthen you don't need to worry about this scenario, because it's inherently not possible ;)12:16
Keybukif you have no tinkering sysadmin, then you can ignore it12:16
H__2I think you lost the plot :)12:16
Keybuk?12:16
KeybukI haven't been told the plot12:16
H__2I'll try to describe it better12:17
H__2that turns out to be quite hard. I'm not sure what to add to it what would help us.12:23
Keybukyou're saying that "bar should not be able to start if foo isn't running"12:24
Keybukbut I'm saying that if the only thing that can start bar is the init daemon, then you don't need to worry about that eventuality12:24
Keybuknothing will try to start bar except the init daemon, as a result of the events that are listed as causing it to start12:25
H__2maybe this : if A has a "start on" subscription to B, and upstart just tried to start B, but B failed, does upstart then continue starting A ?12:25
Keybukdepends on the event subscribed to12:25
Keybukif the event is the started one, then no12:25
Keybukif it's the starting one, then yes12:25
H__2ok, clear :)12:26
Keybuksorry that it seems a little confusing, it's much easier to demonstrate with examples12:28
H__2Can you elaborate a bit more on the "A has a dependency on B" versus "A is subscribed to an event of B" difference you make ?12:29
Keybukupstart issues events as B changes state12:32
Keybuke.g. job-starting, job-started, job-failed, job-stopping, job-stopped, etc.12:32
Keybukif A is subscribed to any of those events, then it will be started or stopped if an event occurs12:33
Keybukevents are one-shot things, they are emitted, get handled by changing the state of any subscribed job, and then get forgotten about12:34
Keybukthey can be emitted by any part of the system12:34
Keybukas well as job-started, you can also have network-device-added, block-device-added, path-mounted, battery-power, etc.12:34
H__2Ok, that part is clear. The question is why it is not considered to be a dependency. The end result in bout our systems is the same btw :)12:35
H__2bout->both12:35
Keybukthe word dependency conjours up certain things in people's minds12:35
Keybukif I say that "foo depends on bar", then I would assume certain things:12:35
Keybuk- bar is started if I try and start foo12:35
Keybuk- if bar fails to start, foo does not start12:36
Keybuk- if bar is already running when I try and start foo, then foo is started12:36
Keybuk- if foo stops, and nothing else depends on bar, bar is stopped12:36
Keybuk- bar cannot be started if foo doesn't exist (or is disabled)12:36
H__2don't agree with " - if foo stops, and nothing else depends on bar, bar is stopped", and the one after it too, the rest: yes12:37
Keybukwhile all of these things can be replicated in upstart with a combination of events, simply adding "start on job-started bar" does *not*12:37
KeybukH__2: dependency-based init systems do that12:37
H__2only if they are bi-directional dependencies IMO12:38
H__2bar doesn't care if there's a foo that wants to use it, so if foo is stopped, bar doesn't care12:38
Keybukbut that's not what a dependency-based init system does12:40
Keybukso calling events dependencies, in an init system, would confuse people12:40
H__2ah, that's then where our confusion comes from. It is what a dependency-based init system does in our opinion (see Gentoo for example).12:41
H__2dependencies have only one direction.12:41
H__2a system with bi-directional dependencies cannot start :)12:41
KeybukI'm completely unfamilar with Gentoo's, I'm afraid12:42
Keybukthe way that initNG and SMF work is to start a set of goal services, which cause their dependencies to start, et. al. down the list12:42
Keybukif you stop a goal service, than any dependencies unused by anything else are also stopped12:42
Keybukthis is consistent with dependencies in the package manager as well12:43
H__2I'm unfamiliar with  initNG and SMF :)12:43
H__2I would say " up the list" instead of " down the list" in 2 lines up12:44
Keybukalso to me, depends infers state tracking12:45
Keybuk"bar depends on network-device tun0"12:45
Keybukwhich implies that the state of that network device is tracked12:45
Keybukupstart relies on something else to track the state, and issue the events when it changes12:45
H__2ideally yes12:45
Keybukso instead12:45
Keybuk"start bar on network-device-added tun0"12:45
Keybuk"stop bar on network-device-removed tun0"12:45
Keybuktype thing12:45
H__2clear12:45
H__2in our system the tracking is present, but handled outside the 'upstart' alternative. By using blunt checkscripts :)12:46
H__2can only do polling from scripts there, in most cases.12:47
Keybukupstart is intended to be useful where you have events from other systems12:47
Keybukand don't need to poll12:47
Keybuke.g. udev for hardware12:47
H__2clear12:48
hungerKeybuk: I like the heartbeat idea that came up on the -devel ML.12:48
hungerKeybuk: That would absolutely rock for the server crowd.12:48
=== H__2 hides his heartbeat system
H__2;-)12:49
H__2just joking, besides they're probably different anyway12:49
Keybukhunger: without knowing much about heartbeat, I couldn't comment much12:49
hungerKeybuk: heartbeat is pretty simple: basically it is just doing something when the heartbeat is no longer heared.12:50
H__2from where to where is this heartbeat communicated ? what does it monitor ?12:51
hungerKeybuk: I only ever used something like that on AIX, so I can not comment on how linux works either.12:51
hungerH__2: heartbeat is used for eg. when you want a highly available webserver. You set up two that send each other heartbeat signals.12:52
H__2ok, so 'total service' is monitored12:52
H__2then it's the same as what we have12:52
hungerH__2: When the hearbeat of the master is no longer heared by the slave that takes over IPs and stuff and continues.12:52
H__2clear12:52
Keybukyou could have heartbeat emit a "flatline" event ;)12:53
Keybukand then write upstart jobs with "on flatline"12:53
hungerKeybuk: Yes, exactly.12:53
H__2ack12:53
Keybukit's a definite goal to get rid of everything's *.d script directories12:54
H__2btw, FreeBSD now has a similar dependency system in their init scripts (as what I talked about earlier)12:54
H__2with complaints like : % rcorder: requirement `named' in file `/usr/local/etc/rc.d/samba.sh' has no pro12:55
H__2viders.12:55
H__2nice to see the world moving in the same direction :)12:56
Keybukright, but bear in mind that upstart doesn't do that ;P  it's not a dependency-based init system12:56
Keybukin an upstart system, samba instead would be started by an event such as "dns-available"12:57
H__2and a lot more I hope12:57
Keybukand that event could be emitted by either the bind9 job, a dhclient job or a network interface job if it detects an available IP in /etc/resolv.conf12:57
hungerKeybuk: That is the one weakness I see in upstart: It will be a PITA to figure out on which events to react, there being so many of them.12:58
H__2hey, if I understand right the need for 2 providors is also not present in upstart, like samba starts on 'dns-available' but samba also needs 'eth0 available' which may not be there yet, so samba would get started another time lateron when 'eth0' appears, right ?12:59
hungerKeybuk: And that some things will end up depending on more than one event will make things even worse.12:59
KeybukH__2: not currently, methods of doing that are being discussed and will be in 1.012:59
H__2and will still not be called dependencies, right ? ;-) (sorry , couldn't resist)01:00
hungerH__2: ... and all-exported-filesystems-available is another candidate ...01:00
H__2I'll get some coffee now01:00
Keybukit depends on the semantics01:02
Keybukwe've talked about the idea of having jobs "wait" for an event01:02
Keybukso one might do:01:02
Keybukstart on foo01:02
Keybukwait for network-device-added eth001:03
Keybukwait for dns-available01:03
Keybuk--01:03
Keybukdoes this mean that dns-available has to occur *after* foo01:03
Keybukor does this mean that dns-available just has to occur at any point on the system01:03
hungerKeybuk: Will that work if dns-available happens before foo?01:03
Keybukhunger: exactly01:03
hungerKeybuk: I have thought about how to integrate my cryptsetup script with upstart.01:04
Keybukand how does that work if the network device comes back down again?01:04
hungerKeybuk: In addition to what the normal one shipped with ubuntu can do mine can mount a FS, read keys from there, mount other FSes and then unmount the key-FS again.01:04
Keybukthe network-device-added event happened, so that "wait" has been fulfilled01:04
hungerSo basically I would need to make sure that the key-FS is setup and mounted before any FS it contains a key for and then unmount it again once all of them are up. No idea how I can express that in events.01:05
Keybukwhy unmount the key FS?01:06
hungerKeybuk: So that nobody can get the keys once the system is up.01:06
Keybukthey could just mount it? :p01:07
hungerKeybuk: I unmount the FS and destruct its decrypted device. That way only the encrypted device is visible once the other crypted FSes are up.01:07
H__2I'll ask for open-source clearance once more, i'm very interested in what you have to say about it01:07
hungerall that happens before the network comes up, so I am pretty sure nobody can steal my keys;-)01:08
H__2only the tempest crew in the other building :-P01:11
hungerH__2: upstart breaks the displaying of the password prompt... that might confuse those guys;-)01:11
H__2Keybuk : is there an advanced examples tar ball ?01:12
H__2hunger: heh :o)01:12
KeybukH__2: no01:12
Keybukhunger: I don't understand why01:13
H__2ok, then maybe in Ubuntu 6.10 ?01:14
hungeredgy is screwed up wrt. displaying startup info anyway... running usplash gives the password prompt and displays the password which is even worse IMHO.01:14
Keybuk6.10 was released yesterday01:14
Keybukhunger: "screwed up" ?01:14
H__2i know it was released yesterday, I meant to ask whether it did contain more advanced stuff than the examples tar ball01:15
Keybukno, the examples tar ball is the copy of the jobs from ubuntu 6.1001:15
H__2aah, ok :)01:15
hungerKeybuk: Without usplash: no password prompt, with usplash: password prompt is displayed but password is echoed to the screen.01:16
hungerBoth is not really the way I expected it to be;-)01:17
H__2Thanks for the chat. (I'm off for a lunch-walk now.)01:17
=== johnnybuoy [n=jano@ob-7515.adsl.datanet.hu] has joined #upstart
=== WorkRoey [n=Roey@h-69-3-4-130.mclnva23.covad.net] has left #upstart ["Leaving"]
=== juergbi [n=juerg@80-219-26-249.dclient.hispeed.ch] has joined #upstart
=== Md [i=md@freenode/staff/md] has joined #upstart
=== Artanicus [i=kuitunej@lehtori.cc.tut.fi] has joined #upstart
=== phsdv [n=kvirc@83.152.239.70] has joined #upstart
=== shwag [n=shwag@66.101.109.10] has joined #upstart
=== phsdv [n=kvirc@83.152.239.70] has joined #upstart
phsdvhi all, I just managed to get my gentoo system booted using upstart.10:31
phsdvbut I am getting some errors like: control-alt-delete: init: /dev/initctl: No such file or directory10:33
phsdvdoes someone know how to fix that?10:34
=== Akrito [n=alex@24.124.24.34] has joined #upstart
=== phsdv [n=kvirc@83.152.239.70] has joined #upstart

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