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

* Ensure that 'logrotate-config.service' is set as a dependency to start before 'logrotate.service'.
This commit is contained in:
Xincun Li 2023-11-29 17:22:47 -08:00 committed by GitHub
parent 5d3e5c0094
commit f13081bfbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -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/

View File

@ -6,6 +6,7 @@ After=updategraph.service
[Service]
Type=oneshot
ExecStart=/usr/bin/logrotate-config.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,2 @@
[Unit]
Requires=logrotate-config.service