|
## Sysadmins emails should be added in /etc/aliases
|
|
## Sysadmins emails should be added in /etc/aliases
|
|
|
|
|
|
```
|
|
```
|
|
vi /etc/aliases
|
|
# vi /etc/aliases
|
|
root: admin1@domain.net, admin2@domain.net, admin3@domain.net
|
|
root: admin1@domain.net, admin2@domain.net, admin3@domain.net
|
|
```
|
|
```
|
|
|
|
|
|
**WHY:**
|
|
**WHY:**
|
|
|
|
|
|
The server sends emails for the security updates* that have been installed overnight and inform the sysadmins if a reboot is necessary.
|
|
The server sends emails for the security updates* that have been installed overnight and inform the sysadmins if a reboot is necessary.
|
|
|
|
|
|
* Requires that we have enabled unattended updates
|
|
**REQUIRES:**
|
|
|
|
that we have enabled unattended updates, see how-to:
|
|
|
|
https://wiki.debian.org/UnattendedUpgrades
|
|
|
|
|
|
**OPTIONAL:**
|
|
**OPTIONAL:**
|
|
|
|
|
|
In order to receive the latest Debian security advisories, subscribe to the [debian-security-announce](https://lists.debian.org/debian-security-announce/) mailing list.
|
|
In order to receive the latest Debian security advisories, subscribe to the [debian-security-announce](https://lists.debian.org/debian-security-announce/) mailing list.
|
|
|
|
|
|
## Server reboot
|
|
## Server reboot
|
|
`shutdown -r +2 `
|
|
List and save all services currently running in a file with a timestamp in the name, before and after the reboot:
|
|
# the flag +m will execute the shutdown after 2min. Handy to make sure users can logout before shutting down.
|
|
```
|
|
# the flag -r is for reboot
|
|
# systemctl list-units --type=service --state=running > DD-MM-YY-beforeboot
|
|
alternatives:
|
|
```
|
|
|
|
ref: https://linuxhint.com/list-all-running-services-debian/
|
|
|
|
```
|
|
|
|
# shutdown -r +2
|
|
|
|
```
|
|
|
|
* the flag -r is for reboot
|
|
|
|
* the flag +m will execute the shutdown after 2min. Handy to make sure users can logout before shutting down
|
|
|
|
|
|
|
|
When server is back again, save the list of services and check for differences
|
|
|
|
```
|
|
|
|
# systemctl list-units --type=service --state=running > DD-MM-YY-aftereboot
|
|
|
|
# diff service-<timestamp>-beboreboot DD-MM-YY-afterboot > diff-services
|
|
|
|
# less diff-services
|
|
|
|
```
|
|
|
|
|
|
|
|
**ALTERNATIVES:**
|
|
|
|
```
|
|
systemctl reboot
|
|
systemctl reboot
|
|
We didn't find a flag to add specific time, so we opted for the above. |
|
```
|
|
\ No newline at end of file |
|
We didn't find a flag to add specific time of the reboot execution, so we opted for the `shutdown` command to make sure that we have time to finish any pending tasks we run and to exit the server. |
|
|
|
\ No newline at end of file |