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>
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).
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.
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.
- 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
- 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
* 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>
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.