Skip to content

Commit

Permalink
Ensure that 'logrotate-config.service' is set as a dependency to star…
Browse files Browse the repository at this point in the history
…t before 'logrotate.service'. (#17312)

* Ensure that 'logrotate-config.service' is set as a dependency to start before 'logrotate.service'.
  • Loading branch information
xincunli-sonic authored Nov 30, 2023
1 parent 5d3e5c0 commit f13081b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,10 @@ fi
## Disable kexec supported reboot which was installed by default
sudo sed -i 's/LOAD_KEXEC=true/LOAD_KEXEC=false/' $FILESYSTEM_ROOT/etc/default/kexec

# Ensure that 'logrotate-config.service' is set as a dependency to start before 'logrotate.service'.
sudo mkdir $FILESYSTEM_ROOT/etc/systemd/system/logrotate.service.d
sudo cp files/image_config/logrotate/logrotateOverride.conf $FILESYSTEM_ROOT/etc/systemd/system/logrotate.service.d/logrotateOverride.conf

## Remove sshd host keys, and will regenerate on first sshd start
sudo rm -f $FILESYSTEM_ROOT/etc/ssh/ssh_host_*_key*
sudo cp files/sshd/host-ssh-keygen.sh $FILESYSTEM_ROOT/usr/local/bin/
Expand Down
1 change: 1 addition & 0 deletions files/image_config/logrotate/logrotate-config.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ After=updategraph.service
[Service]
Type=oneshot
ExecStart=/usr/bin/logrotate-config.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Expand Down
2 changes: 2 additions & 0 deletions files/image_config/logrotate/logrotateOverride.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Unit]
Requires=logrotate-config.service

0 comments on commit f13081b

Please sign in to comment.