Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a SONiC configuration management service #3227

Merged
merged 7 commits into from
Dec 4, 2019
18 changes: 18 additions & 0 deletions files/build_templates/config-setup.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=Config initialization and migration service
After=rc-local.service
After=database.service
Requires=database.service
{% if sonic_asic_platform == 'mellanox' -%}
Requires=hw-management.service
{% endif -%}


[Service]
Type=oneshot
ExecStart=/usr/bin/config-setup boot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

5 changes: 5 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ sudo bash -c "echo '{ \"DEVICE_METADATA\": { \"localhost\": { \"default_bgp_stat
\"{{crm_res}}_threshold_type\": \"percentage\", \"{{crm_res}}_low_threshold\": \"70\", \"{{crm_res}}_high_threshold\": \"85\"{% if not loop.last %}, {% endif %}
{%- endfor %} } } }' >> $FILESYSTEM_ROOT/etc/sonic/init_cfg.json"

# Copy config-setup script and service file
j2 files/build_templates/config-setup.service.j2 | sudo tee $FILESYSTEM_ROOT/etc/systemd/system/config-setup.service
sudo cp $IMAGE_CONFIGS/config-setup/config-setup $FILESYSTEM_ROOT/usr/bin/config-setup
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable config-setup.service

# Copy SNMP configuration files
sudo cp $IMAGE_CONFIGS/snmp/snmp.yml $FILESYSTEM_ROOT/etc/sonic/

Expand Down
9 changes: 2 additions & 7 deletions files/build_templates/updategraph.service.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
[Unit]
Description=Update minigraph and set configuration based on minigraph
After=rc-local.service
After=database.service
Requires=database.service
{% if sonic_asic_platform == 'mellanox' -%}
Requires=hw-management.service
{% endif -%}

After=config-setup.service
Requires=config-setup.service

[Service]
Type=oneshot
Expand Down
Loading