Presentation is loading. Please wait.

Presentation is loading. Please wait.

Partner Logo German Cancio – WP4-install LCFG HOW-TO - n° 1 WP4 hands-on workshop: EDG LCFGng exercises

Similar presentations


Presentation on theme: "Partner Logo German Cancio – WP4-install LCFG HOW-TO - n° 1 WP4 hands-on workshop: EDG LCFGng exercises"— Presentation transcript:

1 Partner Logo German Cancio – WP4-install LCFG HOW-TO - n° 1 WP4 hands-on workshop: EDG LCFGng exercises German.Cancio@cern.ch

2 German Cancio – WP4-install LCFG HOW-TO - n° 2 Overview LCFGng Exercises 1.Simple reconfiguration of root password 2.Changing polling interval, forcing profile updates 3.Managing users 4.Managing RPM’s 5.Installing and managing components

3 German Cancio – WP4-install LCFG HOW-TO - n° 3 Exercise 1: Simple client reconfiguration: changing the root password of the client

4 German Cancio – WP4-install LCFG HOW-TO - n° 4 Simple client reconfiguration (I) Proceed: 1.Log on to the server XXX.cern.ch (see blackboard) 1.As root, password: XXXX (see blackboard) 2.Log on your client 1.As root; machine name and password on blackboard 3.On the server, start editing your machine’s configuration file cd /var/obj/conf/server/source vi or emacs 4.Change the client’s root password 1.Use an encrypted password generated eg. with perl: 2.perl –e ‘print crypt(“mypassword”,rt);’ 3.Change auth.rootpwd to the new encrypted password

5 German Cancio – WP4-install LCFG HOW-TO - n° 5 Simple client reconfiguration (II) 5.Compile the profile using mkxprof, verifying that no errors or warnings produced /usr/sbin/mkxprof –v # use –v –s for updating web pg 6.Wait until the profile is propagated to the client (~ 60 seconds) The client node is notified automatically of changes using UDP, but sometimes UDP packages are lost, so there is also a regular polling. 7.On the client, check that the configuration has been received Run qxprof: qxprof auth.rootpwd 8.On the client, check that /etc/shadow has been updated properly. 9.Open another connection to the client, and verify that your new root password actually works ;-) 10.On the client, check the auth log file in /var/obj/log/auth

6 German Cancio – WP4-install LCFG HOW-TO - n° 6 Exercise 2: Changing client polling interval, force profile updates

7 German Cancio – WP4-install LCFG HOW-TO - n° 7 LCFGng polling and profile updates (I)  The client.poll resource defines the polling interval qxprof client.poll Poll=5m+1m -> this means that a poll is done every 5 minutes plus a random interval ranging from zero seconds to 1m. u To change the polling frequence, edit your client component configuration file, and add a line: +client.poll1m+1s n This will set the polling to 1m and a random interval of 1s. n Reminder: the ‘+’ before ‘client’ tells rdxprof to overwrite an existing value.  Run mkxprof on the server u Go to the client, wait for a moment and verify that the polling interval has been changed in the profile qxprof client.poll Poll=1m+1s

8 German Cancio – WP4-install LCFG HOW-TO - n° 8 LCFGng polling and profile updates (II)  You can now run ‘ ps –auxwwwww|grep client’ and verify that the rdxprof process has now the new poll interval. u LCFG profile updates can be forced by restarting the client by hand. /etc/obj/client restart will do this. n This may be useful in case the client process ‘hangs’ for whatever reason.

9 German Cancio – WP4-install LCFG HOW-TO - n° 9 Exercise 3: Adding users

10 German Cancio – WP4-install LCFG HOW-TO - n° 10 Adding users (I)  Users have to be defined in the auth.XXX resources. auth.users : space separated list of user login names n auth.userpwd_, auth.userhome_, auth.usergroup_ …  But, if we want to ADD a user to the already existing user list, we can’t just redefine auth.users ! If we define in a header file ( animal-farm-users.h ) auth.users napoleon squealer snowball n And we want to add a user ‘boxer’ in our machine’s config file #include “animal-farm-users.h” +auth.usersboxer The end result will be only ‘boxer’! Since the old value is overwritten.  The EXTRA macro defined in macros-cfg.h is useful here. #include “animal-farm-users.h” EXTRA(auth.users) boxer The end result will be: auth.users napoleon squealer snowball boxer

11 German Cancio – WP4-install LCFG HOW-TO - n° 11 Adding users (II) Exercise:  Edit your machine’s configuration file, include “ animal-farm-users.h ”, and add the following user: n Username: “Horse Boxer” n Login name: boxer n Encrypted password: Home directory: /home/boxer n Group: farm Shell: /bin/sh  Hint: have a look at how ‘ animal-farm-users.h’ defines users ;-)  Hint2: use the EXTRA macro ;-)  Compile the configuration with mkxprof  On the client, verify that /etc/password and /etc/shadow have been regenerated, and that the home directory has been created.

12 German Cancio – WP4-install LCFG HOW-TO - n° 12 Adding users (III) Exercise (contd.):  Removing users: just remove all configuration entries related to the user (or remove appropriate #include statements), and re-run mkxprof. u Note that the home directories of removed users are not deleted.  Homework: Check the man page of the auth component ( man edg- lcfg-auth ) for more resources to configure.

13 German Cancio – WP4-install LCFG HOW-TO - n° 13 Exercise 4: Adding and removing RPMs

14 German Cancio – WP4-install LCFG HOW-TO - n° 14 Adding and removing RPM’s (I) u In order to add/remove packages to a client, the corresponding RPM’s have to be added to the Repository and to the RPM configuration files.  Updaterpms requires to generate special ‘RPM header files’. These RPM header files are created and updated by running ‘make’ in the repository area directories after downloading the RPM’s. n Have a look at the Makefile under /opt/local/linux/6.2/RPMS/LCFGng  The RPM configuration files are stored under /opt/local/linux/6.2/rpmcfg  The configuration file is defined by the component configuration resource updaterpms.rpmcfg Run on the client: qxprof updaterpms.rpmcfg to find out your configuration file.

15 German Cancio – WP4-install LCFG HOW-TO - n° 15 Adding and removing RPMs (II) u Adding a RPM to the Repository: n Copy the RPM to the repository location on the server, ie. cp myrpm-1.2-3.noarch.rpm /opt/local/linux/6.2/RPMS/WPx n Generate the RPM ‘header’ file by issuing cd /opt/local/linux/6.2/RPMS/WPx; make n The ‘header’ file is named as the original RPM but starting with a ‘.’ Don’t forget to run make ! u Removing a RPM from the Repository cd /opt/local/linux/6.2/RPMS/WPx rm myrpm-1.2-3.myrpm-1.2.3 # remove both RPM and header

16 German Cancio – WP4-install LCFG HOW-TO - n° 16 Adding and removing RPMs (III) u Adding an RPM to the configuration: n Include a line with a ‘+’ and the name of the RPM. n The version and release can be specified, or set to ‘*-*’ which means: take the latest version-release of this package found on the server Example: +emacs-21.4-3  take the emacs 21.4 release 3 Example: +xeyes-*-*  take the latest version of xeyes u Removing RPM’s from the configuration listed in a included template: n Use the ‘-’ prefix instead of ‘+’ for removing an RPM even if it has been declared in a header file. Example: -xeyes-*-*  remove (any version of) xeyes

17 German Cancio – WP4-install LCFG HOW-TO - n° 17 Adding and removing RPM’s (IV) u Ignoring locally installed RPM’s: By default, updaterpms removes all RPM’s which are not found in the RPM configuration file. n However, it is possible to avoid erasing some RPM’s by declaring them in the RPM configuration file: xeyes-*-*:i  keeps any version of xeyes you have on the node. It is also possible to set the updaterpms.localpkgs resource to ‘yes’.

18 German Cancio – WP4-install LCFG HOW-TO - n° 18 Adding and removing RPMs (V) u By default, updaterpms is started by via cron at 1 AM. It is not started automatically on config changes. u Updaterpms can be also started by hand, by running the updaterpms component: /etc/obj/updaterpms start  Note that, if you use wildcards ( *-* ) in the RPM config, the wilcard expansion is done when you run updaterpms, and not when you run mkxprof!  Documentation: man page for updaterpms ( man updaterpms ), man page for the updaterpms component ( man edg-lcfg-updaterpms )

19 German Cancio – WP4-install LCFG HOW-TO - n° 19 Adding and removing RPMs (VI) Exercise: Add RPM’s to the configuration of your node. 1.Edit in /opt/local/linux/6.2/rpmcfg your RPM configuration file (hint: use qxprof on the client to find out which one to edit) 2.Add the following RPM package: the latest version of the package called “edg-lcfg-syslog”. 3.Start the updaterpms component. Verify that the package has been installed by running ‘rpm –q edg-lcfg-syslog’. 4.Remove the package from the node using ‘ rpm –e edg-lcfg-syslog’ 5.Run again updaterpms. The package should be installed again. 6.Edit the RPM configuration file, and remove the line for edg-lcfg-syslog. 7.Start the updaterpms component; verify that edg-lcfg-syslog is removed.

20 German Cancio – WP4-install LCFG HOW-TO - n° 20 Exercise 5: Adding, configuring, running components

21 German Cancio – WP4-install LCFG HOW-TO - n° 21 Adding/configuring LCFGng components (I) u LCFG components are packaged in two RPM’s: edg-lcfg-foo or lcfg-foo : contains all necessary files for the client edg-lcfg-foo-defaults or lcfg-foo-defaults : contains the server default configuration. u The LCFGng server RPM can be installed with the rpm command on the server, while as the client RPM has to be installed with updaterpms on the client (see exercise 4). u A component has to be also added to two component resources: profile.components  list of components used on the client boot.services  list of components to start at boot time u Each component requires also some specific configuration: Pprofile.version_  set to 1..resourceY … (component specific resources).

22 German Cancio – WP4-install LCFG HOW-TO - n° 22 Adding/configuring LCFGng components (II) Exercise: Add the syslog component to your client. 1. Verifications: a)Verify that edg-lcfg-syslog RPMs are available on the server (hint: in the RPMS/LCFGng directory). b)Verify that the RPM ‘header’ files are also there. c)Verify that the server RPM is installed on the server. 2. Add to your RPM configuration file the latest version of edg-lcfg- syslog. 3. On the client, run /etc/obj/updaterpms start. The RPM should be now installed Verify with rpm –q on client.

23 German Cancio – WP4-install LCFG HOW-TO - n° 23 Adding/configuring LCFGng components (III) 4.On the client, read the edg-lcfg-syslog man page. Look specially at the ‘RESOURCES’ section. 5.(On the server), edit your component configuration file, and add the necessary entries for profile.components, boot.services (use the EXTRA macro) define profile.version_syslog to 1. Set the kern.* messages to go to /var/log/kernel.log (see the man page above!) 6.Run mkxprof. Verify on the client (with qxprof ) that the resources are OK. 7.On the client, start the syslog component with /etc/obj/syslog start 8.From now on, the component is reconfigured automatically. 9.Look at the /etc/syslog.conf file. Is the kern.* entry there? 10.Remove the kern.* entry in the component configuration file. Run mkxprof, and verify that the kern.* entry has been removed from /etc/syslog.conf on the client.

24 German Cancio – WP4-install LCFG HOW-TO - n° 24 Adding/configuring LCFGng components (IV) u The same principle described here applies to all components. u Most components are included by default in the EDG RPM and component configuration files. u However, they may require site-specific configurations.


Download ppt "Partner Logo German Cancio – WP4-install LCFG HOW-TO - n° 1 WP4 hands-on workshop: EDG LCFGng exercises"

Similar presentations


Ads by Google