Skip to content

Conversation

@bastelfreak
Copy link
Contributor

This is a rebase of the https://github.com/OpenVoxProject/ezbake/tree/dev branch against main

@bastelfreak bastelfreak force-pushed the javafoo branch 2 times, most recently from fcf4670 to ef259d9 Compare January 2, 2026 14:23
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 2, 2026
This reverts commit e43660e.

e43660e added a denylist for
needrestart to ignore openvoxdb/openvoxserver. Both services write files
into /tmp/, which triggered service restarts, that were not required.

Since
puppetlabs/ezbake@bf1a75d,
both services use the PrivateTmp feature from systemd, that makes the
denylist obsolete.

This now ensures that needsrestart will restart openvoxdb/openvoxserver
on Java updates. That will fix
puppetlabs/puppetserver#2900.

(cherry picked from commit 2ff6317)

---

This is cherry-picked from OpenVoxProject#61 and was originally added in OpenVoxProject#12
bastelfreak added a commit to bastelfreak/ezbake that referenced this pull request Jan 2, 2026
(cherry picked from commit fcbd7e9)

This is cherry-picked from
OpenVoxProject#61 and was originally
added in OpenVoxProject#16

---

Delete more PE leftovers

(cherry picked from commit 48036a8)

this is cherry-picked from
OpenVoxProject#61 and was originally
added in OpenVoxProject#18
@bastelfreak bastelfreak force-pushed the javafoo branch 10 times, most recently from fc6b548 to 94d21e0 Compare January 7, 2026 21:58
bastelfreak and others added 13 commits January 7, 2026 23:18
These service wrappers only replicate the default systemd behavior.
Running it directly simplifies it greatly because it also drops the need
to manage the rundir, which systemd will now take care of for us.
This reverts commit e43660e.

e43660e added a denylist for
needrestart to ignore openvoxdb/openvoxserver. Both services write files
into /tmp/, which triggered service restarts, that were not required.

Since
puppetlabs/ezbake@bf1a75d,
both services use the PrivateTmp feature from systemd, that makes the
denylist obsolete.

This now ensures that needsrestart will restart openvoxdb/openvoxserver
on Java updates. That will fix
puppetlabs/puppetserver#2900.
This removes Jenkins related rake tasks that Perforce used. I haven't
tested this and I don't know if there are more tasks we can remove, e.g.
https://github.com/OpenVoxProject/ezbake/blob/main/resources/puppetlabs/lein-ezbake/template/global/tasks/integration.rake
This fixes a regression introduced in
OpenVoxProject#5 / b2de7c7

openvox-server has some ERB templates:
https://github.com/OpenVoxProject/openvox-server/tree/main/resources/ext/cli
and since above change, they aren't rendered anymore. The templates are
still required and builds fail.
The Gemfile is a template. For every ezbake based build, the Gemfile is
copied into the build dir. Aftwards the gems are installed. the
packaging gem is used to publish packages, update repos and render
different templates, e.g. the systemd unit files for openvox-server and
openvox-db.

As far as I know, the erb template rendering is the only feature from
packaging that we use. I didn't want to deal with a new gem name yet,
the packaging rubygems namespace is already owned by Perforce: https://rubygems.org/gems/packaging

I assume in the long term we will get rid of packaging, so I didn't
bother with renaming the gem. Because of that, we cannot publish it to
rubygems.org right. Because of that the Gemfile now uses `github:` to
fetch the release from there.
The `/usr` directory contains only two files:

```
/usr
/usr/lib
/usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/puppetserver.conf
/usr/share
/usr/share/doc
/usr/share/doc/openvox-server
/usr/share/doc/openvox-server/changelog.gz
```

Since OpenVoxProject#5, we don't package
/usr/lib/tmpfiles.d/puppetserver.conf anymore. And the changelog.gz is
autogenerated by fpm afterwards. That means that in our packaging
directory, there is no `/usr`. If we force fpm to package it, it will
raise an error.

This change was tested in https://github.com/OpenVoxProject/openvox-server
Making it a config option allows for differentation. The comment for
version 8 was outdated, since puppetserver 8 refuses to start up with
Java 8.
The EnvironmentFile paths are config locations so if a user ever
modified them, they're not replaced. By defining this in the service
file, the packaging will update the location. The result is that even
if a java location changes that a simple yum/apt upgrade will respect
the new value in most situations.
In
OpenVoxProject@6b3ad93
we introduced a new configuration option for java_bin. To get this
working, we need to add it to ezbake itself. Otherwise the variable
won't exist and we cannot use it in templates:

```
ExecStart= $JAVA_ARGS $LOG_APPENDER \
  '-XX:OnOutOfMemoryError=kill -9 %p' -XX:+CrashOnOutOfMemoryError \
  -XX:ErrorFile="$LOGS_DIRECTORY/puppetserver_err_pid%p.log" \
  -cp "$INSTALL_DIR/puppet-server-release.jar" \
  clojure.main \
  -m puppetlabs.trapperkeeper.main \
  --config "$CONFIG" \
  --bootstrap-config "$BOOTSTRAP_CONFIG" \
  $TK_ARGS
```

(see the whitespace after `ExecStart=` where the java path should be.
ezbake-functions.sh.erb uses the deprecated netstat from the
deprecated net-tools package. But I can't find any uses of the
functions in ezbake-functions.sh.erb, so let's remove it. The
functions were used in the wrappers which were eliminated in OpenVoxProject#5.

Fixes OpenVoxProject#13.
bastelfreak and others added 11 commits January 7, 2026 23:18
This was initially set in
/opt/puppetlabs/server/apps/puppetserver/cli/apps/foreground
and went missing during b2de7c7

Thix fixes a regression.
In the ezbake config we define the desired Java binary location, but we
don't always have access to this so it still needs some fallback.
In 9768a77 the java binary was
overridden, but this didn't have a point because it's not available when
the files are rendered. They only have access to the ezbake config.

This takes an approach of patching the files after the fact. It writes
out backup files that are restored after. That is to deal with the fact
that our build process isn't clean and is reused between multiple
builds.

Fixes: 9768a77 ("Use virtual Java packages on Red Hat and set java_bin")
Prior to b2de7c7 a tmpfiles config file
was created to ensure the run directory exists. It was dropped, but
causes the server to refuse to start up.

This instead makes systemd responsible for creating it when the service
starts.

Fixes: b2de7c7 ("Drop service wrappers")
foreground is a subcommand for openvox-server and openvoxdb. This this a
public interface to our users and removing it is a breaking change.

This fixes a regression introduced in b2de7c7
This is a regression from b2de7c7

Previously we had `ext/cli_defaults/*.erb`. This is still required
because openvox-server ships a file there: https://github.com/OpenVoxProject/openvox-server/blob/main/resources/ext/cli_defaults/cli-defaults.sh.erb
This fixes a regression from b2de7c7
where we removed the reload script. Now that we don't fork anymore, we
can just rely on `$MAINPID`, which is a variable provided by systemd.

see https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#ExecReload=
With the merge of
OpenVoxProject/trapperkeeper#23, we can switch
to notify. Then the service will notify systemd when the service is
actually started.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants