Docs / Enrollment / Desktop / Enrol Arch Linux

How to Enrol an Arch Linux Endpoint

This guide walks you through enrolling an Arch Linux endpoint into ZEM Cloud.

Prerequisites

Before enrolling, ensure you have:

  • Supported OS: Arch Linux or Arch-based distributions (Manjaro, EndeavourOS, etc.)
  • Root Access: sudo privileges on the target machine
  • Network Access: Connectivity to your ZEM Cloud server (HTTPS port 443)
  • curl: Installed on the system (pacman -S curl if needed)

Enrolment Steps

Step 1: Open the Enrol Endpoint Wizard

  1. Log in to your ZEM Cloud dashboard
  2. Click the Enrol Endpoint button (green + icon) in the sidebar
  3. Select Desktop as the device type
  4. Select Arch Linux from the platform options

Step 2: Configure Enrolment Options

Configure the following settings:

  • Auto Reboot - Automatically schedules a reboot when an update requires it
  • Reboot Time - Time of day for scheduled reboots (24-hour format)

Toggle the Auto Reboot switch and set your preferred reboot time if needed.

Step 3: Copy the One-Liner Command

A customised installation command will be displayed. It looks like this:

curl -fsSL https://your-zem-server.com/install-arch.sh | sudo bash -s -- --master-url https://your-zem-server.com --api-key YOUR_API_KEY --auto-reboot true --reboot-time 03:00

Click the Copy button to copy the command to your clipboard.

Step 4: Run the Command on the Target Machine

  1. SSH into your Arch Linux server or open a terminal
  2. Paste and execute the copied command
  3. Enter your sudo password when prompted

Step 5: Wait for Installation

The script will automatically:

  1. Detect your Arch Linux installation
  2. Install required dependencies using pacman (jq, bc, curl)
  3. Download the Arch-specific ZEM Cloud agent scripts
  4. Create the configuration file
  5. Set up systemd services and timers
  6. Start the agent

Installation typically takes 30-60 seconds.

What Gets Installed

Agent Scripts

Script | Location | Purpose
zen-update-agent-arch.sh | /usr/local/bin/ | Main agent for updates and actions
zen-update-report-arch.sh | /usr/local/bin/ | Status reporting

Configuration

File | Location
Agent Config | /etc/zen-update/agent.conf
Machine ID | /etc/zen-update/.machine_id

Systemd Services

Service | Timer | Interval
zen-update-agent.service | zen-update-agent.timer | 60 seconds
zen-update-report.service | zen-update-report.timer | 60 seconds
zen-update-telemetry.service | zen-update-telemetry.timer | 5 seconds
zen-update-hwinfo.service | zen-update-hwinfo.timer | 30 minutes

Arch Linux-Specific Features

Package Management

The Arch agent uses pacman for package management:

  • Update Detection - Uses checkupdates to detect available updates
  • Update Installation - Uses pacman -Syu --noconfirm for system updates
  • Package Inventory - Reports all installed packages via pacman -Q

Security Updates

Security updates are identified by checking if packages are from the core repository, which typically contains critical security patches.

Verifying Enrolment

Check Agent Status

Check if the agent timer is active:

systemctl status zen-update-agent.timer

Check if the agent service ran successfully:

systemctl status zen-update-agent.service

View recent agent logs:

journalctl -u zen-update-agent.service -n 50

View in Dashboard

  1. Navigate to Endpoint Overview in ZEM Cloud
  2. The new endpoint should appear within 60 seconds
  3. Click on the endpoint to view details

Expected Output

When the agent runs successfully, you'll see:

  • Hostname and IP address in the dashboard
  • OS information (Arch Linux)
  • Update count from checkupdates
  • Real-time telemetry data

Configuration Options

The agent configuration is stored in /etc/zen-update/agent.conf:

MASTER_URL="https://your-zem-server.com"
TOKEN="your-api-key"
AUTO_REBOOT="true"
REBOOT_TIME="03:00"

Troubleshooting

Agent Not Running

Restart the agent:

sudo systemctl restart zen-update-agent.timer

Enable the agent to start on boot:

sudo systemctl enable zen-update-agent.timer

Missing Dependencies

Install required packages:

sudo pacman -S jq bc curl

checkupdates Not Working

The checkupdates utility is part of the pacman-contrib package:

sudo pacman -S pacman-contrib

Network Issues

Test connectivity to ZEM Cloud:

curl -I https://your-zem-server.com/api/agent_version

Check DNS resolution:

nslookup your-zem-server.com

View Detailed Logs

View full agent log:

sudo cat /var/log/zen-update-agent.log

Follow logs in real-time:

sudo tail -f /var/log/zen-update-agent.log

Common Errors

Error | Cause | Solution
curl: (6) Could not resolve host | DNS resolution failed | Check network settings and DNS
curl: (7) Failed to connect | Server unreachable | Verify server URL and firewall rules
checkupdates: command not found | Missing pacman-contrib | Install with pacman -S pacman-contrib

Uninstalling the Agent

To remove the ZEM Cloud agent from an Arch Linux system:

Stop and disable services:

sudo systemctl stop zen-update-agent.timer zen-update-report.timer
sudo systemctl stop zen-update-telemetry.timer zen-update-hwinfo.timer
sudo systemctl disable zen-update-agent.timer zen-update-report.timer
sudo systemctl disable zen-update-telemetry.timer zen-update-hwinfo.timer

Remove service files:

sudo rm /etc/systemd/system/zen-update-*
sudo systemctl daemon-reload

Remove agent scripts:

sudo rm /usr/local/bin/zen-update-*-arch.sh

Remove configuration:

sudo rm -rf /etc/zen-update

Remove logs:

sudo rm /var/log/zen-update-*.log