Unttended installation using Agama skips init scripts due to wrong location

Hi all,

I am updating our leap 15.6 systems to leap 16.0 using agama profiles for unattended installation. I am using post and init scripts in the profile.

A few days ago, everything worked fine. But today, the init scripts do not run anymore at first boot. They are beeing skipped.

From journalctl I found that the service agama-scripts.service is looking for init scripts in /var/log/agama/scripts/init/. This folder does not exist on my system after a fresh install. I can only find my scirpts in: /var/log/agama-installation/scripts/init.

The service and a install script is part of the package agama-scripts. This package was updated 3 days ago. In the older version https://download.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/agama-scripts-17+502.a135c718e-160000.8.1.x86_64.rpm the install script looks for init-scripts at /var/log/agama/scripts/init. Using this package, the init scripts run at boot if the service is enabled.

Agama uses the online repo as installation source. I will therefore change that to a local iso source.

Best regards,
Gregor

I need to correct the paths. I am sorry for the mistake.

The current version of agama-scripts looks for init scripts at /var/lib/agama/scripts/init.

The older version looks at /var/log/agama-installation/scripts/init.

After new installation my init scripts are in the following path: /var/log/agama-installation/scripts/init. This is why the newer verison of agama-scripts package does not work.

Best regards

I just started having build failures around the time you posted this. I use inline scripts to enable ssh and enable passwordless sudo. ALl the sudden my Packer pipeline has started failing with no explanation and zero changes. I intervened today to find that ssh and sudo configuration had not been executed. So I think this may be a bug in the Agama installer too.

Example of my init script:

  scripts: {
    init: [
      {
        name: "enable-sshd",
        content: |||
          #!/usr/bin/bash
          systemctl enable sshd.service
          systemctl start sshd.service
        |||
      },
      {
        name: "enable-passwordless-sudo",
        content: |||
          #!/usr/bin/bash
          echo "user ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/user
          chmod 0440 /etc/sudoers.d/user
        |||
      }
    ]
  }

Has anyone else experienced this yet with unattended installs?

Hi eec-kowen,

I had the same issue that my init-scripts in the agama profile were suddenly skipped. I found out that the systemd service agama-scripts.service ist responsible for running these scripts at the first boot. This service executes the script at /usr/libexec/agama-scripts.sh. And this script executes the init scripts.

Now there is the bug. The current Version of agama-scripts (17+552.696adcca2-160000.9.1) searches for init-scripts at a wrong path, as I described above.

For me I fixed the bug without having to manually execute the init scripts by adding the following post-script to my agama profile:

"scripts": {
    "post": [
     {
        "name": "change_agama-scripts_version.bash",
        "content": "#!/bin/bash\nzypper --non-interactive remove agama-scripts\nzypper --non-interactive install agama-scripts-17+502.a135c718e-160000.8.1\nsystemctl enable agama-scripts.service",
        "chroot": true
      }
    ],

This rolls agama-scripts back to version 17+502.a135c718e-160000.8.1 wehre the correct path for the init scripts is set before the first reboot.

Best regards,
Gregor

1 Like

Is it definitely a bug? Or are there plans to change it? I couldn’t find any bug report…

Maybe it is planned to change the location of the scripts. But atm when I use the newest ISO for automated installation with agama, my init scripts are placed at /var/log… But the automatically installed agama-scripts fails due to the wrong path.

I did not write any bug reports yet.

Hmm… What was the newest version in your case? The 16.1 ISO? I’ll try it later today before I create any bug report.
But the 16.0 ISO is definitely unchanged.
It seems like /var/lib/agama/scripts/... is the new intended path, not a mistake, but the installation media (which is therefore kinda deprecated) isn’t aware of that.

I’ve found only this:

Yes, that seems to be the issue. I used the Leap 16.0 Offline-Image [1]. As far as I understand, the LiveOS on the ISO contains the Agama installer. The installer uses the online repositories for installation as default. Thats why the newest agama-scripts package is installed.

Seems like the Agama LiveOS on the ISO must be updated to be aware of the new path?

[1] https://download.opensuse.org/distribution/leap/16.0/offline/Leap-16.0-offline-installer-x86_64.install.iso