Comment 5 for bug 767290

Revision history for this message
mortheres (mortheres) wrote : Re: [Bug 767290] Re: agent-2.0rc3 (and 4) ignores server setting from /etc/sysconfig/

Salut Remi,

Je suis en train de regarder ton patch. En fait je me demande pourquoi tu reforce la valeur du paramètre "server" avec celui de "optserver" ? Tu ne peux pas reecraser la valeur "server" de la config en la spécifiant dans le fichier de /etc/sysconfig ? Je n'ai pas de chapeau rouge sous la main donc je ne peux pas le tester et me rendre compte.

Ce que je pensais faire, c'etait de t'ajouter une option "--force-server". Si celle-ci est activé, alors ça désactive le paramètre --local qui aurait pu être mis dans le fichier de conf ou en ligne de commande. Donc toi tu aurais juste à mettre "server" (avec l'adresse du server) et "forceserver" (à 1 par exemple) dans ton fichier de /etc/sysconfig.

ça te conviens ça ?

--
Guillaume

----- Mail original -----
De: "Remi Collet" <email address hidden>
À: "guillaume protet" <email address hidden>
Envoyé: Mercredi 27 Avril 2011 08:57:12
Objet: [Bug 767290] Re: agent-2.0rc3 (and 4) ignores server setting from /etc/sysconfig/

Full patch (code in #1 is only partial) to allow command line to
override config setting (required for cron job), used in RPM is
available

http://pkgs.fedoraproject.org/gitweb/?p=ocsinventory-
agent.git;a=blob_plain;f=ocsinventory-agent-options.patch;hb=HEAD

--
You received this bug notification because you are a member of OCS
Inventory Dev Team, which is the registrant for OCS Inventory: OCS
Unified Unix Agent.
https://bugs.launchpad.net/bugs/767290

Title:
  agent-2.0rc3 (and 4) ignores server setting from /etc/sysconfig/

Status in OCS Unified Unix Agent:
  New

Bug description:
  I am trying ocsinventory-agent-2.0rc3 on a SLC5.6 box, but I have some
  problems with the config files.

  For the 1.1.2.1 agent, I get my settings from /etc/sysconfig
  /ocsinventory-agent, and did not have to touch /etc/ocsinventory
  /ocsinventory-agent.cfg. But for the 2.0rc3 agent, that does not work
  anymore. The agent takes the 'local' setting from /etc/ocsinventory
  /ocsinventory-agent.cfg, and later refuses to accept the 'server'
  setting from /etc/sysconfig/ocsinventory-agent: "--server ignored
  since you also use --local".

  I guess this is due to the following code that was in 1.1.2.1, but is
  not in 2.0rc3 any more:

  # allow "server" from command line when "local" in config. file
  if (defined($config->{config}{'optserver'})) {
      $config->{config}{'server'}=$config->{config}{'optserver'};
      undef $config->{config}{'local'};
      undef $config->{config}{'optserver'};
  }

  Best regards,

  Matthias