340 Commits

Author SHA1 Message Date
Dominik Csapak
f493f5685d remove pvescheduler manpage generation
pve-docs-generator does this now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-11 18:35:52 +01:00
Thomas Lamprecht
6385fb8183 replace systemd timer with pvescheduler daemon
The whole thing is already prepared for this, the systemd timer was
just a fixed periodic timer with a frequency of one minute. And we
just introduced it as the assumption was made that less memory usage
would be generated with this approach, AFAIK.

But logging 4+ lines just about that the timer was started, even if
it does nothing, and that 24/7 is not to cheap and a bit annoying.

So in a first step add a simple daemon, which forks of a child for
running jobs once a minute.
This could be made still a bit more intelligent, i.e., look if we
have jobs tor run before forking - as forking is not the cheapest
syscall. Further, we could adapt the sleep interval to the next time
we actually need to run a job (and sending a SIGUSR to the daemon if
a job interval changes such, that this interval got narrower)

We try to sync running on minute-change boundaries at start, this
emulates systemd.timer behaviour, we had until now. Also user can
configure jobs on minute precision, so they probably expect that
those also start really close to a minute change event.
Could be adapted to resync during running, to factor in time drift.
But, as long as enough cpu cycles are available we run in correct
monotonic intervalls, so this isn't a must, IMO.

Another improvement could be locking a bit more fine grained, i.e.
not on a per-all-local-job-runs basis, but per-job (per-guest?)
basis, which would improve temporary starvement  of small
high-periodic jobs through big, less peridoci jobs.
We argued that it's the user fault if such situations arise, but they
can evolve over time without noticing, especially in compolexer
setups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-10 16:11:00 +01:00
Thomas Lamprecht
d9fab55662 pve6to7: improve manpage slightly
this fixes a lintian complaint regarding "bad-whatis-entry"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-04 12:22:02 +02:00
Thomas Lamprecht
81dbe056fc drop pve5to6 checker tool, not relevant in 7.x release
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-04 12:22:02 +02:00
Thomas Lamprecht
027f67e46d actually install pve6to7 tool
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-28 11:16:59 +02:00
Thomas Lamprecht
4177a14d13 add pve6to7 WIP
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-19 19:01:51 +02:00
Fabian Grünbichler
e7083f9ae6 fix #2890: also detect & renew DNS-only ACME certs
this call site was apparently missed when we refactored the node config
/ ACME interaction.

Suggested/Reported-by: Frédéric Bourqui
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-07-27 10:53:32 +02:00
Thomas Lamprecht
ecddd2e231 Revert "Close #1623: replace apt-get to apt"
This reverts commit 19137ed620b22dc012c17999ff4efc0186c677c0.
2020-07-08 10:55:56 +02:00
Moayad Almalat
19137ed620 Close #1623: replace apt-get to apt
Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
2020-07-07 18:52:28 +02:00
Thomas Lamprecht
e33f43a3de cert renew: note reason why renewal due to long lifetime is done 2020-04-27 18:28:59 +02:00
Fabian Grünbichler
75456ef378 certs: early renew long-lived certificates
if our self-signed certificate expires in more than 825 days, but was
created after July 2019 it won't be accepted by modern Apple devices. we
fixed the issuance to generate shorter-lived certificates in November
2019, this cleans up the existing ones to fix this and similar future
issues.

two years / 730 days as cut-off was chosen since it's our new maximum
self-signed certificate lifetime, and should thus catch all old-style
certificates.

another positive side-effect is that we can now phase out support for
older certificates faster, e.g. if we want to move to bigger keys,
different signature algorithms, or anything else in that direction.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-27 13:14:10 +02:00
Thomas Lamprecht
966a5de348 pveversion: fix removed packages with residual configs
Those ain't 'not correctly installed', so do not suggest the user
that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-03 14:12:50 +01:00
Thomas Lamprecht
f5ad0c97f7 followup: be slightly more verbose on error or renew
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 13:23:45 +01:00
Dominik Csapak
784a50cca0 renew pve-ssl.pem when it nearly expires
but only if the cert is issued by the ca in /etc/pve/pve-root-ca.pem
(by checking the issuer and openssl verify)

this way we can reduce the lifetime of the certs without having
to worry that they ran out

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-11-26 13:13:04 +01:00
Thomas Lamprecht
1ff3fef0b0 fix #844: allow to pre-delay start-all-marked guests on boot
Add a simple ExecStartPre command which reads the local node config,
and if a delay is set the helper sleeps that long then exists.

The systemd-unit approach was chosen as this ensures that we really
only delay when doing the startall on node boot. The pve-guests
service does not allows manual stops, starts or restarts, it can only
be pulled in by the multi-user.target

Mark this command with "-" to tell systemd that errors of it should
not cause an abort, it's a best-effort approach.

The journal from a 2 second delay would look like:
> Nov 19 13:13:48 dev6 systemd[1]: Starting PVE guests...
> Nov 19 13:13:48 dev6 pve-startall-delay[2318]: Delaying on-boot 'startall' command for 2 second(s).
> ...
> Nov 19 13:13:50 dev6 pve-guests[2339]: <root@pam> starting task UPID:dev6:00000924:00000529:5DD3DC7E:startall::root@pam:

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 20:20:58 +01:00
Fabian Grünbichler
3ac3653e63 use PVE::DataCenterConfig
to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:25:35 +01:00
Thomas Lamprecht
fa84f50c1f pve5to6 will never be a POD based man page, fake it for now
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-25 09:51:00 +02:00
Thomas Lamprecht
071d761a3f followups: pve5to6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-25 09:04:07 +02:00
Fabian Grünbichler
75584009f8 upgrade checklist
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-06-25 09:03:42 +02:00
Thomas Lamprecht
8c6e5fc1b8 bin/make: fix pod2man generation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-25 09:03:42 +02:00
Christian Ebner
ad9d1215f5 Fix 1891 Generate zsh tab completion scripts for cli tools
This patch builds the  zsh tab completion scripts for the cli tools of
pve-manager.
In order for it to work, the latest version of pve-common and pve-docs
including the corresponding patches have to be installed on the build
system.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-02-20 12:12:07 +01:00
Thomas Lamprecht
fcca6095e1 pveperf: print errno on die if sensible
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-31 13:50:37 +01:00
Thomas Lamprecht
97ad5e50d7 pveperf: use fsync syscall from PVE::Tools
allows to drop the libfile-sync-perl dependency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-31 11:44:15 +01:00
Fabian Grünbichler
7f4d4526f2 build: use pve-doc-generator to verify API
and move API verification to 'check' target, where it belongs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-18 14:17:08 +02:00
Fabian Grünbichler
c436a4baa6 build: use pve-doc-generator for bash-completion
and bump build-depends accordingly

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-18 14:17:08 +02:00
Fabian Grünbichler
6d1115f2a8 build: set PERL_DOC_INC_DIRS
this allows correct builds without pve-manager installed, with a clean
fall-back to the old behaviour in case pve-doc-generator is too old.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-10-18 14:17:08 +02:00
Dietmar Maurer
ece19ae214 pvesh cleanup: use a handler class - PVE/CLI/pvesh.pm 2018-07-26 15:20:15 +02:00
Dietmar Maurer
3522eed9c2 pvesh: implement 'ls' command 2018-07-26 13:09:08 +02:00
Dietmar Maurer
52170c5553 pvesh: do not use CLIHandler $option parameter, simplify code 2018-07-26 13:09:08 +02:00
Dietmar Maurer
1c57847c09 pvesh: use standard output options
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Dietmar Maurer
0e99eead10 pvesh usage: correctly handle uri paramaeters, cleanups
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Dietmar Maurer
a831f4be80 pvesh usage: new option --returns to print result schema
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 11:27:13 +02:00
Wolfgang Bumiller
2565b25d4f fixup pvesh for changes in pve-common
In pve-common the following changes happened:
  0adee98 ("cli_handler: pass common output options as separate parameter")
  352b7a1 ("PVE::CLIFormatter - implement new output options")
We now get the format passed via an options hash in the
output function instead of seeing it as an api call
parameter.

Similarly, --quiet is now already handled there.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-07-11 10:51:14 +02:00
Dietmar Maurer
46028e7432 pvesh: complete rewrite using PVE::CLIHandler
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 10:36:32 +02:00
Dietmar Maurer
cfc6a66293 pvesh - remove interactive readline mode
We have good command line completion and history with 'bash', so there is
no real need to duplicate this functionality.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-07-11 10:36:32 +02:00
Dominik Csapak
f08b396c3b fix correct call to 'usage_str'
we forgot to give usage_str also the param_mapping sub,
else it fails on calling 'help'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-28 13:15:13 +02:00
Dominik Csapak
f9c9a7da8c use PVE::RESTHandler explicitly
since we use it in the code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-27 12:19:52 +02:00
Dominik Csapak
be968cb617 replace read_password with param_mapping in pvesh
and use get_standard_mapping from CLIHandler

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-27 12:19:45 +02:00
Thomas Lamprecht
73ed0af158 cleanup: move bin/test to toplevel
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-20 13:04:51 +02:00
Thomas Lamprecht
6d820e34f2 cleanup: rename bin/init.d to services
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-20 13:04:51 +02:00
Fabian Grünbichler
2f6e5f3437 test: replication: adapt test data
otherwise the checks in write_config fail

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-14 13:58:11 +02:00
Fabian Grünbichler
0d7c2683ac test: replication: mock cfs_(write|lock)_file
which is needed since the HA recovery series

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-14 13:57:26 +02:00
René Jochum
57a9d4cb67 Extend the .gitignore(s)
Signed-off-by: René Jochum <rene@jochums.at>
2018-05-04 14:50:04 +02:00
Fabian Grünbichler
4a57db5592 pveupdate: add ACME certificate renewal
renew certificate if an acme config entry and a custom certificate
exists on the local node and the certificate expires soon.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00
Fabian Grünbichler
1a9df9c828 add pvenode CLIHandler
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00
Thomas Lamprecht
6720a01c78 pve-daily-update.service: add Wants/After for pve-cluster.service
Else systemd may start this to early on boot, before pve-cluster is
up and ready, if it missed and update because the node was offline.
This fails the services as it cannot do any IPC with pmxcfs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-23 11:52:42 +01:00
Thomas Lamprecht
3877d4bff5 pveupdate: replace cron job with systemd timer
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 15:14:13 +01:00
Thomas Lamprecht
7755aa883c services: remove obsolete init.d scripts
They all have a systemd service file so no need for them anymore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 14:19:41 +01:00
Thomas Lamprecht
0d6bb692f5 buildsys: add %.1.pod make target to reduce duplication
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 14:19:41 +01:00
Thomas Lamprecht
bb195e69b7 remove obsolete (rgmanager era) HA resource agent
This was used by rgmanager which was superseeded in 2015 with our
ha-manager for PVE 4.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-03-12 14:19:41 +01:00