1
0
Fork 0
mirror of https://github.com/pygos/init-scripts.git synced 2024-11-21 19:59:46 +01:00

Update documentation

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-11-23 12:59:30 +01:00
parent f86d76513a
commit b67b00ac6f
4 changed files with 39 additions and 4 deletions

View file

@ -7,3 +7,6 @@ service configuration and further, available services.
See [docs/network.md](docs/network.md) for a description on how to do static See [docs/network.md](docs/network.md) for a description on how to do static
network configuration with the provided script and service. network configuration with the provided script and service.
See [docs/swclock.md](docs/swclock.md) for a description on the software pseudo
RTC implementation for systems that do not have a hardware real time clock.

View file

@ -113,10 +113,6 @@ For the shutdown and reboot targets, the following services are executed:
kernels clock from the hardware at bootup, between the `vfs` and `sysinit` kernels clock from the hardware at bootup, between the `vfs` and `sysinit`
targets. targets.
* nft - If enabled, restores net filter table rules during boot. * nft - If enabled, restores net filter table rules during boot.
* swclock - For systems that don't have a hardware clock, this service
restores a somewhat usable time from a file during boot.
* swclocksave - For systems that don't have a hardware clock, this service
saves the current time to a file during shutdown or reboot.
* sshd_keygen - A wait type service that generates host keys for the OpenSSH * sshd_keygen - A wait type service that generates host keys for the OpenSSH
server and then disables itself. server and then disables itself.
* sshd - Starts an OpenSSH server after the network pseudo service and after * sshd - Starts an OpenSSH server after the network pseudo service and after

View file

@ -81,3 +81,14 @@ follows is passed on to `ip route add` or `ip rule add` respectively.
An additional service is provided that restores the nft rule set from An additional service is provided that restores the nft rule set from
`/etc/nftables.rules`. `/etc/nftables.rules`.
# DHCP based network configuration
If the configure option `--enable-dhcpclient` is set, two services are added.
The service `dhpcdmaster` launches a global dhcpcd instance.
For each port that should be configured via DHCP, the service `dhcpcd` needs
to be enabled manually with the port name as argument. The service the runs
after the master service and sends a signal to the master to operate on that
port.

25
docs/swclock.md Normal file
View file

@ -0,0 +1,25 @@
# Software Pseudo RTC
If the configure flag `--enable-swclock` is set, a few service and cron jobs
are enabled that try to help with systems that don't have a hardware real
time clock.
The software pseudo RTC uses a file in `/var/lib` (exact path can be
configured) as backing store for the current date and time.
When booting the system, a service called `swclock` restores the current time
from the file. When performing a reboot or shutdown, a service called
`swclocksave` writes the current time back to the file.
A cron job is enabled that writes the current time to the backing file hourly,
so in case the system momentarily loses power, it loses "only" up to one hour.
The time will drift much worse anyway if the system is powered off (even
intentionally) for a while.
All this is ensures that the system clock is monotonically increasing and only
somewhat behind the actual wall clock time.
To catch up with real time, an additional cron job is enabled that tries to
update the time from an NTP server every four hours. This functionality is
implemented in a small shell script, that is also called from a dhcpcd hook
once a lease is obtained, assuming the DHCP client configure option was set.