/srv/irclogs.ubuntu.com/2010/06/04/#upstart.txt

jefimenkowhere are the docs for upstart09:37
jefimenkoi have a daemon that runs on a typical /etc/init.d script09:37
jefimenkoto ensure better availability in case it does crash09:37
plautrbajefimenko: man 5 init09:38
jefimenkoi'd like it to restart automatically09:38
jefimenkoplautrba: thanks, i've been playing around with things after reading those docs10:22
jefimenkohow can i source a config file10:22
jefimenkolike a /etc/default/servicename10:22
jefimenkoto set environment variables, etc.10:23
derosaHi, I have a service that must be run at shutdown/reboot. Before upstart I just used a init script in rc[06].  As my sript depends on dbus, the rc[06] solution is no longer valid, as dbus is stopped before my script runs. I tried a little config file that just runs the script when dbus is about to be stopped (start on stopping dbus), but it doesn't seem to be running at all. I appened the "--debug" flag to the kernel but it doesn't help to me. Any hints?12:21
derosaHi, I have a service that must be run at shutdown/reboot. Before upstart I just used a init script in rc[06].  As my sript depends on dbus, the rc[06] solution is no longer valid, as dbus is stopped before my script runs. I tried a little config file that just runs the script when dbus is about to be stopped (start on stopping dbus), but it doesn't seem to be running at all. I appened the "--debug" flag to the kernel but it doesn't help to me. Any hints?12:31
Keybukyou mean "stop on stopping dbus" surely?12:46
derosaMy "service" is in fact just a command that doen's daemonize, so I thought it would be starting12:56
derosaI thought "stop" would only stop something that has previously been started12:58
Keybukah right13:04
Keybukthen yes, use "start on"13:04
Keybukyou'll also want to add "task" - that tells Upstart to block D-Bus from stopping until your command completes13:04
derosalike this?13:08
derosadescription "nfssyncd final"13:08
derosastart on stopping dbus 13:08
derosatask13:08
derosaexec nfssyncd-plymouth-final-sync13:08
Keybukright13:11
derosaso, that should block until my cmd finiches, right?13:13
derosa*finishes13:13
Keybukright13:13
derosait blocks when testing with "service dbus stop", but it doesn't when rebooting with "reboot" or using GDM applet13:15
Keybukthere should be no difference between the two13:18
Keybukit may be that on reboot, other things that your task needs aren't around anymore13:18
derosaI'll take a deeper look, thank you13:20
AnAntHello, I have the following code in /etc/init/usb-blaster.conf: http://pastebin.com/SnPtBur213:39
AnAntthe problem is that sometimes the symlink is created, and sometimes not13:39
AnAntwhat could be the possible problem ?13:39
KeybukAnAnt: two "exec" lines13:41
Keybukonly the first will be run13:41
Keybukbetween script...end script is just shell13:41
Keybukjust drop both "exec"13:41
AnAntoh ! silly me13:41
AnAntthanks !13:41
mezcaleroKeybuk: btw, it's not a very grown-up move not to accept the comment i posted a week ago on your latest blog story, while accepting later ones...13:54
Keybukmezcalero: ?13:55
mezcaleroLennart says:13:55
mezcaleroYour comment is awaiting moderation.13:55
mezcaleroMay 31, 2010 at 5:35 pm13:55
Keybukhmm, I don't see anything in the pending queue13:55
Keybuklet me check spam13:55
Keybukah, found it13:56
Keybukit's not a very grown-up move to accuse someone of foul play without even asking them ;-)13:56
* Keybuk clears a couple of others stuck in spam too13:58
mezcaleroI still a kid inside ;-)13:58
mezcaleroadd an "am" there13:59
magciusuggh16:17
magciussomehow I knew this would happen16:17
Keybukmagcius: I knew it would to16:18
magciusKeybuk: thoughts?16:19
Keybukthe only thing we can do is fight16:19
magciusKeybuk: the thing is that the article is half wrong16:19
Keybukthe one about the aliens?16:19
magciusKeybuk: nah, systemd16:19
magciusoh wait16:19
magciusyeah, that's the one too16:19
magciusKeybuk: it says a lot about manual configuration of rules and stuff16:20
KeybukLennart doesn't "get" Upstart16:20
magciusKeybuk: but, as I understand it, that's all low-level stuff to make it easy for the system to parse at boot-time, right? There's a higher level16:20
magciuslanguage/compiler thing, right?16:20
magciusKeybuk: sshhh, he's in this room.16:21
KeybukI know ;-)16:21
magciusKeybuk: and I'm surprised at that.16:21
magciusKeybuk: and we're now falling back to letting D-Bus starting things too16:21
KeybukD-Bus bus activation is an important part of the plan16:22
magciusyep16:22
Keybukit does for Linux what Mach IPC does for Apple16:22
magciusoh of course16:22
Keybuk(though Apple seem to change their mind on a release by release basis about whether frameworks should use Mach IPC or UNIX sockets)16:22
magciusKeybuk: so, from what I've heard, the rules files were to make it easy to parse, and were done by hand at first16:22
Keybukthe current upstart config?  right16:22
magciusKeybuk: wait, I thought there was a compiler that took a map and generated the rules16:23
KeybukI don't know what you mean by that16:24
magciusKeybuk: for some reason, I thought there was a higher-level language, and a compiler that took conditions and optimized for them16:24
Keybukin Upstart?  no16:24
Keybukthat'd be the wrong approach anyway16:24
magciusKeybuk: like, on an SSD, the compiler would generate different rules than an 6100 RPM HDD16:24
magciusKeybuk: so how do you handle system services?16:25
magciusKeybuk: like Apache, etc. etc.16:25
KeybukI'm not sure I know what you're asking16:26
magciusKeybuk: I must be thinking of another init system16:27
magciusKeybuk: but if I have a service like httpd to start at boot time16:27
magciusKeybuk: and I install the package, what rules get put into place to ensure that it does?16:27
Keybuka configuration file in /etc/init16:28
magciusKeybuk: and is this a sh script that uses the Debian start-stop-daemon stuff?16:28
Keybukno16:28
magciusok, so, there's a /etc/init/httpd.rule or something16:28
Keybukright16:29
magciusand it has "d-bus-started" as a dependency?16:29
KeybukUpstart isn't a dependency-based system16:29
Keybuk(and why would a web server need D-Bus?! :p)16:29
magciusKeybuk: does anything start before d-bus?16:29
Keybuklots of things16:30
magciusok16:30
Keybuksome things start in parallel with D-Bus too16:30
mezcaleromagcius: for example if you plug in mod_dnssd into apache it would talk to avahi via dbus to register its services16:30
magciusKeybuk: the systemd blog post mentioned things like the conditionals in Upstart. Do you know how systemd handles these things WITHOUT them?16:30
magciusah16:30
Keybukmagcius: through launchd-like functionality16:31
Keybukone service makes an open() or connect() call to the other, which blocks16:31
magciusmezcalero: are you talking about Upstart or systemd?16:31
mezcaleromagcius: that sentence was about neither16:31
Keybukthe init daemon has prepared the socket in advance, so when it polls, starts the service and passes the socket along to it16:31
Keybukthus services are started by demand16:31
mezcaleroKeybuk: actually often enough it wouldn't even block, i.e. in the case of syslog16:32
KeybukDave calls this pay-as-you-go16:32
mezcaleroKeybuk: it would just enqueue and go on16:32
Keybukmezcalero: indeed16:32
mezcaleroKeybuk: and no, services are not started on-demand, generally16:32
mezcaleroyou can do that16:32
mezcaleromakes little sense though except in very few cases such as ssh or cups16:32
mezcaleroin the general case this is used to parallelize startup16:33
mezcaleronot to do things on-demand16:33
mezcalerodoing things on-demand simply delays things16:33
magciusmezcalero: uh, why would you ever want to not start sshd on boot?16:33
Keybukmezcalero: I was referring to launchd there16:33
mezcaleroKeybuk: same for launchd16:33
KeybukI'm not sure how you're going to do things with systemd in Fedora16:33
magciusexactly16:33
mezcaleromagcius: why would you? only every other month people to tend to log into their laptops with ssh16:33
Keybukmagcius: it's not a matter of "not starting" ... sshd is "possible to start" on every boot16:34
magciusmezcalero: so16:34
mezcaleromagcius: so it is sufficient to have the port open, so that people can connect and then start it on demand16:34
magciusmezcalero: if I want to ssh into my home computer from a remote location16:34
Keybukmagcius: then connecting to the open ssh port (opened by init) would result in sshd starting, and being passed your connection (actually the listening socket)16:34
Keybukthe first connection would take longer due to the overhead of starting ssh16:35
magciusKeybuk: yeah, gotcha16:35
mezcaleromagcius: from the clients' perspective little changes... the port is open with or without it16:35
magciusKeybuk: I forgot that systemd held control of sockets16:35
mezcalerobut anyway, for stuff like dbus or syslog we don't do on-demand loading16:35
Keybukbut then sshd would be running (until a quit time of its own choosing) so subsequent connections while running would be normal16:35
mezcalerowe start all that in parallel16:35
magciusdoes systemd hold all sockets or just the standard <102416:35
mezcaleroKeybuk: actually for sshd we chose to do it like macos, and do it in inetd-like per-connection mode16:35
mezcaleroKeybuk: but thats the only daemon where we do that16:36
Keybukmezcalero: makes sense, since then you can isolate each login16:36
magciusabout networkmanager, here's another thing I hate16:36
mezcaleroKeybuk: yepp, it's really nice actually because you get a seperate cgroup named after the connection parameters for each instance16:36
magciusif you have no wireless, you can't connect to localhost16:36
mezcaleroKeybuk: o.e. the cgroup carries the clients ip addresses and such16:36
magciusso you have to go in and uncheck "Enable Wireless"16:36
Keybukmagcius: yes you can16:36
Keybukif you can't connect to localhost, you have a bigger problem16:37
magciusKeybuk: last time I tried, it returned E_AGAIN16:37
magciusKeybuk: I believe it was either gethostbyaddr or getaddrinfo that failed16:37
Keybuksounds like your box is misconfigured16:37
magciusit was a fedora box :P16:42
Keybukmagcius: I don't really know much about Fedora, sorry16:42
Keybukwhile recently there's been some movement towards making things like Fedora and Ubuntu more similar16:43
Keybukrecent events mean it's more likely they're going to become very different again, possibly even incompatible16:44
mezcaleroKeybuk: hey, you are welcome to adopt systemd in ubuntu too, to work against that! ;-)16:56
Keybukmezcalero: not going to happen ;-)16:56
mezcaleroKeybuk: tss, just admit it, deep in your heart you want it too!17:06
Keybukmezcalero: it'd certainly make my life much easier17:07
Keybukbut then we'd have to rename our distro to Ubuntu Lennarx17:07
mezcaleroi am a humble man, no need for that ;-)17:11
mezcaleroKeybuk: btw, have you seen how i love ubuntu and now am a facebook fan of ubuntu? if that's not proof that i don't hate ubunut i don't know what could be proof enough ;-)17:11
* Keybuk has one of the "I am Fedora" t-shirts17:12
Keybukcan we make out now?17:12
mezcaleronope, sorry, not into dudes. Also, I have more Suse shirts than Ubuntu shirts...17:13
mezcalerobut otoh i have more ubuntu pens than any other distro pens17:13
sadmacmezcalero: ...so who does that leave you making out with?17:14
mezcalerobut in regards to usb keys mandriva i love the most17:14
mezcalerosadmac: Suse is a german girl's name...17:14
sadmacmezcalero: also wasn't it Novell that inserted that cute Linux girl into the I'm a Mac/I'm a PC commercials?17:16
Keybukoh, usb keys I'm totally for ubuntu17:16
Keybukwe have boxes full of them at the office17:16
KeybukI never need to pay for portable storage again17:16

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