yum update during reboot in RHEL 7
Any ideas here:
server needs to perform 'yum update -y' during reboot so that new kernel is automatically installed and patched to latest version. I tried below in RHEL 7 but not working:
[Unit]
Description=Yum udpates
Before=systemd-reboot.service
DefaultDependencies=no
[Service]
ExecStart=/usr/bin/yum update -y
Type=forking
[Install]
WantedBy=reboot.target
when i change WantedBy=multi-user.target its working but that's when server is coming up which doesn't help.
expect to see: yum update needs to run when server is going down(not when server is coming up) so that upon reboot server boots with new kernel.
Responses