/srv/irclogs.ubuntu.com/2009/11/30/#upstart.txt

shyam_ki was wondering how to boot into two different user configurations from the same root partition from grub itself! is it possible?06:34
sadmac_homeshyam_k: you could have different grub lines pass different kernel arguments. Then early userspace/init can read those arguments out of /proc/cmdline and boot the system differently06:40
shyam_koh wow /proc/cmdline was new to me.. great:)06:41
rohdefwhy wont this: http://pastebin.com/d2d3c83e6 start automatically when the xbmc-live job is started? I placed it in /etc/init as I should (as far as I can read at least)13:27
* rohdef is wondering if there's any activity here13:39
JanCdid you check if the xbmc-live job was actually started?14:00
=== robbiew_ is now known as robbiew
rohdefJanC, I can see that it starts, since it's my complete gui, I'll try a reboot and check the status, but I'm very certain14:50
rohdefJanC, "status xbmc-live" returns "xbmc-live start/running, process 750"14:54
rohdefwhy wont this: http://pastebin.com/d2d3c83e6 start automatically when the xbmc-live job is started? I placed it in /etc/init as I should (as far as I can read at least), I also tried with other setups such as "start on startup" and "start on started hal". The script works fine when using "start krnet"16:08
sadmacrohdef: did start on startup and start on hal work?16:09
rohdefnopes16:09
sadmacstartup should definitely work16:10
sadmachmm16:10
rohdefI gotta admit I'm a bit puzzled about this myself, first time trying though, but it seems very straight forward, which makes it wierder to me that it doesn't work16:12
rohdefand it would be really typical if it's due to some very stupid detail :p16:12
sadmacrohdef: anything in /var/log/messages?16:12
rohdefsadmac I'll check just a sec16:13
rohdefsadmac, ... a segfault that could be caused by my script, only way I can see it possible is if it runs too early, I'll just try some things16:17
rohdefsadmac thanks a lot, your question lead me to the problem; premature execution16:27
rohdefgotta get used to the thought of asyncronious execution (actually a really good thing, just have to get used to it ;) )16:28
sadmacrohdef: heh. glad to help.16:29
superm1Daviey and I were talking the other day and were wondering how doable a feature for upstart would be to add a dependency that only exists if it's installed. for us it would be only starting before mysql if it's there, otherwise wait for the standard other things  this same thing came up during UDS  to try to solve a problem in the proprietary x session17:09
KeybukI think it makes sense17:13
Keybukyou'd need the logic to automatically disable a job if other things weren't there17:14
Keybukotherwise Upstart might think mysql exists if it was removed but not purged because /etc/init/mysql.conf still exists17:14
DavieyKeybuk: would it be possible to make upstart "apt aware"?17:27
Davieyie, query the apt db?17:27
Davieywell i know it *would* be possible, but is it feasible?17:27
Keybukyou could do that17:28
Keybukif you had an addon that parsed the apt db and created states for each installed package17:28
DavieyI imagine it would be quite expensive in time to do it for every upstart task.. but perhaps cache or add an apt hook?17:28
Keybukand then you'd need it updated each time you changed the db17:28
Keybuk(you mean the dpkg db btw)17:28
Davieyyeah17:29
Davieyi'm trying to think of a way that is generic, rather than having specific code tied to an application/package17:37
Davieyactually, "if upstart job mysql exists"17:38
DavieyDoes that make sense?17:38
DavieyI'm happy to try and help, but a few pointers would be appreciated :)17:39
Keybukthat's what I was thinking17:42
Keybukhave a state for "job exists"17:42
Keybukwhile mysql or not exists mysql17:42
Keybuktype thing17:42
Davieyjah17:44
Keybukthough that's somewhat booleanly mad17:45
Davieyhmm17:50
Davieysyntatically?17:50
Davieysyntactically*17:51
Keybukyeah18:33
Keybukwhile foo or foo doesn't exist18:33
Keybukbecause while foo if foo exists is a bit more difficult to parse ;)18:33
sadmacKeybuk: I've been thinking about an enable stanza18:33
sadmacKeybuk: that would allow you to shift other jobs into auto mode when it came up.18:34
sadmacKeybuk: basically its a way to do the "profiles" thing as jobs.18:35
Keybukhow do you mean?18:35
sadmacKeybuk: It works exactly like the before stanza, only its OR'd on the other end. for example, if you have 2 jobs with "before a" in them, then BOTH need to be running for a to start. If you have 2 jobs with "enable a" in them, then a can start as long as either one is running18:36
Keybukstill not following?18:36
sadmacKeybuk: ok, lets start with the practical case. So you had that idea to let the user list services they wanted to start at boot on the kernel command line right?18:37
Keybukright18:38
Keybukwell18:38
Keybukmore to create pretend services18:38
Keybukbut yes18:38
sadmacKeybuk: basically, we'd have the kernel command line always name one service called "default"18:38
sadmacKeybuk: and the default service definition would just have stanzas like "enable hal / enable tty / enable X / enable dbus / enable ..."18:39
KeybukI'd rather do that the other way around18:39
Keybukin the HAL definition, have "while default"18:39
sadmacKeybuk: that makes it hard to create new profiles.18:39
KeybukI don't think profiles are common enough to worry about it18:40
sadmacKeybuk: so if I wanted to create a new set of services called "turbo_mode" that had some different configuration, I'd have to edit every job I wanted to start in that mode.18:40
Keybuksure18:40
Keybukjobs start by default anyway18:40
Keybukwhat you really want is a profile that disables jobs you don't want18:40
sadmacKeybuk: usually if you care enough to have profiles you have a huge number of services to worry about, and the set you want actually /running/ at any one time is much smaller than that.18:41
Keybukright, so you're talking about someone who'd have upstart set up that all jobs were in manual mode by default18:42
Keybukand explicitly enable the ones they wanted?18:42
sadmacKeybuk: sort of. basically all jobs would be in manual mode always unless hit by an "enable" stanza.18:43
sadmacKeybuk: the security people are going to murder you if you're not careful about this "default to running" thing :)18:43
Keybukerr18:44
KeybukUbuntu and Debian have always done "default to running" :-)18:45
Keybukif you didn't want it running, why did you install the package?18:45
ionIndeed18:45
sadmacKeybuk: you didn't. A partial exploit allowed an attacker to get some privileges on the box. He was then able to install a service and get even more privileges because the service was turned on for him.18:46
Keybukwell18:47
KeybukI guess Fedora defaults to letting anyone install any package18:47
Keybuk:D18:47
sadmacKeybuk: you're connecting exploits that get you one operation on one component and giving them the effectiveness of any exploit anywhere in the universe.18:47
sadmacKeybuk: we did for a bit actually... did you follow that? People were unhappy.18:48
Keybukbut going back to non-trolling for a second18:48
KeybukI guess we're going to have to support the RH not-enabled-by-default mode18:48
Keybukeven if in Ubuntu we still enable-by-default18:48
Keybukin that circumstance, I guess your proposal makes a crazy sense18:48
Keybukthough you'd have to manually update that job file each time a package is installed?18:48
Keybuk(to start it?)18:49
sadmacit also means profiles and services are one object.18:49
sadmacKeybuk: not necessarily... let me think about that18:49
sadmacKeybuk: part of the advantage here is "profiles are services" so we get all the same crazy tools to wire them together.18:49
Keybukright that bit makes sense18:50
sadmacKeybuk: we still allow jobs in folders, right? You could enable by path.18:50
sadmacKeybuk: enable defaults/*18:50
sadmacah, hello chkconfig. I remember you. Good to see you again. Have you been well?18:51
sadmacits not exactly chkconfig though, because you shouldn't need symlinks18:51
Keybukyeah that kind of thing18:52
sadmacKeybuk: the other issue is you can't do a "disable" stanza because then you get a race between the service and the profile that turns it off.18:54
Keybukindeed18:55
Keybukenable makes sense though18:55
Keybukthere'd be a companion option (/etc/init.conf returns? :p) to actually enable the enable stanza18:55
Keybukie. if you were in enable-by-default mode, enable would do nothing18:55
Keybukit only applies in disable-by-default mode18:55
sadmacKeybuk: Ooh, idea: you could have a "disable" stanza that just complements the enable stanza. So if /in the same job/ you had "enable foo* / disable food" you would enable anything starting with foo except the service called "food"18:56
sadmacKeybuk: then, we ship as I described, and you guys just ship a profile with "enable *". the user can then add disables to the bottom of that profile for explicit disabling.18:57
Keybukor we could support zsh globbing18:57
Keybukfoo*~food18:57
sadmacKeybuk: I'd rather do glibc regexen18:57
sadmacKeybuk: at any rate zsh globbing would be less convenient for the use case I mentioned18:58
sadmacKeybuk: this way is actually really nice, because you can do either. Your single-user profile can have "enable this-one-thing", and your multi user profile can have "enable * / disable just-this-one"19:01
sadmacI don't think there's any other system who's effect can't be achieved this way, and its cheap to do. It seems right.19:02
JanChaving a standard way to enable & disable services would also be useful for those who want to create a web or graphical UI to enable/disable services...19:03
sadmacand this way ends up being pluggable too, so tools won't step on each other's toes.19:03
=== robbiew is now known as robbiew-afk
=== notting__ is now known as notting
=== robbiew-afk is now known as robbiew

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