summaryrefslogtreecommitdiff
path: root/src/init
AgeCommit message (Collapse)Author
2026-11-02Merge pull request #5588 from c-po/no-exec-bitChristian Breunig
T9477: remove no longer needed executable bit from conf_mode/migration scripts
2026-10-31interfaces: T3871: give a re-created Hyper-V NIC the name of the NIC it replacedAlex Kudentsov
A Hyper-V NIC is known by its MAC alone. One deleted and created again on the same VM - an Azure NIC re-created, or a Hyper-V adapter removed and added - comes back with a new MAC, so nothing on it matched the store: its name stayed reserved, the new NIC got a new name, and its configuration was left on a name with no NIC. cloud-init does not run again on the same instance, so nothing else repairs it. At boot, a vacant name now goes to a new NIC only when the pairing is not in doubt: - exactly one recorded name has no NIC, and exactly one new Hyper-V NIC appeared. With more of either, the order the NICs come up in does not say which replaced which, so nothing is handed over and the names stay reserved, as before; - the name went missing at this pass. The store records which names were missing at the last pass, so a NIC removed for good does not hand its name to a NIC added at a later boot; - the name's own NIC was a Hyper-V one. The store records which names sat on a Hyper-V NIC; a MAC-keyed name can belong to other hardware, and a store written before this was recorded hands nothing over (the boot pass logs that when it holds a name back); - only at boot. On a running system the configuration under a name is not applied to the NIC that takes it, so the hotplug unit passes --hotplug, which names the new NIC like any other and records the vacant name as missing, so the next boot does not hand it over either. An adoption is logged as a warning, reported under 'adopted' in the status file (kept there across hotplug passes while it holds), and repeated by vyos-router, as a slot match is: verify the port before relying on its configuration.
2026-10-31interfaces: T3871: name interfaces from a slot-anchored mapping storeChristian Breunig
Names used to be derived from 'hw-id' in config.boot. A node carrying an address but no hw-id had to be matched to some NIC, and nothing available at boot could say which one - every heuristic could bind a configured address to the wrong physical wire. Naming authority moves to a mapping store binding a name to the slot the hardware occupies. The slot is the identity, so a replacement card in that slot is that interface again. The store renders systemd .link files, leaving udev to apply names as devices appear.
2026-10-31Revert: T3871: make boot-time interface naming deterministic and hw-id awareChristian Breunig
This reverts commit 22cfee116c9935f4a33da4923eff189f2f646371.
2026-10-24T9477: remove no longer needed executable bit from conf_mode scriptsChristian Breunig
With the full integration of vyos-configd, conf_mode scripts are loaded as Python modules and are no longer meant to be executed individually. Drop the executable bit and the now meaningless shebang. The remaining callers that ran a script directly (boot, op-mode, dhclient hook, vyshim fallback, ...) now invoke it through python3. The build now aborts if a conf_mode script is executable.
2026-10-08vyos-router: T9447: stop copying a directory when restoring the bootup hooksChristian Breunig
A boot whose configuration directory carries no pre/post-config hook scripts copies them out of the running image. That copy named the image root twice, because the image's squashfs is mounted at two paths and the variable holding it kept both. One extra operand reached cp as a bare directory: cp: -r not specified; omitting directory '/run/live/rootfs/<image>.squashfs' The hook itself still landed, so nothing broke, but the copy reported failure and was one word-split away from restoring the wrong file. It shows up where the encrypted configuration volume stays shut, leaving the directory beneath it empty. The image root is now a single path, the two identical restore paths share one implementation, and a copy that fails is logged rather than passing silently. A missing hook is not escalated - on a first boot that would hand the system to the upgrade-failure rollback.
2026-09-06dhcp: T9278: move DHCP client hook tracing to a gated debug levelChristian Breunig
Each lease event emitted some fifteen daemon.info lines tracing internal steps rather than recording a change. Add a "debug" level to logmsg(), silenced unless /tmp/vyos.dhclient.debug exists, following the flag file convention used for FRR and ifconfig. Demoting alone would not help, as journald shows all priorities by default. Fifteen tracing messages move to debug; the sixteen recording an actual change stay at info. Also fix logmsg(): "warn" had no case arm although it is used, and the global LOG_PRIO leaked the preceding call's priority. It is now local.
2026-08-08T3871: make boot-time interface naming deterministic and hw-id awareChristian Breunig
Multi-vendor PCIe NIC systems could lose or rename Ethernet/wireless interfaces on boot, because naming was decided from a single per-device udev event before all hardware had a chance to enumerate. Replace that with one authoritative pass, run once configuration is available during router startup: wait for configured hardware, apply every hw-id binding, and name whatever has none yet by PCIe distance from the root complex and MAC address - the same result every boot. A node with its hw-id deleted (NIC replacement) or its whole configuration removed is treated as an ordinary open slot, filled the same way - recovering its original hardware whenever the interfaces that vacated slots this boot also show up as candidates. Boot now reports any interface still unresolved, and the pass is covered by a new test suite in vyos-build named: make testifname Assisted-by: Claude:claude-sonnet-5
2026-06-16T8923: normalize "can not" to "cannot"Christian Breunig
Replace two-word "can not" / "Can not" with "cannot" across comments, ConfigError messages, CLI help text, and op-mode output. Standard SNMP MIB files under mibs/ are left unchanged.
2026-04-15T8445: catch script runner error in vyos-routerJohn Estabrook
2026-04-09vyos-router: T8375: rename "system" to "activate"Christian Breunig
Clearly indicate during startup what happens. When we see "system" on the CLI, infact we ran the activation scripts, thus the rename.
2026-04-02Merge pull request #4872 from c-po/vyos-netlinkdChristian Breunig
vyos-netlinkd: T8047: replacement of netplugd
2026-03-24T8410: Fix typos and mistakes for operational and configuration commandsViacheslav Hletenko
Fix typos and mistakes in the commands and comments No functional changes
2026-03-24T8418: adjust permissions setting of config.boot for case of cloud-initJohn Estabrook
Group owner and write permission were set within a conditional block that cloud-init does not see. Move settings outside of unneeded conditional protection.
2026-03-19vyos-netlinkd: T8047: replace netplugdChristian Breunig
Implementing a daemon that listens for netlink messages in Python was discussed for many years. This is a proof-of-concept implementation how we can listen for netlink messages and process them in Python. Python 3.10 minimum is required due to the use of case statements which mimics C-style switch/case instructions. Add example: set interfaces ethernet eth1 vif 21 address dhcp set interfaces ethernet eth1 vif 21 address dhcpv6 commit If network cable is unplugged: vyos-netlinkd[12681]: RTM_NEWLINK -> eth3.10, state=DOWN, mac=00:50:56:b3:9d:8e vyos-netlinkd[12681]: Stopping dhclient@eth3.10.service... vyos-netlinkd[12681]: Stopping dhcp6c@eth3.10.service... If cable is plugged back in: vyos-netlinkd[12681]: RTM_NEWLINK -> eth3.10, state=DOWN, mac=00:50:56:b3:9d:8e vyos-netlinkd[12681]: RTM_NEWLINK -> eth3.10, state=UP, mac=00:50:56:b3:9d:8e vyos-netlinkd[12681]: Restarting dhclient@eth3.10.service... vyos-netlinkd[12681]: Restarting dhcp6c@eth3.10.service...
2026-02-25T8279: recover config data provided by legacy image upgrade toolsJohn Estabrook
When upgrading from systems using the legacy image upgrade tools (1.3.x), config data is copied to a now non-standard path. Add check on first boot into target image to recover source image config data.
2025-11-01T7980: distinguish vyconfd initialization from restartJohn Estabrook
2025-11-01T7980: defer startup of vyconfd for consistent bookkeepingJohn Estabrook
To ensure consistency of vyconfd restart in the testing framework, defer startup until execution of set_vyconf_backend.py. This will be restored to vyos-router once vyos-boot-config-loader.py is adapted to vyconf.
2025-09-23kea: T7854: Use helper for Kea VRF systemd unitssarthurdev
2025-09-19T7836: use /opt/vyatta/etc/config as source of truth in tpm encryptionJohn Estabrook
The mount point /opt/vyatta/etc/config is considered the source of truth whereas /config is simply a bind mount of convenience. As the latter is no longer defined at boot, all operations should use the former.
2025-09-19T7836: move bind mount of /config to vyos-1xJohn Estabrook
We are removing the bind mount construction from the initrd components in live-boot, as: (1) it is not needed before initialization in the vyos-router script (2) does not correctly update inodes on libc rename (3) fails on the livecd (cf. /var/log/live/boot.log)
2025-07-15tpm: T4919: Add boot warning if TPM not presentsarthurdev
2025-07-03Merge pull request #4585 from c-po/copyright-noticeDaniil Baturin
T7591: remove copyright years from source files
2025-06-28T7591: remove copyright years from source filesChristian Breunig
The legal team says years are not necessary so we can go ahead with it, since it will simplify backporting. Automatically removed using: git ls-files | grep -v libvyosconfig | xargs sed -i -E \ 's/^# Copyright (19|20)[0-9]{2}(-[0-9]{4})? VyOS maintainers.*/# Copyright VyOS maintainers and contributors <maintainers@vyos.io>/g' In addition we will error-out during "make" if someone re-adds a legacy copyright notice
2025-06-24Fix uuidgen warning if DMI doesn't have product_serial or it emptyNobi
2025-05-17T1771: automatic reboot of system into previous imageChristian Breunig
If any part of the system boot fails, we set overall_status=1 in the vyos-router startup script. When an error during the image upgrade is detected, the system will automatically revert the default boot image to the previously used version, if the CLI option "system option reboot-on-upgrade-failure" is set. The user is informed via console messages: Booting failed, reverting to previous image Automatic reboot in 5 minutes Use "reboot cancel" to cancel The user has time to log in and run reboot cancel to remain in the faulty image for troubleshooting. Reboot timeout is defined by CLI: "system option reboot-on-upgrade-failure" Once the system boots into the previous image, the MOTD will display a persistent warning message - cleared during next reboot. WARNING: Image update to "VyOS 1.5.xxxx" failed Please check the logs: /usr/lib/live/mount/persistence/boot/NAME/rw/var/log Message is cleared on next reboot! Upgrade failure can be synthetically injected by booting with Kernel command line option: vyos-fail-migration
2025-05-04Revert "vyos-router: T7356: unset ANSI bold control character during boot"Christian Breunig
This reverts commit ddca20df57008bd85b1363e089152e0ebf014f73.
2025-04-18syslog: T7367: ensure rsyslog is registered as default systemd syslog serviceChristian Breunig
Systemd states: The default syslog implementation should make syslog.service a symlink to itself, so that this socket activates the right actual syslog service.
2025-04-15Merge pull request #4449 from c-po/netplug-T7353Daniil Baturin
T7353: T7360: netplug: behavior change 1.3.8 -> 1.4 when interface with DHCP address looses carrier
2025-04-13vyos-router: T7356: unset ANSI bold control character during bootChristian Breunig
With the Debian Upgrade from buster to bookworm during the 1.3 -> 1.4 cycle we inherited a non nice looking ANSI bold setting on the terminal. The ANSI bold control character is reset "\033[0m" in this commit.
2025-04-13netplug: T7353: define proper systemd serviceChristian Breunig
Netplug daemon is started last after all interfaces got initialized to properly monitor them for up/down events
2025-02-04init: T6989: start syslog earlyChristian Breunig
2024-12-16frr: T6746: add default entry for config debug fileChristian Breunig
A lot of services have dynamic debug capabilities which will be turned on by creating a file in /tmp. These scripts have the path hardcoded and sometimes accross multiple places (bad). This commit introduces vyos.defaults.frr_debug_enable to get the path for the debug file from a single location.
2024-12-10vyconf: T6718: start vyconfd from vyos-routerJohn Estabrook
Start vyconfd after migration.
2024-12-10vyconf: T6718: add boot configsJohn Estabrook
Add current config and failsafe for vyconfd to load on startup.
2024-11-22pki: T6809: Support system install of CA certificatessarthurdev
2024-06-26migration: T6007: add util add_system_version to replace *_system_footerJohn Estabrook
2024-06-05migration: T6006: add activation script dir and helper functionJohn Estabrook
2024-06-05migration: T6006: update config.boot.default and move to vyos-1xJohn Estabrook
2024-04-21smoketest: support dynamic enable of smoketest debuggingChristian Breunig
$ touch /tmp/vyos.smoketest.debug will enable dynamic debugging of the smoketests - showing the appropriate CLI commands on stdout
2024-04-01init: T3355: always use full nft command name (e.g. --file over -f)Christian Breunig
2024-03-07Merge pull request #1740 from sarthurdev/tpm_luksDaniil Baturin
config: T4919: Add support for encrypted config with TPM
2024-03-07config: T4919: mount/unmount encrypted config on VyOS start/stopsarthurdev
Re-implements https://github.com/vyos/vyatta-cfg/pull/54
2024-03-04T6096: Config commits are not synced properly because 00vyos-sync is deleted ↵Apachez
by vyos-router
2024-02-12init: T2044: fix "binary operator expected" when two or more RPKI caches are ↵Christian Breunig
defined Fix commit 9b8e11e07 ("init: T2044: only start rpki if cache is configured") which showed a disturbing error on tty0 after boot that a "binary operator expected" when checking for RPKI caches when multiple results got returned.
2024-02-07init: T2044: only start rpki if cache is configuredChristian Breunig
This extends commit 9199c87cf ("init: T2044: always start/stop rpki during system boot") to check the bootup configuration if an RPKI cache is defined. Only start RPKI if this is the case.
2024-02-03init: T2044: always start/stop rpki during system bootChristian Breunig
2023-12-31T5474: establish common file name pattern for XML conf mode commandsChristian Breunig
We will use _ as CLI level divider. The XML definition filename and also the Python helper should match the CLI node. Example: set interfaces ethernet -> interfaces_ethernet.xml.in set interfaces bond -> interfaces_bond.xml.in set service dhcp-server -> service_dhcp-server-xml.in
2023-12-08login: T4943: use pam-auth-update to enable/disable Google authenticatorChristian Breunig
The initial version always enabled Google authenticator (2FA/MFA) support by hardcoding the PAM module for sshd and login. This change only enables the PAM module on demand if any use has 2FA/MFA configured. Enabling the module is done system wide via pam-auth-update by using a predefined template. Can be tested using: set system login user vyos authentication plaintext-password vyos set system login user vyos authentication otp key 'QY735IG5HDHBFHS5W7Y2A4EM274SMT3O' See https://docs.vyos.io/en/latest/configuration/system/login.html for additional details.
2023-10-04login: T5521: do not call system-login.py in vyos-router initChristian Breunig
Calling system-login.py with no mounted VyOS config has the negative effect that the script will not detect any local useraccounts and thus assumes they all need to be removed from the password backend. As soon as the VyOS configuration is mounted and the CLI content is processed, system-login.py get's invoked and re-creates the before deleted user accounts. As the account names are sorted in alphabetical order, the name <-> UID mapping can get mixed up during system reboot. The intention behind calling system-login.py from vyos-router init was to reset system services (PAM, NSS) back to sane defaults with the defaults provided via system-login.py. As PAM is already reset in vyos-router startup script, /etc/nsswitch.conf was the only candidate left. This is now accomplished by simply creating a standard NSS configuration file tailored for local system accounts. This is the second revision after the first change via commit 64d32329958 ("login: T5521: home directory owner changed during reboot") got reverted.