#!/bin/sh /etc/rc.common
#
# Copyright (C) 2026 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-2.0-only
#
# Procd init script to restore extra packages after a system upgrade.
# Runs late at boot (START=99) with respawn enabled to retry on network failures.
# The respawn policy allows up to 10 restarts within 300 seconds.

START=99
STOP=1

USE_PROCD=1

start_service() {
    procd_open_instance
    procd_set_param command /usr/sbin/ns-restore-extra-packages
    procd_set_param stdout 1
    procd_set_param stderr 1
    procd_set_param respawn 300 30 10
    procd_close_instance
}
