]> git.proxmox.com Git - pve-common.git/log
pve-common.git
7 years agore-enable run_cli, which is still in use
Dietmar Maurer [Thu, 12 May 2016 05:43:49 +0000 (07:43 +0200)]
re-enable run_cli, which is still in use

7 years agoprint_property_string: correctly implement skip parameter
Dietmar Maurer [Thu, 12 May 2016 05:25:51 +0000 (07:25 +0200)]
print_property_string: correctly implement skip parameter

7 years agofix keyAlias test
Dietmar Maurer [Wed, 11 May 2016 11:04:01 +0000 (13:04 +0200)]
fix keyAlias test

7 years agobump version to 4.0-61
Dietmar Maurer [Wed, 11 May 2016 09:10:36 +0000 (11:10 +0200)]
bump version to 4.0-61

7 years agoJSONSchema fix property sort order
Dietmar Maurer [Wed, 11 May 2016 08:57:06 +0000 (10:57 +0200)]
JSONSchema fix property sort order

order: default_key, required options, other

7 years agoremove PodParser.pm, implement keyAlias feature
Dietmar Maurer [Wed, 11 May 2016 07:28:09 +0000 (09:28 +0200)]
remove PodParser.pm, implement keyAlias feature

The keyAlias feature replaces the previous 'group_ feature.

7 years agoschema_get_type_text: return format_description if available
Dietmar Maurer [Sat, 7 May 2016 08:57:14 +0000 (10:57 +0200)]
schema_get_type_text: return format_description if available

7 years agoupdate changelog
Dietmar Maurer [Wed, 4 May 2016 06:11:02 +0000 (08:11 +0200)]
update changelog

7 years agoWhen starting in debug mode, starts the daemon without going through systemctl
Emmanuel Kasper [Tue, 3 May 2016 10:43:12 +0000 (12:43 +0200)]
When starting in debug mode, starts the daemon without going through systemctl

This fixes the problem that debug options for daemons were ignored and sets
the following behaviour for the daemons when -debug 1 is given
 * start on foreground with debug ouput on the console
 * do not start a sytemd unit

Starting the systemd unit in debug mode makes less sense because:
 * systemd will put the daemon in the background
 * systemd ignores environment variables so the only way to start
 the daemon with options would be through reading a config file

tested with pveproxy, pve-ha-lrm, pve-ha-crm

7 years agoset RELEASE=4.2
Dietmar Maurer [Tue, 3 May 2016 05:11:27 +0000 (07:11 +0200)]
set RELEASE=4.2

7 years agobump version to 4.0-60
Dietmar Maurer [Tue, 3 May 2016 05:09:37 +0000 (07:09 +0200)]
bump version to 4.0-60

7 years agoUse run_command instead of system
Fabian Grünbichler [Mon, 2 May 2016 13:03:03 +0000 (15:03 +0200)]
Use run_command instead of system

and explicitly note that those calls are allowed to fail and
are wrapped in eval {} on purpose.

7 years agoSectionConfig: sort values return by lookup_types
Dietmar Maurer [Sat, 30 Apr 2016 10:01:20 +0000 (12:01 +0200)]
SectionConfig: sort values return by lookup_types

They are use to generate type enums in the API.

7 years agosort keymap array
Dietmar Maurer [Sat, 30 Apr 2016 09:54:20 +0000 (11:54 +0200)]
sort keymap array

7 years agoSectionConfig.pm: sort type enum
Dietmar Maurer [Sat, 30 Apr 2016 09:50:55 +0000 (11:50 +0200)]
SectionConfig.pm: sort type enum

So that we can better detect API changes.

7 years agofix coding style
Dietmar Maurer [Tue, 19 Apr 2016 10:38:47 +0000 (12:38 +0200)]
fix coding style

7 years agoFix indexed parameter conversion in documentation
Fabian Grünbichler [Tue, 19 Apr 2016 09:47:55 +0000 (11:47 +0200)]
Fix indexed parameter conversion in documentation

this would previously convert properties that matched
'^([a-z]+)(\d+)$' even if they were not part of an indexed
properties series (which always start with 0).

This fixes previously wrongly converted properties:
-smbios1
-server2

7 years agoFix indexed parameter conversion in API dump
Fabian Grünbichler [Tue, 19 Apr 2016 09:47:54 +0000 (11:47 +0200)]
Fix indexed parameter conversion in API dump

this would previously skip (i.e., ignore) properties that
matched '^([a-z]+)(\d+)$' even if they were not part of an
indexed properties series (which always start with 0).

This fixes previously missing API dump occurrences of:
-smbios1
-comments6
-netmask6
-gateway6
-address6
-dns1
-dns2
-dns3
-server1
-server2

8 years agobump version to 4.0-59
Dietmar Maurer [Wed, 13 Apr 2016 04:37:47 +0000 (06:37 +0200)]
bump version to 4.0-59

8 years agoFix #908: cleanup OVS ports in tap_unplug
Wolfgang Bumiller [Tue, 12 Apr 2016 14:02:52 +0000 (16:02 +0200)]
Fix #908: cleanup OVS ports in tap_unplug

tap_unplug() is only called in hotplugging functions which
perform a tap_plug() afterwards, and and in qemu-server's
bridge-down script.
The OVS port cleanup for non-firewall ports was done only in
tap_plug(), which means that in the case when qemu exits and
the tap device disappears, the OVS port for it stays.

With this patch the cleanup happens in both tap_unplug() and
tap_plug() to avoid problems with upgrades on systems
where there have already been ports leaked.

8 years agoanother fix for $get_property_description() - remove format 'pod'
Dietmar Maurer [Thu, 7 Apr 2016 15:30:52 +0000 (17:30 +0200)]
another fix for $get_property_description() - remove format 'pod'

Instead, use the same enum as in usage_str().

8 years agoadd pve-docs to README.dev
Dietmar Maurer [Thu, 7 Apr 2016 10:58:00 +0000 (12:58 +0200)]
add pve-docs to README.dev

8 years agopass correct format to $get_property_description()
Dietmar Maurer [Thu, 7 Apr 2016 05:52:35 +0000 (07:52 +0200)]
pass correct format to $get_property_description()

8 years agoFix uninitialized subroutine error
Fabian Grünbichler [Tue, 5 Apr 2016 10:59:33 +0000 (12:59 +0200)]
Fix uninitialized subroutine error

8 years agoupdate changelog
Dietmar Maurer [Tue, 5 Apr 2016 10:25:20 +0000 (12:25 +0200)]
update changelog

8 years agoAdd validate_ssh_public_keys
Fabian Grünbichler [Tue, 5 Apr 2016 07:29:51 +0000 (09:29 +0200)]
Add validate_ssh_public_keys

validate format of SSH public keys using ssh-keygen -l and
temp files.

8 years agoupdate changelog
Dietmar Maurer [Tue, 5 Apr 2016 10:23:33 +0000 (12:23 +0200)]
update changelog

8 years agoReplace 'string' with 'filepath' for mapped params
Fabian Grünbichler [Tue, 5 Apr 2016 07:20:51 +0000 (09:20 +0200)]
Replace 'string' with 'filepath' for mapped params

For the CLI man pages and documentation, mapped parameters
('content' strings in API2 which are loaded from file paths
in CLI) get special treatment and are displayed with the
type 'filepath'.

8 years agoHandle string parameter to file content replacement
Fabian Grünbichler [Tue, 5 Apr 2016 07:20:50 +0000 (09:20 +0200)]
Handle string parameter to file content replacement

This is modelled after the way read_password() is used to
wrap -password parameters on the command line. If a mapping
for a certain API method and parameter is defined in the
sub class of CLIHandler.pm, the parameter is interpreted as
a file path on the command line and the parameter is
filled with the string contents of the referenced file.

This allows us to use the same API schema once in API2, but
overwrite the behaviour for individual parameters in the CLI
tools when desired.

8 years agobump version to 4.0-58
Dietmar Maurer [Tue, 5 Apr 2016 04:28:59 +0000 (06:28 +0200)]
bump version to 4.0-58

8 years agosendmail: minor cleanups
Dietmar Maurer [Tue, 5 Apr 2016 04:27:29 +0000 (06:27 +0200)]
sendmail: minor cleanups

8 years agoTools: add sendmail
Thomas Lamprecht [Mon, 4 Apr 2016 14:23:08 +0000 (16:23 +0200)]
Tools: add sendmail

can be used to send multipart (HTML, plain) mails to one or more
recipients at once.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoTools: tempfile and tempfile_contents
Wolfgang Bumiller [Mon, 4 Apr 2016 12:43:56 +0000 (14:43 +0200)]
Tools: tempfile and tempfile_contents

8 years agofix O_PATH value
Wolfgang Bumiller [Mon, 4 Apr 2016 12:22:31 +0000 (14:22 +0200)]
fix O_PATH value

8 years agogenerate_typetext: avoid warning with aliases
Dietmar Maurer [Sun, 3 Apr 2016 14:09:07 +0000 (16:09 +0200)]
generate_typetext: avoid warning with aliases

8 years agoupdate changelog
Dietmar Maurer [Fri, 1 Apr 2016 07:02:37 +0000 (09:02 +0200)]
update changelog

8 years agogenerate_typetext: handle enums and booleans automatically
Wolfgang Bumiller [Wed, 30 Mar 2016 10:09:53 +0000 (12:09 +0200)]
generate_typetext: handle enums and booleans automatically

8 years agoproperty strings: introduce key grouping feature
Wolfgang Bumiller [Wed, 30 Mar 2016 10:09:52 +0000 (12:09 +0200)]
property strings: introduce key grouping feature

Use case: networks for kvm use a <model>=<macaddr> scheme
where the model represents the network card. The schema
previously could not represent this, so we now introduce a
'group' key which works similar to an alias with the
difference that the data structure also gets an entry named
after the group filled with the name of the key that was
used to fill it.

Usage:
{
    virtio => { group => 'model' },
    e1000 => { group => 'model' },
    model => {
        type => 'string',
        pattern => ... # pattern for mac address
        ...
    }
}

Now the string 'virtio=aa:bb:cc:dd:ee:ff' gets parsed into:
{
    model => 'virtio',
    virtio => 'aa:bb:cc:dd:ee:ff'
}

Error examples:
  With bad value:
    virtio: value does not match the regex pattern
  Missing group:
    model: property is missing and it is not optional

parse_net() however used the 'macaddr' key for the mac
address, which can be achieved by aliasing 'model' to
'macaddr':
{
    virtio => { group => 'model' },
    e1000 => { group => 'model' },
    model => { alias => 'macaddr' },
    macaddr => {
        type => 'string',
        pattern => ... # pattern for mac address
        ...
    }
}

Then the above string will be parsed into:
{
    model => 'virtio',
    macaddr => 'aa:bb:cc:dd:ee:ff'
}

The error output now always shows the 'macaddr' key:
Error examples:
  With bad value:
    macaddr: value does not match the regex pattern
  Missing group:
    macaddr: property is missing and it is not optional

In order to support specifying no mac address we can now set
model.default_key = 1 and macaddr.optional = 1.
That way `virtio,bridge=vmbr2` gets parsed correctly into
just a model with no macaddr. This works because default
keys as aliases have previously not been supported and would
not have been aliased accordingly. This case is now also
taken into account when printing default keys, which is now
skipped if it is also an alias.

8 years agobump version to 4.0-57
Dietmar Maurer [Fri, 1 Apr 2016 05:17:09 +0000 (07:17 +0200)]
bump version to 4.0-57

8 years agofix #923: uninitalized value in remove_lock
Fabian Grünbichler [Wed, 30 Mar 2016 12:00:12 +0000 (14:00 +0200)]
fix #923: uninitalized value in remove_lock

8 years agoget_property_description: introduce new $style parameter
Dietmar Maurer [Thu, 31 Mar 2016 03:57:37 +0000 (05:57 +0200)]
get_property_description: introduce new $style parameter

config => colon separated config files
arg => command line argument
fixed => fixed command line argument (see usage_str())

8 years agocleanup: whitespace and than/then typo
Wolfgang Bumiller [Wed, 23 Mar 2016 08:21:37 +0000 (09:21 +0100)]
cleanup: whitespace and than/then typo

8 years agoget_property_description: add new 'text' format
Dietmar Maurer [Wed, 23 Mar 2016 09:19:15 +0000 (10:19 +0100)]
get_property_description: add new 'text' format

8 years agoget_property_description: use correct base name opt[n]
Dietmar Maurer [Wed, 23 Mar 2016 08:27:18 +0000 (09:27 +0100)]
get_property_description: use correct base name opt[n]

8 years agonew PVE::RESTHandler::dump_properties
Dietmar Maurer [Tue, 22 Mar 2016 10:25:50 +0000 (11:25 +0100)]
new PVE::RESTHandler::dump_properties

The plan is to replace code in PodParser.

8 years agofix spelling errors
Dietmar Maurer [Tue, 22 Mar 2016 09:39:16 +0000 (10:39 +0100)]
fix spelling errors

8 years agobump version to 4.0-56
Dietmar Maurer [Mon, 21 Mar 2016 07:47:39 +0000 (08:47 +0100)]
bump version to 4.0-56

8 years agoadd the 'urlencoded' string format
Wolfgang Bumiller [Fri, 18 Mar 2016 10:38:24 +0000 (11:38 +0100)]
add the 'urlencoded' string format

8 years agocleanup: full path package references to self
Wolfgang Bumiller [Fri, 18 Mar 2016 10:38:23 +0000 (11:38 +0100)]
cleanup: full path package references to self

This started happening when moving the 'pve-storage-id'
option from pve-storage and curously kept on going since
then...

8 years agocleanup: newlines in die/warn
Wolfgang Bumiller [Fri, 18 Mar 2016 10:38:22 +0000 (11:38 +0100)]
cleanup: newlines in die/warn

8 years agoproperty strings: check for commas in values
Wolfgang Bumiller [Fri, 18 Mar 2016 10:38:21 +0000 (11:38 +0100)]
property strings: check for commas in values

8 years agobump version to 4.0-55
Dietmar Maurer [Wed, 16 Mar 2016 15:48:44 +0000 (16:48 +0100)]
bump version to 4.0-55

8 years agoadd missing check for undef in is_mounted
Fabian Grünbichler [Wed, 16 Mar 2016 14:24:05 +0000 (15:24 +0100)]
add missing check for undef in is_mounted

8 years agobump version to 4.0-54
Dietmar Maurer [Tue, 15 Mar 2016 05:46:20 +0000 (06:46 +0100)]
bump version to 4.0-54

8 years agonet: don't die in get_active_interfaces() and try both address families
Wolfgang Bumiller [Thu, 10 Mar 2016 14:28:34 +0000 (15:28 +0100)]
net: don't die in get_active_interfaces() and try both address families

8 years agocleanup: regex match group reference
Wolfgang Bumiller [Wed, 9 Mar 2016 12:23:23 +0000 (13:23 +0100)]
cleanup: regex match group reference

Don't refer to the regex match group via $1 after running
other code.

8 years agonet: improve ingress tc filter
Wolfgang Bumiller [Tue, 8 Mar 2016 14:36:24 +0000 (15:36 +0100)]
net: improve ingress tc filter

Instead of doing a dummy "0 == 0" comparison with the u32
filter just use the 'basic' filter.

8 years agobump version to 4.0-53
Dietmar Maurer [Tue, 8 Mar 2016 14:51:30 +0000 (15:51 +0100)]
bump version to 4.0-53

8 years agonet: tap_plug() needs to apply rate limiting
Wolfgang Bumiller [Tue, 8 Mar 2016 12:54:44 +0000 (13:54 +0100)]
net: tap_plug() needs to apply rate limiting

Any action we take in tap_plug() when using OVS will undo
our rate limiting, which means any hotplug change must
restore the previous rate setting.
Since this means tap_plug() would always be followed by a
tap_rate_limit() call anyway we just include the rate
parameter here and let the caller decide whether the full
tap_plug() is required or the simple tap_rate_limit()
suffices.

8 years agonetwork: tap_rate_limit: fix uninitialized value
Wolfgang Bumiller [Tue, 8 Mar 2016 11:32:51 +0000 (12:32 +0100)]
network: tap_rate_limit: fix uninitialized value

8 years agopod: skip aliases in generate_property_text
Wolfgang Bumiller [Tue, 8 Mar 2016 10:56:40 +0000 (11:56 +0100)]
pod: skip aliases in generate_property_text

These are special and have no other properties to access.

8 years agobump version to 4.0-52
Dietmar Maurer [Tue, 8 Mar 2016 10:34:42 +0000 (11:34 +0100)]
bump version to 4.0-52

8 years agoDecide whether volume is added as unused in subclass
Fabian Grünbichler [Mon, 7 Mar 2016 11:38:38 +0000 (12:38 +0100)]
Decide whether volume is added as unused in subclass

since we need the volume ID of the volume/drive/mp, which is
only available after parsing, this needs to be done in the
subclasses.

__snapshot_delete_vol_snapshot() gets a new parameter, and
pushes the volid to this array if it should be added as
unused.

8 years agoIntroduce __snapshot_create_vol_snapshots_hook
Fabian Grünbichler [Mon, 7 Mar 2016 11:38:37 +0000 (12:38 +0100)]
Introduce __snapshot_create_vol_snapshots_hook

This hook runs before and after creating volume snapshots,
as well as after unfreezing. Only needed for Qemu right now,
so the base case in PVE::AbstractConfig is a noop.

8 years agobump version to 4.0-51
Dietmar Maurer [Thu, 3 Mar 2016 09:12:55 +0000 (10:12 +0100)]
bump version to 4.0-51

8 years agoAdd AbstractConfig base class
Fabian Grünbichler [Wed, 2 Mar 2016 12:56:26 +0000 (13:56 +0100)]
Add AbstractConfig base class

This class contains common code formerly duplicated in
PVE::LXC and PVE::QemuServer, as well as abstract methods
that must be implemented for LXC and Qemu seperately.

Currently implemented in PVE::LXC::Config, Qemu refactoring
will follow.

8 years agobump version to 4.0-50
Dietmar Maurer [Wed, 2 Mar 2016 05:23:40 +0000 (06:23 +0100)]
bump version to 4.0-50

8 years agoAdd since and until parameter to dump_journal
Thomas Lamprecht [Tue, 1 Mar 2016 15:32:34 +0000 (16:32 +0100)]
Add since and until parameter to dump_journal

journalctl can check their validness itself

8 years agopod: generate property string documentation
Wolfgang Bumiller [Thu, 25 Feb 2016 16:44:56 +0000 (17:44 +0100)]
pod: generate property string documentation

Generate the more detailed documentation with the
'description' property provided in the property-string
format schema for the '*.conf'(5) manpages.

8 years agobump version to 4.0-49
Dietmar Maurer [Thu, 18 Feb 2016 08:40:53 +0000 (09:40 +0100)]
bump version to 4.0-49

8 years agoschema: error on missing keys without default keys
Wolfgang Bumiller [Mon, 15 Feb 2016 14:35:35 +0000 (15:35 +0100)]
schema: error on missing keys without default keys

8 years agolimit vmid with JSON format
Dominik Csapak [Fri, 12 Feb 2016 10:43:23 +0000 (11:43 +0100)]
limit vmid with JSON format

if we do not do this, vmids < 100 (not really bad) and
vmids > 999999999 are possible, which can lead to vms which you can
only get rid of, if you delete the config files manually

also this makes the api consistent with the webgui for vmids

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 years agonetwork: get rid of ioctl.ph
Wolfgang Bumiller [Fri, 12 Feb 2016 09:42:54 +0000 (10:42 +0100)]
network: get rid of ioctl.ph

8 years agoschema: disable additional properties in property strings
Wolfgang Bumiller [Thu, 11 Feb 2016 10:21:00 +0000 (11:21 +0100)]
schema: disable additional properties in property strings

Changed the default additional_properties parameter when
verifying them from undefined (which defaults to 1) to 0.

parse_property_strings() now takes an optional
additional_properties parameter, too.

8 years agobump version to 4.0-48
Dietmar Maurer [Thu, 11 Feb 2016 10:25:02 +0000 (11:25 +0100)]
bump version to 4.0-48

8 years agoadded syncfs syscall and sync_mountpoint helper
Wolfgang Bumiller [Thu, 11 Feb 2016 08:26:29 +0000 (09:26 +0100)]
added syncfs syscall and sync_mountpoint helper

8 years agoupdate changelog
Dietmar Maurer [Wed, 10 Feb 2016 11:21:05 +0000 (12:21 +0100)]
update changelog

8 years agoFix #882: active state of interfaces depends on ipv6
Wolfgang Bumiller [Wed, 10 Feb 2016 09:59:07 +0000 (10:59 +0100)]
Fix #882: active state of interfaces depends on ipv6

read_etc_network_interfaces used the content of
/proc/net/if_inet6 to decide whether an interface's state is
"active", which means an interface is only active when it
has an ipv6 address, thus using net.ipv6.conf.*.disable_ipv6
on an interface will cause it to show as inactive in the web
interface.

We now filter the interfaces found in /proc/dev/net by their
IFF_UP flag read via an SIOCGIFFLAGS ioctl().

8 years agobump version to 4.0-47
Dietmar Maurer [Wed, 10 Feb 2016 10:14:06 +0000 (11:14 +0100)]
bump version to 4.0-47

8 years agoImplement refcounting for flocks
Fabian Grünbichler [Wed, 10 Feb 2016 07:25:23 +0000 (08:25 +0100)]
Implement refcounting for flocks

This was already implemented in PVE::LXC::lock_aquire() and
lock_release(). Enabling refcounting in the general
PVE::Tools::lock_file() and lock_file_full() methods allows
us to use one code base for flocking.

Furthermore, we could get rid of various xx_no_lock methods
that were required because the old non-refcounting version
did not support nested flocks (the inner most flock would
close the file handle and thus release the flock).

8 years agoCLIHandler: add missing use PVE::INotify
Wolfgang Bumiller [Wed, 10 Feb 2016 08:38:43 +0000 (09:38 +0100)]
CLIHandler: add missing use PVE::INotify

It uses PVE::INotify::inotify_init() in run_cli_handler().

8 years agobump version to 4.0-46
Dietmar Maurer [Wed, 27 Jan 2016 15:56:00 +0000 (16:56 +0100)]
bump version to 4.0-46

8 years agoadd upid_wait method
Thomas Lamprecht [Wed, 27 Jan 2016 12:15:05 +0000 (13:15 +0100)]
add upid_wait method

Waits for a process identified by a UPID to end by busy waiting
and is intended for long running workers.

waitfunc gets called every wait cycle after min $sleep_interval
seconds and can be used for outputting/logging something or timing
out the wait.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoSectionConfig: disable duplicate plugin registration
Dietmar Maurer [Tue, 26 Jan 2016 12:16:19 +0000 (13:16 +0100)]
SectionConfig: disable duplicate plugin registration

8 years agoTools: add setns system call
Wolfgang Bumiller [Fri, 22 Jan 2016 10:55:27 +0000 (11:55 +0100)]
Tools: add setns system call

8 years agobump version to 4.0-45
Dietmar Maurer [Mon, 18 Jan 2016 15:54:30 +0000 (16:54 +0100)]
bump version to 4.0-45

8 years agonetwork: fix uninitialized value error
Wolfgang Bumiller [Mon, 18 Jan 2016 08:17:23 +0000 (09:17 +0100)]
network: fix uninitialized value error

8 years agobump version to 4.0-44
Dietmar Maurer [Fri, 15 Jan 2016 16:26:22 +0000 (17:26 +0100)]
bump version to 4.0-44

8 years agonetwork : add trunks support
Alexandre Derumier [Fri, 15 Jan 2016 02:15:36 +0000 (03:15 +0100)]
network : add trunks support

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
8 years agobump version to 4.0-43
Dietmar Maurer [Fri, 8 Jan 2016 11:51:16 +0000 (12:51 +0100)]
bump version to 4.0-43

8 years agoFix #861: use safer sprintf formatting
Wolfgang Bumiller [Fri, 8 Jan 2016 11:43:58 +0000 (12:43 +0100)]
Fix #861: use safer sprintf formatting

8 years agoimprove asciidoc markup
Dietmar Maurer [Tue, 29 Dec 2015 17:43:12 +0000 (18:43 +0100)]
improve asciidoc markup

8 years agoadd experimental 'asciidoc' generator
Dietmar Maurer [Tue, 29 Dec 2015 16:02:00 +0000 (17:02 +0100)]
add experimental 'asciidoc' generator

useful to generate manual pages using asciidoc.

8 years agobump version to 4.0-42
Dietmar Maurer [Sat, 19 Dec 2015 08:06:41 +0000 (09:06 +0100)]
bump version to 4.0-42

8 years agoOutput also lockname if it cannot be acquired
Thomas Lamprecht [Wed, 16 Dec 2015 09:38:20 +0000 (10:38 +0100)]
Output also lockname if it cannot be acquired

If we can't acquire the lock in lock_file_full and get interrupted
by a signal inqeual to EINTR (e.g. SIGTERM), output also it's name
in the error message to allow better debugging.

Also fix a typo.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agoallow fall back to default completion
Thomas Lamprecht [Wed, 16 Dec 2015 09:38:19 +0000 (10:38 +0100)]
allow fall back to default completion

This allows a fall back to the default completion, which completes
possible paths/files, if nothing can be generated from the PVE
completion handler ($print_bash_completion) or if the user starts
to entry a path.
This is especially useful for restore or create commands which can
take an archive file as argument.

The bash-completions get generated at each package build through the
respective Makefile, so to let this change come in effect the package
needs to be rebuild and installed (and the respective file from
/usr/share/bash-completion/completions/<pve cli tool> needs to be
sourced again (or simply open a new terminal))

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 years agobump version to 4.0-41
Dietmar Maurer [Mon, 7 Dec 2015 10:17:56 +0000 (11:17 +0100)]
bump version to 4.0-41

8 years agoDaemon: don't clear CLOEXEC on daemon sockets
Wolfgang Bumiller [Mon, 7 Dec 2015 09:41:24 +0000 (10:41 +0100)]
Daemon: don't clear CLOEXEC on daemon sockets

They were leaking into processes blocking full restarts of
the daemons.

Note that perl's fcntl doesn't work on numeric
filedescriptors (neither does POSIX::fcntl, which even stays
silent about it and returns EBADF without ever trying to
actually perform the fcntl syscall), so the socket handles
need to be stored ($daemon_sockets).
The flag is added back when the socket gets reopened.

8 years agobump version to 4.0-40
Dietmar Maurer [Mon, 30 Nov 2015 12:00:41 +0000 (13:00 +0100)]
bump version to 4.0-40

8 years agorun_command: return exit code and add noerr
Thomas Lamprecht [Mon, 30 Nov 2015 08:25:20 +0000 (09:25 +0100)]
run_command: return exit code and add noerr

Allow to return the exit code of the executed command.
And as we do not reach the return of the exit code if it was not 0,
a noerr parameter is also needed so we can suppress the 'command
failed' die in case of an exit code unequal to 0.

This is required as some programs return another value than 0 when
they succeed, For example `systemctl list-jobs` returns  a value
>= 0 on a successful execution, normally 1.
Without this patch a run_command call to `systemctl list-jobs` gets
marked as failed although it was successful.

This does not break current behaviour in any way as setting the
noerr parameter is required to return something other than 0 or
undef, which are equal in a boolean comparison.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>