Skip to content

Commit ad59368

Browse files
sujinmkangtiantianlv
authored andcommitted
[reboot cause]: Delay process-reboot-cause service until network connection is stable (sonic-net#4003)
1 parent 4f17bed commit ad59368

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=Delays process-reboot-cause until network is stably connected
3+
4+
[Timer]
5+
OnBootSec=1min 30 sec
6+
Unit=process-reboot-cause.service
7+
8+
[Install]
9+
WantedBy=timers.target

files/build_templates/sonic_debian_extension.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ sudo cp $IMAGE_CONFIGS/procdockerstatsd/procdockerstatsd.service $FILESYSTEM_RO
283283
echo "procdockerstatsd.service" | sudo tee -a $GENERATED_SERVICE_FILE
284284
sudo cp $IMAGE_CONFIGS/procdockerstatsd/procdockerstatsd $FILESYSTEM_ROOT/usr/bin/
285285

286+
# Copy systemd timer configuration
287+
# It implements delayed start of services
288+
sudo cp $BUILD_TEMPLATES/process-reboot-cause.timer $FILESYSTEM_ROOT/etc/systemd/system/
289+
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable process-reboot-cause.timer
290+
286291
# Copy process-reboot-cause service files
287292
sudo cp $IMAGE_CONFIGS/process-reboot-cause/process-reboot-cause.service $FILESYSTEM_ROOT/etc/systemd/system/
288293
echo "process-reboot-cause.service" | sudo tee -a $GENERATED_SERVICE_FILE

files/image_config/process-reboot-cause/process-reboot-cause.service

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ After=rc-local.service
55
[Service]
66
Type=simple
77
ExecStart=/usr/bin/process-reboot-cause
8-
9-
[Install]
10-
WantedBy=multi-user.target

0 commit comments

Comments
 (0)