Page MenuHomeVyOS Platform

vyos-preconfig-bootup.script is missing
Closed, ResolvedPublicBUG

Description

According to https://docs.vyos.io/en/latest/automation/command-scripting.html there should exist both preconfig and postconfig scripts at following location:

/config/scripts/vyos-preconfig-bootup.script
/config/scripts/vyos-postconfig-bootup.script

However in current 1.4-rolling the preconfig script is missing:

vyos@vyos:~$ ls -la /config/scripts/
total 12
drwxrwsr-x 2 root vyattacfg 4096 Jun 28 05:17 .
drwxrwxr-x 9 root vyattacfg 4096 Aug  4 08:28 ..
-rwxrwxr-x 1 root vyattacfg  230 Aug  3 12:01 vyos-postconfig-bootup.script

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.4-rolling-202308030317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

I need some help with this one.

PR2132 fixes so that the file exists where its supposed to exist (using postconfig as reference) and is being called by init-script etc.

That is during a fresh install the file shows up in /config/scripts.

However during a system upgrade (add system image) the file newer shows up in /config/scripts (if the file not already exists in /config/scripts it should be copied from /usr/lib/live/mount/rootfs/1.4-rolling-202308050917.squashfs/opt/vyatta/etc/config/scripts# vi vyos-preconfig-bootup.script).

So I guess a migrate-script must be created or something to properly fix this?

Or should this be handled statically by the init-script (copy file if it not already exists and then execute it - if so then this must be fixed for the postconfig-file aswell)?

Added task https://vyos.dev/T5440 to fix the issue of preconfig-script doesnt show up in /config/scripts after system upgrade (add system image).

The task will also fix this for postconfig-script to cover for the case if the user accidently deletes the pre/postconfig scripts in /config/scripts.

Verified in VyOS 1.4-rolling-202308140557:

1: Delete the scripts (vyos-preconfig-bootup.script and vyos-postconfig-bootup.script) in /config/scripts and reboot.

2: The scripts have been restored after reboot:

vyos@vyos:~$ sudo ls -la /config/scripts
total 16
drwxrwsr-x 2 root vyattacfg 4096 Aug 14 23:49 .
drwxrwxr-x 9 root vyattacfg 4096 Aug 14 23:49 ..
-rwxr-x--- 1 root vyattacfg  230 Aug 14 23:49 vyos-postconfig-bootup.script
-rwxr-x--- 1 root vyattacfg  225 Aug 14 23:49 vyos-preconfig-bootup.script
Apachez changed the task status from Open to Needs testing.Oct 3 2023, 9:38 AM

Merged, will show up in nightly 2023-10-04.

Verified in VyOS 1.5-rolling-202310090023:

  1. Deleted /config/scripts directory and rebooted.
  1. VyOS came back online without any errors/warnings in the console and the directory /config/scripts has been recreated along with its files:
vyos@vyos:~$ ls -la /config/scripts
total 16
drwxrwsr-x 2 root vyattacfg 4096 Oct 10 06:58 .
drwxrwsr-x 1 root vyattacfg 4096 Oct 10 06:57 ..
-rwxr-x--- 1 root vyattacfg  230 Oct 10 06:58 vyos-postconfig-bootup.script
-rwxr-x--- 1 root vyattacfg  225 Oct 10 06:57 vyos-preconfig-bootup.script

Task can be set to resolved.