46 Commits
Author SHA1 Message Date
mkutouskiandJan Orel 4188fe50ad B #7646: Apply log rotation fix to remaining services
Extend the FireEdge log fix to oned, oneflow, oneform, onegate and
onehem so they share the same rotation behavior:

- Add compress / compressoptions -9 / delaycompress to the logrotate
  configs. With copytruncate, delaycompress avoids gzipping the
  freshly-rotated file in the same pass and keeps service restarts
  fast even when ExecStartPre runs logrotate -f.

- Drop the synchronous gzip ExecStartPre loops from each unit. The
  glob (e.g. oneflow*.log) does not match files rotated with
  dateformat -%Y%m%d-%s, so the loop was ineffective, and running
  gzip without backgrounding blocked startup.

- Ship a logrotate config for oneform; the unit was pointing at
  /etc/logrotate.d/opennebula-form but no such file existed, so
  oneform.log was never rotated.

- src/hem/bin/onehem-server: use >> instead of > so restarts via the
  shell wrapper do not truncate the log, matching oneflow / onegate /
  oneform / fireedge wrappers (originally fixed in #6034).

Signed-off-by: Mikalai Kutouski <mkutouski@opennebula.io>
Co-authored-by: Jan Orel <jorel@opennebula.io>
2026-05-11 10:26:58 +02:00
Pavel Czerný c26cd10726 B #7561: Fix crash in onehem-server (#4138) 2026-03-31 13:57:28 +02:00
Ruben S. Montero ebbb7be5d4 M #-: Bump version 7.3.80 2026-03-30 09:58:53 +02:00
Jan Orel 7e0fa890e3 B #-: Fix ZMQ shutdown SIGSEGV on Ruby 3.4 (frozen FFI objects) (#4103)
The previous fix (b001d61b) suppressed FFI::DynamicLibrary finalizers
via ObjectSpace.undefine_finalizer to prevent dlclose() from unmapping
libzmq while ZMQ I/O threads are still running. However, on Ruby 3.4+
(SLES 16), FFI::DynamicLibrary objects are frozen for Ractor-safety,
causing undefine_finalizer to raise FrozenError — silently failing.

Fix both shutdown crash paths:

  1) SIGSEGV (dlclose unmaps libzmq): pin libzmq in memory via
     Fiddle.dlopen with disable_close, adding a dlopen refcount that
     is never decremented. FFI's dlclose then drops the refcount to 1
     (not 0), keeping the library mapped.

  2) Deadlock (zmq_ctx_term blocks on open sockets): suppress the
     ZMQ::Context finalizer via undefine_finalizer (Context objects
     are not frozen, so this works on all Ruby versions).

Falls back to the old undefine_finalizer approach on systems without
Fiddle or with a different libzmq soname (works on Ruby < 3.4).
2026-03-16 16:10:11 +01:00
Jan Orel b001d61b00 B #-: Fix ZMQ shutdown SIGABRT caused by cross-thread socket close (#4097) 2026-03-10 11:20:09 +01:00
Jan Orel 151de49262 B #-: Fix ZMQ shutdown SIGSEGV caused by use-after-unmap (#4096)
The previous fix (acf180b) prevented the ZMQ context finalizer deadlock
by suppressing zmq_ctx_term via ObjectSpace.undefine_finalizer. However, this left ZMQ I/O threads running. When Ruby's GC later finalized the FFI::DynamicLibrary object, it called dlclose() on libzmq, unmapping its code while I/O threads were still executing it — causing a SIGSEGV.

Fix: close all ZMQ sockets first (so zmq_ctx_term won't block), then
explicitly terminate contexts (stopping I/O threads), then suppress
GC finalizers to prevent double-free.
2026-03-09 11:32:21 +01:00
Jan Orel acf180b579 B #-: Fix ZMQ context finalizer deadlock on shutdown (#4083)
On openSUSE (Ruby 3.4), opennebula-flow, opennebula-hem and one_hm hang
on shutdown until systemd SIGKILLs them after 90s.

Root cause: during Ruby's exit sequence, GC finalizers run on unreachable
ZMQ::Context objects calling zmq_ctx_term(), which blocks until all
sockets from that context are closed. But the subscriber sockets were
never explicitly closed (threads were killed by Ruby before cleanup),
so the context finalizer deadlocks with the pending socket finalizers.

Fix: register an at_exit handler that removes ZMQ::Context finalizers
via ObjectSpace.undefine_finalizer. This prevents the blocking
zmq_ctx_term call from ever running during GC, letting socket finalizers
run zmq_close independently. The OS reclaims all remaining ZMQ resources
on process exit.
2026-02-25 17:08:52 +01:00
Jan Orel f42bd9cd0a F #7450: support SUSE build (#4057)
- support for SUSE in install_gems, update locks
- don't install prometheus systemd services in install.sh
  we handle that in packages
- various minor issues: bashisms, sudoers paths
2026-02-12 09:24:59 +01:00
Tino Vázquez ef8051155f L #-: Rubocop 1.76.0 2025-06-05 11:26:57 +02:00
Jan Orel 4c92499a70 M #-: Simplify ruby path setup (#3613)
- we deliver /usr/lib/ruby/load_opennebula_paths.rb
- sym-linked from known (system-wide) Ruby path
  - Debian/Ubuntu: /usr/local/lib/site_ruby/load_opennebula_paths.rb
  - RHEL/Alma:     /usr/local/share/ruby/site_ruby/load_opennebula_paths.rb
- suppress warnings from Rubygems no longer needed
2025-05-05 13:24:22 +02:00
Tino Vázquez a64f071808 M #-: Bump year 2025 2025-02-28 11:56:18 +01:00
Tino Vázquez 05d147c524 M #-: Bump version 6.10.0
Also bump copyright year to 2024
2024-07-29 14:27:11 +02:00
Tino Vázquez 7516ed7f0a L #-: Lint for rubocop 1.58.0 2023-12-04 10:40:53 +01:00
Tino Vázquez d49e6fcc8f Revert "L #-: Linting for rubocop 1.58.0"
This reverts commit 76f1d1bba4.
2023-12-04 10:05:02 +01:00
Tino Vázquez 76f1d1bba4 L #-: Linting for rubocop 1.58.0 2023-12-02 13:22:31 +01:00
Tino Vázquez 4ba8847da1 F #6127: Remove headers from all conf files (#2517) 2023-02-22 16:03:37 +01:00
Tino Vázquez 3376afdaf0 M #-: Bump year 2023 2023-01-09 12:23:19 +01:00
4b746348b3 f #5725: State for Virtual Networks
* VNETs include state to flag their configuration status
  (READY/ERROR/LOCK)
* Hooks can be program based on VNET state transitions
* Include Java/Go/Ruby bindings
* New vCenter network drivers
* Place-holder to customize actions (create/delete) for other netowrk drivers
* Sunstone integration
* OneFlow syncs flow creation on VNET status
* Remove deprecated vcenter hooks and autoregistration

co-authored-by: Frederick Ernesto Borges Noronha <fborges@opennebula.io>
co-authored-by: Alejandro Huertas <ahuertas@opennebula.io>
co-authored-by: Pavel Czerny <pczerny@opennebula.systems>
2022-04-09 15:20:17 +02:00
Tino Vazquez f7d53e75ff M #-: Bump version 6.3.85 2022-04-07 19:49:58 +02:00
Ruben S. Montero 411b9484c9 M #-: Do not add extra spaces to hook args 2021-12-27 16:44:11 +01:00
Vlastimil Holer c649213923 B #5379: Disable warnings on load of rubygems (#1199)
(cherry picked from commit 5fe824f1e7)
2021-05-11 09:24:32 +02:00
Vlastimil Holer 0457a46045 M #-: Avoid reloading of OpenNebula distributed Ruby gems (#829) 2021-02-17 19:52:38 +01:00
Vlastimil Holer 096754b63f M #-: Bump year to 2021 (#778) 2021-02-09 16:07:56 +01:00
Vlastimil Holer 7872274c9b B #4929: Preserve site_ruby in paths, use realpath (#33) 2020-06-22 15:18:57 +02:00
Vlastimil Holer f3c50a5d89 M #-: Year bump to 2020 (#4634) 2020-04-30 15:00:02 +02:00
Vlastimil Holer d064ee6db3 B #4304: Distribution gems affects OpenNebula (#4578)
Remove vendor_ruby and site_ruby directories from $LOAD_PATH, so
that distribution gems installed directly into loadable path
without need to use rubygems are not loaded by require.
2020-04-22 10:21:08 +02:00
Tino Vazquez e573c83c7a L #-: Linting for onehem-server.rb 2020-04-15 16:04:09 +02:00
Andreyanddivanikus ac583630a3 B #4128: Allow multiple hooks for same trigger event (#4457)
Signed-off-by: divanikus <d1pro@yandex.ru>
Co-authored-by: divanikus <d1pro@yandex.ru>
2020-04-14 17:17:43 +02:00
Tino Vazquez 5ead940b16 L #-: Adjustments for rubocop 0.77.0 2019-12-05 19:22:35 +01:00
Christian González c626955627 M #: Fix minor bug on hook retry action (#3962) 2019-11-20 12:38:22 +01:00
Christian González d0a3f4af56 B #3929: fix wrong relative path for remote hooks (#3944) 2019-11-15 11:21:19 +01:00
Christian González 36ad5e2823 F #3380: Modify event key structure (#3848) 2019-10-17 17:22:10 +02:00
Christian González 7c14ff25fa M #: Minor changes on hem executions logging (#3819) 2019-10-08 13:02:18 +02:00
Christian González 5951d4232d L #-: Minor change (#3774) 2019-09-26 11:31:04 +02:00
Christian González 9a717ac997 L #-: Minor change (#3773) 2019-09-25 18:15:26 +02:00
Christian González 297350ece9 F #3380: Add timeout support for hooks (#3766) 2019-09-25 16:29:33 +02:00
Christian González eb7df9e901 F #3380: return object body on API hooks (#3705) 2019-09-16 14:50:33 +02:00
Christian González e692b9ecdd F #3380: Change default ports for HEM (#3690) 2019-09-12 17:50:27 +02:00
Tino Vazquez 9e67ae678d L #-: Linting to make rubocop smile again 2019-09-12 16:56:54 +02:00
Christian González fe03644bc8 F #3380: Adjust HEM to new XML format (#3685) 2019-09-12 11:54:45 +02:00
Ruben S. Montero ef231b8c0d M #- : Fix xpath locations 2019-09-11 18:32:14 +02:00
Vlastimil Holer 5b0a9f5f4b F #3380: Fix place to make require for libs. (#3680) 2019-09-11 13:08:26 +02:00
Ruben S. Montero bfe7694320 F #3380: Hide secrets in API hooks. Add response to API document 2019-09-10 18:17:12 +02:00
Christian González f8d4fa7a05 F #3380: modify reloading procedure of HEM (#3674) 2019-09-10 15:36:06 +02:00
Christian González af1ec56a16 F #3380: Retry hem execution. Better hook management start process
(cherry picked from commit cb6ecaa8bebf4c8e2323ac35a5ff601f29b97c37)
(cherry picked from commit b8351898fc212065dc1abff14be531db5442cd82)
2019-09-09 16:59:51 +02:00
Ruben S. MonteroandChristian González 6143dd95ce F #3380: New Hook system. Drivers, oned and command line tool
Co-authored-by: Christian González <cgonzalez@opennebula.systems>
2019-09-09 14:47:42 +02:00