E: Package rubygem-foreman_maintain cannot be found

here:


root@test-dev:# foreman-maintain advanced procedure run foreman-maintain-services
Running ForemanMaintain::Scenario
================================================================================
List detected Foreman Maintain services:
Existing services
postgresql, dynflow-sidekiq@orchestrator, foreman, puppetserver, dynflow-sidekiq@worker-1, foreman-proxy
Filtered services
{10=>[Systemd(postgresql [10])], 30=>[Systemd(dynflow-sidekiq@orchestrator [30]), Systemd(foreman [30]), Systemd(puppetserver [30])], 31=>[Systemd(dynflow-sidekiq@worker-1 [31])], 40=>[Systemd(foreman-proxy [40])]}
                                                                      [OK]
--------------------------------------------------------------------------------

Okay, cool.

I still don’t exactly understand why in your case /usr/bin/systemctl is missing (on all my systems, /bin is just a symlink to /usr/bin so wherever the package installs it, it’s found in both).

Anyways. this is good enough for now.
Try taking a backup, does it work?

I upgrade from 18.04 to 20.04 maybe in 20.04 (if you install it from scratch) must have the semilink! Im not sure but maybe this is a reason… on my production system which was 18.04 after upgrade to 20.04 it has also only in /bin/systemctl thats why I guess its because of that…

so its right what I guess, on other machine its 22.04 its under /usr/bin/systemctl and /bin/systemctl as you said.

Okay I’ll run that now

The backup works like a charm, thank you so much @evgeni , I can also restore with foreman-maintain right ?

root@test-dev:~# foreman-maintain backup offline /tmp/backup/
Starting backup: 2023-03-16 09:51:38 +0100
Running preparation steps required to run the next scenarios
================================================================================
Make sure Foreman DB is up:
- Checking connection to the Foreman DB                               [OK]
--------------------------------------------------------------------------------


Running Backup
================================================================================
Confirm turning off services is allowed:
WARNING: This script will stop your services.

Do you want to proceed?, [y(yes), q(quit)] y
                                                                      [OK]
--------------------------------------------------------------------------------
Prepare backup Directory:
Creating backup folder /tmp/backup/foreman-backup-2023-03-16-09-51-38 [OK]
--------------------------------------------------------------------------------
Check if the directory exists and is writable:                        [OK]
--------------------------------------------------------------------------------
Generate metadata:
/ Saving metadata to metadata.yml                                     [OK]
--------------------------------------------------------------------------------
Detect features available in the local proxy:                         [OK]
--------------------------------------------------------------------------------
Add maintenance_mode tables/chain to nftables/iptables:               [OK]
--------------------------------------------------------------------------------
Stop applicable services:

Stopping the following service(s):
postgresql, dynflow-sidekiq@orchestrator, foreman, puppetserver, foreman.socket, dynflow-sidekiq@worker-1, foreman-proxy
\ All services stopped                                                [OK]
--------------------------------------------------------------------------------
Backup config files:
| Collecting config files to backup                                   [OK]
--------------------------------------------------------------------------------
Backup Foreman DB offline:
\ Collecting data from /var/lib/postgresql/10/main/,/var/lib/postgresql/12/main/
                                                                      [OK]
--------------------------------------------------------------------------------
Start applicable services:

Starting the following service(s):
postgresql, dynflow-sidekiq@orchestrator, foreman, puppetserver, dynflow-sidekiq@worker-1, foreman-proxy
- All services started                                                [OK]
--------------------------------------------------------------------------------
Remove maintenance mode table/chain from nftables/iptables:           [OK]
--------------------------------------------------------------------------------
Compress backup data to save space:
/ Compressing backup of Postgres DB                                   [OK]
--------------------------------------------------------------------------------

Done with backup: 2023-03-16 09:53:43 +0100
**** BACKUP Complete, contents can be found in: /tmp/backup/foreman-backup-2023-03-16-09-51-38 ****

Yeah, foreman-maintain restore … is your friend :slight_smile:

Just one more thing. /run/systemd/system/ exists on your system, right? Because that’s a better systemd detection and we should switch to that.

1 Like

thank you :smiley:

Yes its exists on 20.04 and I tested on 22.04 also:

On Ubuntu 20.04 :

# ls /run/systemd/system/
netplan-ovs-cleanup.service  systemd-networkd.service.wants

On Ubuntu 22.04:

# ls /run/systemd/system/
netplan-ovs-cleanup.service  systemd-networkd.service.wants

Its okay when I run foreman-maintain service status that the status of each services e.g. Active: active (running) gray and not active (running) is in green ? because now I have to look at each one if its running or not

The way we call systemctl eats the colors, yes.

But at the end you should see a “All services are running [OK]” and that will indicate that all services are running :slight_smile:

I’ve opened check for systemd by looking at /run/systemd/system by evgeni · Pull Request #698 · theforeman/foreman_maintain · GitHub for the fix to land in the official package :slight_smile:

1 Like

Ok thank you :slight_smile:

Perfect then Ill downlaod it and test it again :slight_smile:
After that Ill install it on my prod system…

Oh, and you can use foreman-maintain service status -b for a more dense output with some colors :slight_smile:

1 Like

Thats nice :slight_smile: thanks a lot :slight_smile: so I think now Im ready with foreman-maintain :slight_smile:

last question please when can I update to the new version? @evgeni

Right now, 1.2.4 is the last version available in the repos and 1.2.7 “staged” for release (= will be released the next time someone clicks the “release 3.5” button)
Once we merge the systemd detection fix above, I intent to release a 1.2.8 and would think that then we actually will go and promote that to the repos.

I wouldn’t want to promise any dates, but I guess a week or so is a reasonable timeframe :slight_smile:

1 Like

Okay thank you so much, I can also fix the line on my prod system and create backup… thanks again :slight_smile:

foreman-maintain 1.2.8 contains the fixes we identified in this thread.
it’s been available for nightly and foreman 3.6 already
3.5 will follow whenever the next 3.5.z happens