{{Handbook:Parts/Warning}} {{Handbook:Parts/TOC}} == {{Anchor|System_logger}} System logger == === {{Anchor|system_logger_OpenRC}} OpenRC === Some tools are missing from the stage3 archive because several packages provide the same functionality. It is now up to the user to choose which ones to install. The first tool decision is a logging mechanism for the system. Unix and Linux have an excellent history of logging capabilities - if needed, everything that happens on the system can be logged in a log file. Gentoo offers several system logger utilities. A few of these include: * {{Link|Sysklogd|sysklogd}} ({{Package|app-admin/sysklogd}}) - Offers the traditional set of system logging daemons. The default logging configuration works well out of the box which makes this package a good option for beginners. * {{Link|Syslog-ng|syslog-ng}} ({{Package|app-admin/syslog-ng}}) - An advanced system logger. Requires additional configuration for anything beyond logging to one big file. More advanced users may choose this package based on its logging potential; be aware additional configuration is a necessity for any kind of smart logging. * {{Link|Metalog|metalog}} ({{Package|app-admin/metalog}}) - A highly-configurable system logger. There may be other system logging utilities available through the Gentoo ebuild repository as well, since the number of available packages increases on a daily basis. {{Tip|If syslog-ng is going to be used, it is recommended to install and configure {{Link|logrotate}}. syslog-ng does not provide any rotation mechanism for the log files. Newer versions (>{{=}} 2.0) of sysklogd however handle their own log rotation.}} To install the system logger of choice, emerge it. On OpenRC, add it to the default runlevel using {{c|rc-update}}. The following example installs and activates {{Package|app-admin/sysklogd}} as the system's syslog utility: {{Emerge|app-admin/sysklogd}} {{RootCmd|rc-update add sysklogd default}} === {{Anchor|system_logger_systemd}} systemd === While a selection of logging mechanisms are presented for OpenRC-based systems, systemd includes a built-in logger called the '''systemd-journald''' service. The systemd-journald service is capable of handling most of the logging functionality outlined in the previous system logger section. That is to say, the majority of installations that will run systemd as the system and service manager can ''safely skip'' adding a additional syslog utilities. See {{c|man journalctl}} for more details on using {{c|journalctl}} to query and review the systems logs. For a number of reasons, such as the case of forwarding logs to a central host, it may be important to include ''redundant'' system logging mechanisms on a systemd-based system. This is a irregular occurrence for the handbook's typical audience and considered an advanced use case. It is therefore not covered by the handbook. == {{Anchor|Optional:_Cron_daemon}} Optional: Cron daemon == === {{Anchor|cron_daemon_OpenRC}} OpenRC === Although it is optional and not required for every system, it is wise to install a cron daemon. A cron daemon executes commands on scheduled intervals. Intervals could be daily, weekly, or monthly, once every Tuesday, once every other week, etc. A wise system administrator will leverage the cron daemon to automate routine system maintenance tasks. All cron daemons support high levels of granularity for scheduled tasks, and generally include the ability to send an email or other form of notification if a scheduled task does not complete as expected. Gentoo offers several possible cron daemons, including: * {{Link|Cron|section=#cronie|cronie}} ({{Package|sys-process/cronie}}) - cronie is based on the original cron and has security and configuration enhancements like the ability to use PAM and SELinux. * {{Link|Cron|section=#dcron|dcron}} ({{Package|sys-process/dcron}}) - This lightweight cron daemon aims to be simple and secure, with just enough features to stay useful. * {{Link|Cron|section=#fcron|fcron}} ({{Package|sys-process/fcron}}) - A command scheduler with extended capabilities over cron and anacron. * {{Link|Cron|section=#bcron|bcron}} ({{Package|sys-process/bcron}}) - A younger cron system designed with secure operations in mind. To do this, the system is divided into several separate programs, each responsible for a separate task, with strictly controlled communications between parts. ==== {{Anchor|Default:_cronie|cronie}} Default: cronie ==== The following example uses {{Package|sys-process/cronie}}: {{Emerge|sys-process/cronie}} Add cronie to the default system runlevel, which will automatically start it on power up: {{RootCmd|rc-update add cronie default}} ==== {{Anchor|Alternative:_dcron}} Alternative: dcron ==== {{Emerge|sys-process/dcron}} If dcron is the go forward cron agent, an additional initialization command needs to be executed: {{RootCmd|crontab /etc/crontab}} ==== {{Anchor|Alternative:_fcron}} Alternative: fcron ==== {{Emerge|sys-process/fcron}} If fcron is the selected scheduled task handler, an additional emerge step is required: {{Emerge|params=--config|sys-process/fcron}} ==== {{Anchor|Alternative:_bcron}} Alternative: bcron ==== bcron is a younger cron agent with built-in privilege separation. {{Emerge|sys-process/bcron}} === {{Anchor|cron_daemon_systemd}} systemd === Similar to system logging, systemd-based systems include support for scheduled tasks out-of-the-box in the form of ''timers''. systemd timers can run at a system-level or a user-level and include the same functionality that a traditional cron daemon would provide. Unless redundant capabilities are necessary, installing an additional task scheduler such as a cron daemon is generally unnecessary and can be safely skipped. == {{Anchor|Optional:_File_indexing}} Optional: File indexing == In order to index the file system to provide faster file location capabilities, install {{Link|Mlocate|mlocate}}: {{Emerge|sys-apps/mlocate}} == {{Anchor|Optional:_Remote_shell_access}} Optional: Remote shell access == {{Tip|opensshd's default configuration does not allow root to login as a remote user. Please {{Link|FAQ|section=#How_do_I_add_a_normal_user.3F|create a non-root user}} and configure it appropriately to allow access post-installation if required, or adjust {{Path|/etc/ssh/sshd_config}} to allow root.}} To be able to access the system remotely after installation, {{c|sshd}} must be configured to start on boot. For more in-depth details on the configuration of SSH, refer to the {{Link|SSH}} article. === {{Anchor|remote_shell_access_OpenRC}} OpenRC === To add the {{Path|sshd}} init script to the default runlevel on OpenRC: {{RootCmd|rc-update add sshd default}} If serial console access is needed (which is possible in case of remote servers), {{c|agetty}} must be configured. Uncomment the serial console section in {{Path|/etc/inittab}}: {{RootCmd|nano -w /etc/inittab|output=
# SERIAL CONSOLES
s0:12345:respawn:/sbin/agetty 9600 ttyS0 vt100
s1:12345:respawn:/sbin/agetty 9600 ttyS1 vt100
}} === {{Anchor|remote_shell_access_systemd}} systemd === To enable the SSH server, run: {{RootCmd|systemctl enable sshd}} To enable serial console support, run: {{RootCmd|systemctl enable getty@tty1.service}} == Optional: Shell completion == === Bash === Bash is the default shell for Gentoo systems, and therefore installing completion extensions can aid in efficiency and convenience to managing the system. The {{Package|app-shells/bash-completion}} package will install completions available for Gentoo specific commands, as well as many other common commands and utilities: {{Emerge|app-shells/bash-completion}} Post installation, bash completion for specific commands can managed through {{c|eselect}}. See the {{Link|Bash#Shell_completion_integrations|Shell completion integrations section}} of the bash article for more details. == {{Anchor|Suggested:_Time_synchronization|Time_synchonization}} Suggested: Time synchronization == It is important to use some method of synchronizing the system clock. This is usually done via the [https://en.wikipedia.org/wiki/Network_Time_Protocol NTP] protocol and software. Other implementations using the NTP protocol exist, like {{Link|Chrony}}. To set up Chrony, for example: {{Emerge|net-misc/chrony}} === {{Anchor|time_synchonization_OpenRC}} OpenRC === On OpenRC, run: {{RootCmd|rc-update add chronyd default}} === {{Anchor|time_synchonization_systemd}} systemd === On systemd, run: {{RootCmd|systemctl enable chronyd.service}} Alternatively, systemd users may wish to use the simpler {{c|systemd-timesyncd}} SNTP client which is installed by default. {{RootCmd|systemctl enable systemd-timesyncd.service}} == {{Anchor|Filesystem_tools}} Filesystem tools == Depending on the filesystems used, it may be necessary to install the required file system utilities (for checking the filesystem integrity, (re)formatting file systems, etc.). Note that ext4 user space tools ({{Package|sys-fs/e2fsprogs}}) are already installed as a part of the {{Link|System set (Portage)|@system set}}. The following table lists the tools to install if a certain filesystem tools will be needed in the installed environment. {| class="table table-condensed table-striped" style="text-align: left;" |- style="background-color:#dddaec" ! scope=col width=20% | Filesystem ! Package |- | {{Link|XFS}} | {{Package|sys-fs/xfsprogs}} |- | {{Link|Ext4|ext4}} | {{Package|sys-fs/e2fsprogs}} |- | {{Link|VFAT}} (FAT32, ...) | {{Package|sys-fs/dosfstools}} |- | {{Link|Btrfs}} | {{Package|sys-fs/btrfs-progs}} |- | {{Link|F2FS}} | {{Package|sys-fs/f2fs-tools}} |- | {{Link|NTFS}} | {{Package|sys-fs/ntfs3g}} |- | {{Link|ZFS}} | {{Package|sys-fs/zfs}} |- | {{Link|Bcachefs|bcachefs}} | {{Package|sys-fs/bcachefs-tools}} |} It's recommended that {{Package|sys-block/io-scheduler-udev-rules}} is installed for the correct scheduler behavior with e.g. nvme devices: {{Emerge|sys-block/io-scheduler-udev-rules}} {{Tip|For more information on filesystems in Gentoo see the {{Link|Filesystem|filesystem article}}.}} == {{Anchor|Networking_tools}} Networking tools == If networking was previously configured in the {{HandbookLink|Installation/System|Configuring the system}} step and network setup is complete, then this 'networking tools' section can be safely skipped. In this case, proceed with the section on {{HandbookLink|Installation/Bootloader|Configuring a bootloader}}. === {{Anchor|Installing_a_DHCP_client}} Installing a DHCP client === {{Important|Most users will need a DHCP client to connect to their network. If none were installed, then the system might not be able to get on the network thus making it impossible to download a DHCP client afterwards without statically configuring an IP address.}} A DHCP client obtains automatically an IP address for one or more network interface(s) using netifrc scripts. We recommend the use of {{Package|net-misc/dhcpcd}} (see also {{Link|dhcpcd}}): {{Emerge|net-misc/dhcpcd}} === {{Anchor|Optional:_Installing_a_PPPoE_client}} Optional: Installing a PPPoE client === If PPP is used to connect to the internet, install the {{Package|net-dialup/ppp}} package: {{Emerge|net-dialup/ppp}} === {{Anchor|Optional:_Install_wireless_networking_tools}} Optional: Install wireless networking tools === If the system will be connecting to wireless networks, install the {{Package|net-wireless/iw}} package for Open or WEP networks and/or the {{Package|net-wireless/wpa_supplicant}} package for WPA or WPA2 networks. {{c|iw}} is also a useful basic diagnostic tool for scanning wireless networks. {{Emerge|net-wireless/iw net-wireless/wpa_supplicant}} Now continue with {{HandbookLink|Installation/Bootloader|Configuring the bootloader}}. {{#set:Has short Title=Installing tools|Has Title=Installing system tools}} {{Handbook:Parts/Navigator|Prev=Handbook:{{#ifeq: {{NAMESPACE}}|Translations|Parts|{{ROOTPAGENAME}}}}/Installation/System|Next=Handbook:{{#ifeq: {{NAMESPACE}}|Translations|Parts|{{ROOTPAGENAME}}}}/Installation/Bootloader}}