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

Ensure that 'logrotate-config.service' is set as a dependency to start before 'logrotate.service'. #17312

Merged
4 changes: 4 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,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'.
xincunli-sonic marked this conversation as resolved.
Show resolved Hide resolved
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
Loading