Statistics
| Branch: | Tag: | Revision:

root / lib @ eb28ecf6

# Date Author Comment
04367e70 11/01/2010 07:27 pm Guido Trotter

Drop the -g shortcut for --vg-name

Changing the volume group is a lot less frequent than acting on a node
group. As such we drop the "-g" shortcut and require the long option to
be passed. In 2.3 the commands which used to accept the volume group as
"-g" won't have any node group option, so no confusion will arise. Later...

eb28ecf6 11/01/2010 07:27 pm Guido Trotter

Merge the common options between import and add

The "I always wanted to do this" commit.

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

1fc34c48 11/01/2010 05:02 pm Michael Hanselmann

config: Write ssconf after renaming instance

This fixes a bug where the ssconf_instance_list file was
not updated after an instance rename.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

5119f2ec 10/29/2010 05:48 pm Michael Hanselmann

Move ganeti-noded to ganeti.server.noded

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

d9c82a4e 10/29/2010 05:48 pm Michael Hanselmann

Move ganeti-rapi to ganeti.server.rapi

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

899c4d2c 10/29/2010 05:48 pm Michael Hanselmann

Prepare move of daemons to ganeti.server

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

29d91329 10/29/2010 05:48 pm Michael Hanselmann

Move ganeti-masterd to ganeti.server.masterd

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

5c9c0e0e 10/29/2010 05:48 pm Michael Hanselmann

Move ganeti-confd to ganeti.server.confd

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

9f4bb951 10/29/2010 05:48 pm Michael Hanselmann

Move ganeti-watcher to ganeti.watcher

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

e986f20c 10/28/2010 07:56 pm Michael Hanselmann

Add support and checks for version in LUXI

A new constant, LUXI_VERSION, is used to verify the peer's version. The
version is optional, so old(er) clients and servers talking to peers not
supporting it won't break. Example with mismatching library:

$ gnt-instance list...

7a8bda3f 10/28/2010 07:56 pm Michael Hanselmann

luxi.ProtocolError: Derive from errors.LuxiError

This allows LUXI errors to be encoded and serialized.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

3b01286e 10/28/2010 07:56 pm Michael Hanselmann

LUExportInstance: Accept instance already shut down

To remove the instance after an export it needs to be stopped. This can
be achived using the parameter “shutdown”, or by explicitly shutting
down the instance before exporting. The latter would still require the...

f9116d58 10/28/2010 05:06 pm Guido Trotter

GanetiLockManager, remove default values

The nodes and instances parameters to the constructor are mandatory
anyway, as a value of None will fail when creating the LockSet. Rather
than fixing this adding code lines, since we never used the default
value, let's remove them and require that the parameters are passed....

1ac6f2ad 10/28/2010 05:06 pm Guido Trotter

ConfigWriter.GetNodeGroupList

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

add6d208 10/28/2010 03:50 pm Iustin Pop

Prevent onlining a node without working noded

This is just a basic check, plus a warning. In the future, we might do
more checks, or prevent simple onlining (without readd) if --force is
not passed.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

4ca52046 10/28/2010 03:49 pm Iustin Pop

Yet another rework in LUSetNodeParms

We will need the new role in CheckPrereq, so move its computation there
and save the new role to self.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

877b849b 10/28/2010 02:51 pm Iustin Pop

Prevent moving/creating instances on non-vm nodes

This small patch modifies LUCreateInstance, LUReplaceDisks and
LUMoveInstance to not use non-vm_capable nodes.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

8bf9e9a5 10/28/2010 02:51 pm Iustin Pop

ConfigWriter: add some helper functions

This can be used to compute a node's instances easily, and a small
function to get all non-vm_capable nodes.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

077114cd 10/28/2010 02:51 pm Iustin Pop

Add vm_capable to LUSetNodeParams

And also do some cleanup: we only run the role changed actions if the
node has actually changed roles.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

53919782 10/28/2010 02:51 pm Iustin Pop

Add vm_capable to gnt-node modify

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

8964ee14 10/28/2010 02:51 pm Iustin Pop

Add support for vm_capable in cluster verify

The method to make vm_capable integrate easily into cluster verify is as follows:

- we add a new NV_VMNODES that represents nonvm-capable nodes
the LU populates this list (it's expected that non-vm_capable nodes...

4e2d3d25 10/28/2010 02:51 pm Iustin Pop

Add an UploadHelper to cmdlib

This is used in two places already, and will be needed in a third, so
let's abstract it.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

77bad5b2 10/28/2010 02:51 pm Iustin Pop

Add support for vm_capable in file distribution

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

fd3d37b6 10/28/2010 02:51 pm Iustin Pop

Add the master/vm_capable flags in node add

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

7b4978ad 10/28/2010 02:51 pm Iustin Pop

Add the capability flags in node info output

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

614e7e26 10/28/2010 02:51 pm Iustin Pop

Add a CheckNodeVmCapable helper in cmdlib

Also changes the error code for the other CheckNode* helpers to
ECODE_STATE, not ECODE_INVAL: ECODE_INVAL is for requests that are
invalid (e.g. create drbd instance with one node), whereas ECODE_STATE
denote requests that are not satisfiable due to cluster/node/instance...

b8d26c6e 10/28/2010 02:34 pm Michael Hanselmann

LUClusterVerify: Complain if disk is marked faulty

This will show a warning if, for example, one side of a DRBD
disk becomes unavailable. The data is collected separately
from the other verification data.

Example output:

  • Verifying instance status
    - ERROR: instance inst1: disk/0 on node2 is faulty...
02266fe0 10/27/2010 02:58 pm Michael Hanselmann

Move gnt-backup to ganeti.client.gnt_backup

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

e792102d 10/27/2010 02:58 pm Michael Hanselmann

Move gnt-instance to ganeti.client.gnt_instance

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

a09b9e3d 10/27/2010 02:58 pm Michael Hanselmann

Move gnt-job to ganeti.client.gnt_job

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

37494fa4 10/27/2010 02:58 pm Michael Hanselmann

Move gnt-node to ganeti.client.gnt_node

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

7b3e7d41 10/27/2010 02:58 pm Michael Hanselmann

Move gnt-cluster to ganeti.client.gnt_cluster

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

6d50f5f9 10/27/2010 02:19 pm Michael Hanselmann

Move gnt-os to ganeti.client.gnt_os

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

c2855a12 10/27/2010 02:19 pm Michael Hanselmann

Move gnt-debug to ganeti.client.gnt_debug

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

2d48a3a2 10/27/2010 02:19 pm Michael Hanselmann

Allow programs to be part of the Ganeti library

Eventually this will help ensuring that clients and servers are of the
same version, as long as they're imported from the same path. Currently
it's relatively easy for gnt-* and ganeti-* to be from a different...

197e3bb2 10/27/2010 01:46 pm Iustin Pop

Implement the master_capable flag in node modify

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

f91e255a 10/27/2010 01:46 pm Iustin Pop

Add master_capab to gnt-node modify

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>
Reviewed-by: René Nussbaumer <>

c190e817 10/27/2010 01:46 pm Iustin Pop

Export the capability flags in query, rapi, ialloc

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

490acd18 10/27/2010 01:46 pm Iustin Pop

Add the master/vm_capable flags to objects

This adds the flag and some initial handling. The rest of the changes,
for cmdlib, come in a separate patch.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

21232d04 10/27/2010 01:44 pm Iustin Pop

Rework node role changes

There have been many bugs in gnt-node modify. Let's try to introduce
some more.

This patch reworks the node role changes from tracking the flag changes
to completely overwriting the flags based on the new role. This paves
the way for (in 2.4 or later) moving to a single attribute for nodes....

c29e35fe 10/26/2010 04:39 pm Michael Hanselmann

rpc: Work around epydoc warning

Aliasing the “threading” module allows us to avoid the “No information
available for ganeti.rpc._RpcThreadLocal's base threading.local” warning
by epydoc.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

b30aded7 10/26/2010 03:38 pm Michael Hanselmann

Merge branch 'devel-2.2'

  • devel-2.2:
    Allow remote imports without checked names
    ConfigWriter: Fix typo in error message parts
    Fix remote imports

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

3f2ad566 10/26/2010 03:25 pm Michael Hanselmann

Allow remote imports without checked names

By default all names are checked (LUCreateInstance, name_check). In some
cases it can be useful to disable this check, but doing so was not
allowed for remote imports. One should be aware, however, that using
this feature can lead to rename script failures when importing a remote...

b883637f 10/26/2010 02:36 pm René Nussbaumer

Support modify of prealloc_wipe_disks config value

Signed-off-by: René Nussbaumer <>
Reviewed-by: Iustin Pop <>

1116c3b2 10/26/2010 12:48 pm Iustin Pop

Export a node's group information in iallocator

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

f936c153 10/26/2010 12:48 pm Iustin Pop

Rename node.nodegroup to node.group

In the context of a node, its group has (at least today) only one
meaning, that is the node's node group. As such, we rename
node.nodegroup to just node.group.

Note: if we want to keep node in there, it should be at least...

a285fcfd 10/26/2010 12:47 pm Iustin Pop

Rename --nodegroup to --node-group

For consistency with other CLI options.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

622444e5 10/26/2010 12:47 pm Iustin Pop

Export node group data in iallocator

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

acd34ea7 10/26/2010 12:47 pm Iustin Pop

Split IAllocator._ComputeClusterData

The node and instance computations were all in this big function; we
separate them out for more clarity.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

a03fcb26 10/26/2010 12:13 pm René Nussbaumer

Putting the pieces together and invoke the wipe in cmdlib

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

271b7cf9 10/26/2010 12:13 pm René Nussbaumer

Adding RPC call for blockdev_wipe

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

da63bb4e 10/26/2010 12:12 pm René Nussbaumer

Second iteration over backend.BlockdevWipe

This patch now uses dd entirely to wipe the disk, make it
much easier to wipe in blocks so we can give interactive feedback
about the status.

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>...

3d889a7d 10/25/2010 02:03 pm Michael Hanselmann

ConfigWriter: Fix typo in error message parts

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

f2165b8a 10/25/2010 01:47 pm Iustin Pop

Simplify and extend the instance OS env

Some parameters were missing (uuid, c/mtime). We simplify the export
method; unfortunately we cannot simply iterate over slots since the
mapping is not 1:1.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

eb180fe2 10/22/2010 06:23 pm Iustin Pop

ConfigWriter: prevent using a foreign config

If the configuration file doesn't denote this node as master, we prevent
startup. This would have detected our previous race condition more
easily, hence we add it as a permanent check.

Signed-off-by: Iustin Pop <>...

21004460 10/22/2010 06:23 pm Iustin Pop

Fix bootstrap.MasterFailover race with watcher

This fixes a recently diagnosed race condition between master failover
and the watcher.

Currently, the master failover first stops the master daemon, checks
that the IP is no longer reachable, and then distributes the updated...

bd407597 10/22/2010 06:23 pm Iustin Pop

ConfigWriter: protect against multiple writers

This should fix the case where there are two masters that both try to
distribute the configuration file to the cluster. The first one that does so,
will "win" the ownership of the config.data.

Signed-off-by: Iustin Pop <>...

8f065ae2 10/22/2010 06:23 pm Iustin Pop

backend.Upload: switch to utils.SafeWriteFile

This allows serialization of updates to a given file, with respect to
other cooperating writers.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

4138d39f 10/22/2010 06:22 pm Iustin Pop

Add a "safe" file wrapper over WriteFile

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

9e100285 10/22/2010 06:21 pm Iustin Pop

Add functions to read and compare file 'ID's

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

574d1b7b 10/22/2010 03:19 pm Michael Hanselmann

LUSetInstanceParams: Remove unused attribute

“os_new” is not used anywhere, removing it.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

69dd363f 10/22/2010 02:47 pm René Nussbaumer

Adding backend method to wipe a block device

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

6e991d0e 10/22/2010 02:46 pm René Nussbaumer

Allow to specify wipe command and flags at configure time

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

c6e85811 10/22/2010 11:42 am Iustin Pop

Fix remote imports

A simple typo…

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

edb8b377 10/22/2010 11:41 am Iustin Pop

Fix typo introduced in 8d8c4ef

Commit 8d8c4ef broke instance reinstall with different OS, due to an
attribute typo.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

e725bee0 10/21/2010 02:17 pm Iustin Pop

Fix clearing of the default iallocator

And also update the man page.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

8d8c4eff 10/21/2010 12:57 pm Michael Hanselmann

gnt-instance reinstall: Allow overriding OS parameters

This allows OS installation scripts to make use of special parameters,
e.g. to retain some data on reinstallation.

The RAPI resource is not updated as it takes all parameters via the
query string and encoding arbitrary data in a query string is tricky....

b44bd844 10/20/2010 07:18 pm Michael Hanselmann

Add option to ignore offline node on instance start/stop

In some cases it can be useful to mark as an instance as started
or stopped while its primary node is offline. With this patch,
a new option, “--ignore-offline”, is introduced to “gnt-instance
start” and “… stop”....

691c81b7 10/20/2010 03:53 pm Michael Hanselmann

utils: Add function to find items in dictionary using regex

This basically extracts a small piece of code from ganeti-rapi and puts
it into a utility function. RAPI resources are found using a dictionary
in which the keys can either be static strings or compiled regular...

b18ecea2 10/19/2010 05:29 pm René Nussbaumer

Let gnt-cluster support prealloc_wipe_disks

This includes a new option gnt-cluster init and approriate output
on gnt-cluster info. Though gnt-cluster modify is not yet prepared.

Signed-off-by: René Nussbaumer <>
Reviewed-by: Iustin Pop <>

4ba4fe14 10/15/2010 06:21 pm Apollon Oikonomopoulos

http.client: Disable SSL session ID cache

This patch disables the SSL session ID cache for all cURL operations.
This is needed because http.HttpBase's PyOpenSSL implementation does not
currently set a context using SSL_set_session_id_context(3SSL), cURL
tries to re-use the session ID and, according to...

7b70d7a8 10/15/2010 06:13 pm Apollon Oikonomopoulos

http.client: Disable SSL session ID cache

This patch disables the SSL session ID cache for all cURL operations.
This is needed because http.HttpBase's PyOpenSSL implementation does not
currently set a context using SSL_set_session_id_context(3SSL), cURL
tries to re-use the session ID and, according to...

c6e7edb8 10/15/2010 05:24 pm Michael Hanselmann

http.auth: Fix docstring error

This was missing from commit 2287b920.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

744061f3 10/14/2010 03:44 pm Iustin Pop

Merge branch 'stable-2.2'

  • stable-2.2:
    Release 2.2.1~rc1
    Require aclocal 1.11.1 or above for devel/release
    Revert "Require aclocal 1.11.1 or above for autogen.sh"
    Add mising --units in gnt-instance list man page
    Set list of trusted SSL CAs for client to verify...
7dcadb74 10/14/2010 01:52 pm Iustin Pop

Merge branch 'stable-2.2' into devel-2.2

  • stable-2.2:
    Require aclocal 1.11.1 or above for devel/release
    Revert "Require aclocal 1.11.1 or above for autogen.sh"
    Set list of trusted SSL CAs for client to verify
    Require aclocal 1.11.1 or above for autogen.sh...
ac96953d 10/13/2010 04:54 pm Michael Hanselmann

Fix compatibility with Pyinotify 0.8

I didn't know why the code previously used
“pyinotify.EventsCodes.ALL_FLAGS” instead of using the flags from
“pyinotify.EventsCodes” directly. Turns out that Pyinotify 0.8 has them
in “pyinotify”, not “pyinotify.EventsCodes”....

e543a42f 10/13/2010 03:18 pm Michael Hanselmann

Extract base class from SingleFileEventHandler

The base class can contain code useful to other inotify users.
As it is “SingleFileEventHandler” can not be used in ganeti-rapi,
therefore it'll use its own small inotify handler class based
on this base class....

2287b920 10/13/2010 03:18 pm Michael Hanselmann

http.auth.ReadPasswordFile: Don't read file directly

Reading the file before this function allows for better error
reporting.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

62e0e880 10/13/2010 02:44 pm Iustin Pop

Move the parameter types to their own module

This is for cleanup, and for later reuse in other parts of the code
(outside of LUs).

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

4b63dc7a 10/13/2010 02:42 pm Iustin Pop

"Fix" handling of old software versions on startup

Currently, masterd startup with old software versions is very confusing
for users: we present two tracebacks, with a message in the middle about
"version mismatch". This can lead to users believing that all that needs...

90224407 10/13/2010 12:59 pm Iustin Pop

Export more information via LUQueryInstances/RAPI

Currently, the custom instance parameters (hv, be, nicp) are only
queryable via LUQueryInstanceData. LUQueryInstance returns only the
filled parameters, thus its users (especially RAPI) have no way to know...

2d93a6a7 10/12/2010 07:09 pm Apollon Oikonomopoulos

Set list of trusted SSL CAs for client to verify

As per SSL_CTX_set_client_CA_list(3SSL), set the list of acceptable CAs
advertised to SSL clients to include the server's own certificate. This
evidently fixes the pycurl/gnutls RPC client.

During the TLS Handshake, when client verification is requested, the...

bd631b02 10/12/2010 06:25 pm Iustin Pop

Show instance state in instance console failures

The current message is not entirely clear, as it doesn't show the reason
why the instance is not running.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

614244bd 10/12/2010 04:32 pm Iustin Pop

Fix epydoc errors

And sorry!

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

9e49dfc5 10/12/2010 03:48 pm Michael Hanselmann

jqueue: Fix bug when cancelling jobs

If a job was cancelled while it was waiting for locks, an assertion
would've failed. This patch fixes the problem and provides a unit
test to check for this situation.

Signed-off-by: Michael Hanselmann <>...

900df6cd 10/12/2010 03:48 pm Michael Hanselmann

mcpu: Raise directly in _AcquireLocks

Removes code duplication.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

b8802cc4 10/12/2010 03:48 pm Michael Hanselmann

jqueue/gnt-job: Add job priority fields for display

These fields can help with debugging.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

320d1daf 10/12/2010 03:48 pm Michael Hanselmann

jqueue: Resume jobs from “waitlock” status (2nd try)

Commit 5ef699a0e had to roll back an earlier attempt at implementing
this. With the improved job queue processer, this is finally possible.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

3d914585 10/12/2010 01:57 pm René Nussbaumer

Add prealloc_wipe_disks as a cluster-wide configuration variable

This is the first step for the support of wiping block devices prior
to creation of the instance.

Signed-off-by: René Nussbaumer <>
Reviewed-by: Iustin Pop <>

69750d44 10/11/2010 04:16 pm Iustin Pop

Merge branch 'devel-2.2'

  • devel-2.2:
    RPC: disable curl's Expect header

Conflicts:
lib/rpc.py (trivial, copyright header)

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

8e29563f 10/11/2010 04:15 pm Iustin Pop

RPC: disable curl's Expect header

This patch solves the very slow (~8-9 seconds) gnt-instance modify
behaviour. Well, it solves in general the slow RPC behaviour, but it was
most visible in that LU.

It seems that curl's behaviour with regard to file uploads (via PUT) and...

86b16e9d 10/07/2010 06:10 pm Michael Hanselmann

jqueue, CancelJob: Check status only once per call

This simplifies the code a bit--the status is only checked once.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

ed3920e3 10/07/2010 11:32 am Iustin Pop

Fix a rare bug in StartDaemonChild and GenericMain

I've seen cases where the result from str(sys.exc_info()[1]) is ""; this
breaks the error reporting as the parent relies on non-empty error
messages to properly detect child status (otherwise it will try to read...

3e87c1bf 10/07/2010 11:31 am Iustin Pop

Enhance the error reporting

Since daemon startup error will be often related to socket errors, so it
makes sense to change the original reporting:

Error when starting daemon process: "(98, 'Address already in use')"

Into:

Error when starting daemon process: 'Socket-related error: Address...
b78aa8c2 10/07/2010 11:31 am Iustin Pop

Change daemon.GenericMain/utils.Daemonize workflow

This patch copies the pipe-based error reporting functionality from
utils.StartDaemon (I gave up for now on tryin to merge the two).

This patch will fix two longstanding bugs:

- if we fork, we lose all error reporting from the child to the original...

b42ea9ed 10/07/2010 11:31 am Iustin Pop

Change utils.GenericMain protocol

Currently, GenericMain does a two-staged workflow:

- Check, before forking
- then Exec, after forking

This means we don't have any possibility to treat preparation work
(before the daemon is ready for work) different from the actual work....

5c4d37f9 10/07/2010 11:31 am Iustin Pop

Use only one version of WritePidFile

This patch merges the pid file handling used for ganeti-* daemons and
impexp daemons. The latter version is used, since it's more reliable:
uses locked pid files as opposed to checking 'live' processes.

Signed-off-by: Iustin Pop <>...

79634555 10/07/2010 11:30 am Iustin Pop

Abstract daemon file descriptor setup

This does some slight changes:

- Daemonize() doesn't explicitly close the file-descriptors anymore, but
only implicitly via the usage of dup2
- StartDaemonChild uses separate devnull for stdin (rdonly) and
stdout/stderr (wronly), or if using a log file, it uses it in append...

0260032c 10/07/2010 11:30 am Iustin Pop

Abstract some daemon functionality

This patch abstracts the chdir/umask/setsid functionality, which is
identical in the code functions, just that Daemonize did the chdir/umask
in the second child; with this change it does it in the first, as
StartDaemon....

72884fef 10/05/2010 06:08 pm Michael Hanselmann

Merge branch 'devel-2.2'

  • devel-2.2:
    Add simple unittest for utils.CommaJoin
    LUDelTags: Improve formatting of error message
    LUGetTags: Acquire locks in shared mode
    gnt-cluster: Replace hardcoded “xenvg” with value retrieved from master
    Export VG name via LUQueryConfigValues...