/srv/irclogs.ubuntu.com/2009/10/02/#upstart.txt

=== robbiew-afk is now known as robbiew
=== Keybuk_ is now known as Keybuk
ionIt’s awesome you can run ‘restart gdm’ from an X terminal and still have gdm come back up, as opposed to ‘service gdm restart’ back when gdm was an init.d service. :-P17:28
Keybuk:p17:33
ionOf course, setsid or screen worked as a workaround, but nevertheless.17:34
* Ng curious why -n isn't the default for start/stop17:52
Keybukbecause that would be wrong17:52
ionIndeed17:53
NgI'm assuming that start is an appropriate command to use as a substitude for /etc/init.d/blah start17:53
Ngif it is, then -n should be the default because init scripts don't block forever, right? :)17:54
ioninit.d scripts block until they inform you about whether the action you requested succeeded.17:55
Ngperhaps the upstart jobs for eucalyptus are just Wrong[tm], but it kinda seems like it's a bit of a gamble which services will return be to a prompt when I do start foo, and which will just wait forever17:55
KeybukNg: start doesn't block forever either17:55
Keybukstart only blocks until the service is *running*17:56
Keybukand that's why -n isn't the default17:56
Keybukstart dbus17:56
Keybukstart hal17:56
Keybukworks17:56
Keybukstart -n dbus17:56
Keybukstart -n hal17:56
Keybukdoesn't17:56
Keybuk(dbus isn't yet listening when you try and start hal)17:56
NgKeybuk: how does it determine the running state?17:56
NgI'm just curious because I did "start eucalyptus-cloud" and I want my shell prompt back ;)17:56
KeybukNg: exec() caused a close-on-exec file descriptor to be closed17:56
Keybukbriefly looking here, but the eucalyptus jobs seem to have code to poll the service until it's actually running17:57
Keybukso I assume because eucalyptus is still starting17:57
Nghmm17:57
Ngfair enough17:57
Ngthat's quite annoying, but clearly not your problem :)17:58
Keybukif you look at /etc/init/eucalyptus-cloud.conf you'll see it has a post-start script17:58
Keybukmdz has put that in there deliberately17:58
Ngit all starts up fine if you just let it, or at least it did in jaunty when the init scripts just forked everything off and let it sort itself out17:58
Ngbut that's not your problem, so I will take my whining elsewhere. thanks :)17:58
Ngoh! there was one other tiny little whine I wanted to raise before filing a bug :)18:00
KeybukI think you're probably supposed to use "start eucalyptus" looking at it18:00
NgI was wondering if the output from start/stop/status could be made a little more verbose18:01
wasabi_Oh looky!18:01
wasabi_We're actually using upstart now!18:01
Ng(mainly so it would explicitly say what the current state is, atm i think it's prone to interpretation)18:02
Keybukit does explicitly say?18:02
Keybukwarcraft scott% status dbus18:02
Keybukdbus start/running, process 82118:02
wasabi_This is very refreshing.18:03
wasabi_To see all these .conf files.18:03
wasabi_Though somehow fsck runs twice on boot for me. Once after the file systems are mounted.18:03
wasabi_And then it fails.18:03
Keybukwasabi_: odd.18:03
NgKeybuk: I was thinking that just sprinkling in a few more words would make it much clearer.. "dbus is running as process 821"18:03
KeybukNg: the status output is intended to be grep/sedable18:03
wasabi_Guessing the mount process is kicked off by a successful fsck18:03
wasabi_And it mounts things other than the devices that was fscked18:03
wasabi_'guessing'.18:04
KeybukNg: not sure I follow though, maybe I'm used to it, but it seems fairly clear18:04
Keybukthe only confusing bits come when you get post-start scripts ;)18:04
Keybukeucalyptus-cloud start/post-start, (post-start) process 82118:05
Keybukdo you see something like that?18:05
Keybukactually, I think that's even clear now18:06
Keybukeucalyptus-cloud start/post-start, process 82118:06
Keybukno?18:06
ionkeybuk: How about cmd="$(eval start --sh foo)"; eval "$cmd"; printf "%s, %s\n" "$upstart_status" "$upstart_pid"? :-P18:06
NgKeybuk: so like just now I had it stopped and it said "eucalyptus-cloud: stop/waiting"18:06
Keybukion: ?18:06
KeybukNg: right...18:06
ionWhoops, cmd="$(start --sh foo)"18:06
KeybukNg: that seems to be clearly "it's stopped, and I'm waiting for you tell me otherwise" ?18:06
ionAn alternative to seding the start output: have it output sh commands that set environment variables18:06
Keybukion: dbus-send is your friend ;)18:07
NgKeybuk: isn't it always waiting to be told something? I was wondering if maybe there could be "stopping" and "stopped"18:07
Keybukion: 18:08
Keybukwarcraft scott% sudo dbus-send --address=unix:abstract=/com/ubuntu/upstart --type=method_call --print-reply /com/ubuntu/Upstart/jobs/dbus/_ org.freedesktop.DBus.Properties.Get string:com.ubuntu.Upstart0_6.Instance string:processes18:08
Keybukmethod return sender=(null sender) -> dest=(null destination) reply_serial=118:08
Keybuk   variant       array [18:08
Keybuk         struct {18:08
Keybuk            string "main"18:08
Keybuk            int32 82118:08
Keybuk         }18:08
Keybuk      ]18:08
Keybuk--18:08
Keybuk<g>18:08
ionI wish dbus-send could output data in format one can easily parse from a sh script. :-P18:08
KeybukNg: no, the only two times it's ever only waiting for commands are "waiting" and "running"18:08
Keybukion: you could write such a tool18:09
ionSure18:09
KeybukNg: it's a bit subtle18:09
Keybukfor example18:09
Keybukconsider the state "stop/running" :)18:09
Keybukand "start/waiting"18:09
Keybukthey do exist, they're just a bit brief18:09
Ngstop/running makes no sense to my human eyes ;)18:09
Keybuksure18:09
Keybuksomeone told the service to be stopped18:09
Keybukbut it's still running18:09
NgI know what you mean, but I am a simple human wanting to know what my services are doing18:09
ionng: Goal: stop, status: running18:09
NgI'm all for a seddable/greppable interface, but maybe some extra words would help18:09
Keybuksimple humans can use the nice GUI I'll write one day ;)18:10
NgI'm a simple human on a server :)18:10
KeybukNg: though if you can come up with output that makes sense, I'm all ears ;)18:10
Keybukthe problem is that words like "starting" and "stopping" are *VERY* specific in Upstart world18:10
Keybukso having upstart use them badly would be confusing18:10
KeybukI guess you'd want18:11
Keybukstatus --dummy dbus18:11
Keybukdbus is running18:11
Keybukstatus --dummy apache18:11
Keybukapache will be stopped18:11
Keybukstatus --dummy hal18:11
Keybukhal will be started18:11
Keybukstatus --dummy obby18:11
Keybukobby is being restarted18:11
Keybuk?18:11
Ngthat seems better, although "will be" makes me wonder what those are conditional upon18:12
Keybuk(along with "is not running", those are probably the basic meta-states)18:12
iongdm: goal=start status=running process=42 – how about that for both humans and parsing?18:12
KeybukNg: if you do "start apache" (or someone else does)18:12
Keybukthen it'd be "is being restarted" :p18:12
Nghow abouy just having an option that spits out machine-readable status, otherwise plain english on the assumption that a simple human wants to know if something is broken?18:14
Ng"foo is running as process N", "foo is not running", "foo is starting", "foo is stopping" kidna thing18:14
Keybukit depends on how much information you think the single humans want to know18:14
KeybukI could kill both birds with one stone18:14
* Keybuk has AN IDEA18:14
Keybukhow about, if it's running (and your on a suitable terminal)18:15
Keybukthe entire text is GREEN18:15
Keybukand if it's falling over or stopped or whatever it's RED18:15
Keybukand if it's restarting, it's ORANGE18:15
Keybukthen you can glance at the colour, and not read the scary text ;)18:15
Ngcolour is good for me, I have advanced terminals and no vision defects18:16
NgI suspect there is a middle ground that just adapts what you have to be more definitive18:16
Ngwhat about changing the tense of the first state bit?18:17
Ngstart->started, stop->stopped18:17
Ng"stopped/waiting" seems clearer than "stop/waiting"18:17
Keybukagain, those are very specific words in upstart parlance18:17
Keybuka job can be stop/stopped18:17
Keybukand start/stopped18:17
Keybukso, you'd have the very very strange output18:17
Keybuk  started/stopped18:18
Keybukand18:18
Keybuk  stopped/started18:18
Keybuk;)18:18
Ngstart/stopped is very strange output18:18
Ngimho18:18
Keybukactually that's very meaningful18:18
Keybukit tells you that the service is going to be restarted, most likely as a result of a job with "... on stopped YOURJOB" in its conf18:18
ionI’m still proposing saying “this is the *goal* and this is the *status*” in the output. :-P18:18
Ngif I read a bunch of upstart docs. I hope I'm not seeming obtuse, I'm deliberately tryign to be a busy sysadmin who loves the idea of upstart, but hasn't read the docs18:19
Keybukbut yes18:19
KeybukI do appreciate your point ;)18:19
Keybukthe current status command outputs the exact upstart goal/state combo18:19
Keybukit should simplify that18:19
Keybukyou don't need to know the difference between start/starting, start/spawned, start/started & start/running (or stop/stopping, stop/killed, stop/stopped & stop/waiting)18:20
Keybuknot unless you're debugging anyway18:20
Ngyeah18:20
NgI definitely want to be able to choose to see those18:20
Keybukthe simplified model actually makes this simpler anyway18:20
Ngbut mostly I just want someone to hug me and tell me apache is running properly ;)18:20
Keybuksince it reduces the states to starting, started, stopping & stopped anyway18:20
Keybuk(intermediate states)18:21
KeybukNg: I guess you do want to know whether apache is still starting or not18:21
Ngsure18:21
Ngand by "sure" I mean "definitely, that's the kind of newfangled awesomeness I want from upstart"18:22
Keybukcould you file an upstream bug?18:22
Ngwith pleasure, although it'll be the other side of hometime and dinner :)18:23
Keybuknp18:23
Ngthanks :)18:23
=== robbiew is now known as robbiew-afk
PovAddictcan I use upstart on debian? :]19:09
sadmac2PovAddict: be our guest :)19:14
sadmac2PovAddict: they don't ship it yet (soon) but there's no reason it won't work if you want to hammer it in there yourself.19:14
Keybukno hammer required19:50
KeybukI believe it's as simple as apt-get install upstart19:50
sadmac2Keybuk: really? I thought they just decided to use it.19:51
Keybuksadmac2: it's been installable for yeras19:52
Keybukthe decision was about it being the default19:52
sadmac2ahh, debian. Is there anything they won't make pluggable?19:52
sadmac2I guess if you ship two completely different kernels, shipping two init systems isn't a stretch19:53
=== robbiew-afk is now known as robbiew
wasabi_expect fork. What's that do?20:12
wasabi_Tracks down the pid's using ptrace?20:12
wasabi_Also... why do we still spawn recovery consoles asking for the root password?20:14
wasabi_Since we don't even set a root password.20:14
wasabi_That would seem braindead at this point.20:14
ionHuh? My recovery anything doesn’t as for root password.20:14
wasabi_root@station-1:~# sulogin20:14
wasabi_Give root password for maintenance20:14
wasabi_(or type Control-D to continue):20:14
wasabi_Oh maybe it only does it if you have one. :)20:14
ionWell, duh :-)20:15
wasabi_Brain fart from a time long past.20:15
=== robbiew1 is now known as robbiew
=== robbiew is now known as robbiew-afk
=== robbiew-afk is now known as robbiew
=== robbiew is now known as robbiew-afk

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