Re: Which class gets applied first?
On Fri, 28 Nov 2008 11:47:43 -0500, Ryan Steele [EMAIL PROTECTED] said: Forgive me for asking what is potentially an obvious question, but do you mean the order defined in 50-host-classes? So, if I have: echo CLASS2 CLASS1 ;; ...in my 50-host-classes, CLASS2/80-ssh gets run before CLASS1/80-ssh? Yep. The order of classes deternine the order of the scripts get executed. You might also want to read man 1 fai-class, this has a bit more of information around defining classes and stuff. Best, Michael pgp1Y05mBiFiV.pgp Description: PGP signature
Re: Which class gets applied first?
Thomas Lange wrote: On Wed, 26 Nov 2008 09:56:56 -0500, Ryan Steele [EMAIL PROTECTED] said: In a situation where the FAI client uses several classes that have package_config files, are all the applicable package_config/ files processed in a certain order, or at the same time? In other words, are they processed based on the lexical ordering of their names (e.g. CLASSA comes before CLASSZ, CLASS1 comes before CLASS2, etc.), or some other criteria? All package names from both classes are combined to a long list. And in the same vein, what about custom scripts? E.g., if you have: CLASS1/80-ssh CLASS2/80-ssh ... are they run in lexical order (e.g., CLASS1's 80-ssh gets run first), or ...? Obviously, you can't concatenate these, as the interpreter could differ from script to script. I was pretty sure that this is documented, but apparently this is not the case, neither the FAI guide nor fai-do-scripts(1) tells you about this. Thomas, did I miss a point where this _is_ documented? Either way: The order of classes defines the order of execution, that is: - DEFAULT is first - LAST is last - in between go your classes in the order defined. Best, Michael pgpiQxYGsT8Ex.pgp Description: PGP signature
Re: Which class gets applied first?
Michael Tautschnig wrote: Thomas Lange wrote: On Wed, 26 Nov 2008 09:56:56 -0500, Ryan Steele [EMAIL PROTECTED] said: In a situation where the FAI client uses several classes that have package_config files, are all the applicable package_config/ files processed in a certain order, or at the same time? In other words, are they processed based on the lexical ordering of their names (e.g. CLASSA comes before CLASSZ, CLASS1 comes before CLASS2, etc.), or some other criteria? All package names from both classes are combined to a long list. And in the same vein, what about custom scripts? E.g., if you have: CLASS1/80-ssh CLASS2/80-ssh ... are they run in lexical order (e.g., CLASS1's 80-ssh gets run first), or ...? Obviously, you can't concatenate these, as the interpreter could differ from script to script. I was pretty sure that this is documented, but apparently this is not the case, neither the FAI guide nor fai-do-scripts(1) tells you about this. Thomas, did I miss a point where this _is_ documented? Either way: The order of classes defines the order of execution, that is: - DEFAULT is first - LAST is last - in between go your classes in the order defined. Forgive me for asking what is potentially an obvious question, but do you mean the order defined in 50-host-classes? So, if I have: echo CLASS2 CLASS1 ;; ...in my 50-host-classes, CLASS2/80-ssh gets run before CLASS1/80-ssh? Respectfully, Ryan
Re: Which class gets applied first?
Thomas Lange wrote: On Wed, 26 Nov 2008 09:56:56 -0500, Ryan Steele [EMAIL PROTECTED] said: Well, the packages might not always handle the order. Using the locale example again, a package might not 'require' locales to be configured, if it can use 'POSIX' or 'C' - how is the package to know that you don't want those? It can't read your mind - it's going to use whatever is there. This is just one case where the package cannot predict everything the user might want. OK, now I understand. I've filed a bug report for this. http://bugs.debian.org/506971 Cool, sounds good - thanks Thomas. Regards, Ryan
Re: Which class gets applied first?
Ryan Steele schrieb: processed in a certain order, or at the same time? In other words, are they processed based on the lexical ordering of their names (e.g. CLASSA comes before CLASSZ, CLASS1 comes before CLASS2, etc.), or some other criteria? As a more concrete example, if I have this in my yes Ingo -- Linuxhotel GmbH, Geschäftsführer Dipl.-Ing. Ingo Wichmann HRB 20463 Amtsgericht Essen, UStID DE 814 943 641 Antonienallee 1, 45279 Essen, Tel.: 0201 8536-600, http://www.linuxhotel.de
Re: Which class gets applied first?
Ingo Wichmann wrote: Ryan Steele schrieb: processed in a certain order, or at the same time? In other words, are they processed based on the lexical ordering of their names (e.g. CLASSA comes before CLASSZ, CLASS1 comes before CLASS2, etc.), or some other criteria? As a more concrete example, if I have this in my yes Ingo Um, yes to which question? There are two questions in the above snippet. Respectfully, Ryan
Re: Which class gets applied first?
Ryan Steele schrieb: Ingo Wichmann wrote: Ryan Steele schrieb: processed in a certain order, or at the same time? In other words, are they processed based on the lexical ordering of their names (e.g. CLASSA comes before CLASSZ, CLASS1 comes before CLASS2, etc.), or some other criteria? As a more concrete example, if I have this in my yes Um, yes to which question? There are two questions in the above snippet. Yes is a perfectly valid answer to an or-question. (if at least one of both parts is true) ;) As I understood FAI, the classes are handled in the order they were defined. Compare /tmp/fai/FAI_CLASSES while installing. (May require debug mode or Ctrl-C.) The same information can be found on an already installed host somewhere under /var/log/fai/...) Usually the scripts in $FAI/class announce DEFAULT first, then the architecture (I386/AMD64), then some other (user defined) stuff, the hostname and finally LAST. tschüß thomas
Re: Which class gets applied first?
On Mon, 24 Nov 2008 16:15:38 -0500, Ryan Steele [EMAIL PROTECTED] said: Preface: using version 3.2.14 In a situation where the FAI client uses several classes that have package_config files, are all the applicable package_config/ files processed in a certain order, or at the same time? All package names from both classes are combined to a long list. ...does CLASS1 always get executed before CLASS2, resulting in CLASS1's packages being installed first? No. I get the feeling that all the packages get added to one big packages list when all is said and done Yep. that's the way install_pacakges is working. you will also see the in software.log (or fai.log) which shows you how aptitude or apt-get is called. I have one situation were I also like to determine the order of packages that gets installed, so I use a hook for that. Not perfect, since it doesn't use the package_config file. IMO it's a bug in aptitude if some combination of packages don't install well. Maybe I should add an option for install_packages, which tells it to isntall packages in the order of classes instead of collecting all names to a long list. I there a special reason for you that the packages are installed in the order of the classes? -- regards Thomas
Re: Which class gets applied first?
Thomas Lange wrote: On Mon, 24 Nov 2008 16:15:38 -0500, Ryan Steele [EMAIL PROTECTED] said: Preface: using version 3.2.14 In a situation where the FAI client uses several classes that have package_config files, are all the applicable package_config/ files processed in a certain order, or at the same time? All package names from both classes are combined to a long list. Thanks for the clarification. Might I suggest a tidbit of info in the man page or the online documentation asserting this? I for one, found the answer not to be (easily) self-evident (though others might object to that claim). Maybe I should add an option for install_packages, which tells it to isntall packages in the order of classes instead of collecting all names to a long list. I could see this as being potentially useful, so long as it wasn't the default behavior. Though, I personally would rather have the ability to specify things with even more granularity, such as a way to specify this at the package level. E.g., I could have an option to specify a list of packages that should be installed before the rest and in the order that they are specified, but don't necessarily (or logically) belong in a class all their own. Currently, our only recourse for doing so is a hook to task_instsoft, which doesn't strike me as being a particularly clean solution - it seems like more of an afterthought. Perhaps something like this in the package_config/ files: PACKAGES aptitude INSTALL_FIRST packageA packageB packageC ...which would tell install_packages to move these to the very top of the packages list in the order specified, so that they are the first ones encountered by aptitude (or the package manager of choice). In combination with your idea of installing packages in the order of classes specified, we could have, with great flexibility and granularity, a way to specify the order that packages are installed. As a more concrete example, if I have two classes CLASS1 and CLASS2: package_config/CLASS1: PACKAGES aptitude INSTALL_FIRST foo bar PACKAGES aptitude baz quux ... package_config/CLASS2: PACKAGES aptitude INSTALL_FIRST locales belocs-locales-bin util-linux-locales PACKAGES aptitude package-that-depends-on-locales-being-set otherpackages-that-depends-on-locales-being-set ... I could then specify that CLASS2 be installed before CLASS1, and my package list would get passed to aptitude as: locales belocs-locales-bin util-linux-locales foo bar ... package-that-depends-on-locales-being-set otherpackages-that-depends-on-locales-being-set ... baz quux Or, if I chose not to apply classes in the order they were defined but kept the rest of the config the same, I would at least be guaranteed that locales, belocs-locales-bin, util-linux-locales, foo, and bar would be installed before the rest of the packages (even if those first 5 weren't in that specific order). Just a thought - it may be not be desirable or even worth implementing, but I could certainly derive some benefit from it (for example, up until recently in Intrepid Ibex, the postgres-8.3 package for Ubuntu did not require locales be installed first, which meant that I was basically stuck with the default 'C' locale which resulted in SQL_ASCII encodings in my postgres, template0, and template1 db's unless I installed postgres-8.3 in a pre-softinst hook or a custom script, the latter of which I ended up doing.) I there a special reason for you that the packages are installed in the order of the classes? Nope, in fact, I was hoping you would tell me what you did - that the packages get coalesced in to one monolithic list. It's the way I'd expect things to work, since apt/aptitude should be smart enough to figure out which packages need to get installed before others (assuming the package maintainers have done their job in specifying the Depends, which as mentioned above, doesn't always happen ^_^). Thanks a lot for your clarifications. Respectfully, Ryan
Re: Which class gets applied first?
(Seems I was wrong. Well you learn something new every day. =) ) Ryan Steele schrieb: package_config/CLASS2: PACKAGES aptitude INSTALL_FIRST locales belocs-locales-bin util-linux-locales PACKAGES aptitude package-that-depends-on-locales-being-set otherpackages-that-depends-on-locales-being-set ... I could then specify that CLASS2 be installed before CLASS1, and my package list would get passed to aptitude as: locales belocs-locales-bin util-linux-locales foo bar ... package-that-depends-on-locales-being-set otherpackages-that-depends-on-locales-being-set ... baz quux Did you encounter a problem with the default behaviour? It looks like it, else you probably wouldn't feel the need to ask about this. Up until now I had the fortune of aptitude figuring out dependencies on it's on. Which means that either I didn't watch my installations closely enough and missed out on something, or something is broken on your end. Is there a specific distribution or package you are encountering problems with? tschüß thomas