Skip to content

Fix autossh-hamma-default.service After line spacing bug on all sensors #51

@pbitzer

Description

@pbitzer

Problem

The autossh-hamma-default.service systemd unit file has a malformed After line on deployed sensors:

After = multi-user.targetnetwork.targetsshd.service

Should be:

After = multi-user.target network.target sshd.service

This means systemd isn't properly ordering the autossh service after network.target and sshd.service — it's treating the concatenated string as a single (nonexistent) target.

Affected Sensors

Sensor Status
mj00 BUGGED
mj01 Unreachable
mj02 Unreachable
mj03 BUGGED
mj04 BUGGED
mj05 BUGGED
mj06 BUGGED
mj07 FIXED (2026-04-23)
mj08 Unreachable
mj09 Unreachable
mj10 Unreachable
mj41 BUGGED
mj42 Correct (not affected)
mj43 BUGGED

Fix

On each sensor:

sudo sed -i 's/After = multi-user.targetnetwork.targetsshd.service/After = multi-user.target network.target sshd.service/' /etc/systemd/system/autossh-hamma-default.service
sudo systemctl daemon-reload
sudo systemctl restart autossh-hamma-default.service

Note: Restarting autossh will briefly drop the SSH tunnel — the sensor will reconnect automatically.

Root Cause

The service file is generated by brokkr install-autosshserviceinstaller.install_service(). The source template in brokkr/src/brokkr/utils/services.py:79 has correct spacing. The bug is in the serviceinstaller package which strips spaces when writing the .service file. The ultimate fix needs to happen in serviceinstaller.

Additional Note

mj07 also had a stale autossh-hamma.service (with unresolved {SYSTEM_FULLNAME} in description) running alongside the correct -default service. That was stopped, disabled, and removed on 2026-04-23.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions