Introduction explained the basic usage procedure of FuguIta.
In this chapter, we will introduce more advanced usage that takes advantage of the features of FuguIta.

[Memo]
This chapter assumes that you continue to use the environment set in Introduction as follows:

  • Assuming fugu-demo.localnet as hostname
  • ready to access internet
  • General user yoshi is created. Since yoshi also belongs to the wheel group, he can become root.

Manage OpenBSD

Add application software

FuguIta can add various software in addition to the software provided by OpenBSD.

The easiest way to add software is to use OpenBSD's ports/packages system.
To add software for packages, run the command pkg_add as root. As an example, here is an example of installing Mozilla Firefox, a web browser.

fugu-demo$ su -
Password:
fugu-demo# pkg_add firefox
quirks-4.53 signed on 2021-12-19T13:27:04Z
quirks-4.53:(ok)
firefox-95.0.1:libiconv-1.16p0:(ok)
firefox-95.0.1:gettext-runtime-0.21p1:(ok)
    :
    略
    :
firefox-95.0.1:dconf-0.40.0:(ok)
firefox-95.0.1:gtk+3-3.24.30:(ok)
firefox-95.0.1:(ok)
Running tags:ok
The following new rcscripts were installed: /etc/rc.d/messagebus
See rcctl for details.
New and changed readme(s):
        /usr/local/share/doc/pkg-readmes/dbus
        /usr/local/share/doc/pkg-readmes/firefox
        /usr/local/share/doc/pkg-readmes/glib2
        /usr/local/share/doc/pkg-readmes/gtk+3
fugu-demo# exit
fugu-demo$

In the above example, we temporarily became root using the su command. Of course, you can log out of yoshi, log back in as root, and execute pkg_add there. Executing pkg_add will also add other software required to run the target application. In the firefox example above, these are libiconv, gettext-runtime, dconf, gtk+3, etc. It is displayed that there is a document about the installed software under the directory /usr/local/share/doc/pkg-readmes, so it is a good idea to read it.

Applications can be added in a manner similar to the example above.
See https://ftp.jaist.ac.jp/pub/OpenBSD/7.2/packages/amd64/ with a web browser to see what software can be pkg_added from ports/packages.

[Memo]
The ports/packages system is explained in detail at https://www.openbsd.org/faq/faq15.html. Also, in the above example, we used ftp.jaist.ac.jp as the download source, but there are other download sites, and you can see the list at https://www.openbsd.org/ftp.html. increase.
It is also possible to directly compile and install the source code released by the software developer without using ports/packages, so-called "stray build".

On FuguIta, the software added by pkg_add is also subject to data save/restore by the usbfadm command.

Server setting example - change the NTP server that refers to the time

NTP (Network Time Protocol) is a protocol (communication protocol) for synchronizing the time of each computer while communicating on the network.
OpenBSD has a function to synchronize its own time with the time reference on the Internet using NTP, and this function can also be used in FuguIta.

OpenBSD configures whether to use NTP during installation. On the other hand, FuguIta has this feature enabled by default.

The NTP function is implemented by the program ntpd, and to see the operating status of ntpd, execute the command ntpctl increase.

[Memo]
The NTP software used by OpenBSD is called ``OpenNTPD'' and was created by the OpenBSD developers.
Linux and FreeBSD use different implementations of the same ntpd.

$ ntpctl -s status
4/4 peers valid, constraint offset 0s, clock synced, stratum 3

If "clock synced" is displayed as in the above example, ntpd communicates with the external NTP server that serves as the time reference, and as a result, you can see that the time is synchronized. on the other hand,

$ ntpctl -s status
0/1 peers valid, clock unsynced

If it is "clock unsynced" like this, the time has not been synchronized for some reason.

On OpenBSD, if the NTP function is enabled during installation, it will refer to a group of servers called pool.ntp.org as the time reference, and FuguIta's settings follow that.

On corporate LANs, etc., communication with external NTP servers such as pool.ntp.org may not be possible due to security concerns. In such a case, if an NTP server is operated on the company LAN, the local host's time can be kept accurate by referring to that server.

Here is how to configure the NTP server;

ntpd is configured by the file /etc/ntpd.conf, so edit ntpd.conf with root privileges.

$ doas -s
Password:
# vi /etc/ntpd.conf
 ntpd.conf内のこの3行を
  ↓
servers pool.ntp.org
sensor *
constraints from "https://www.google.com"
  ↓
 以下の一行に変更
  ↓
server ntp.localnet

In the above example, the settings are changed to refer to the NTP server "ntp.localnet".

After editing the configuration file, restart ntpd to reflect the changes.
A program like ntpd that runs in the background and provides services is called a daemon in Unix, but OpenBSD uses the command rcctl to operate the daemon can.

# rcctl restart ntpd
ntpd(ok)
ntpd(ok)
# 

Since the setting change work is completed above, return to the general user from root. After that, monitor the behavior of ntpd with ntpctl.

# exit
$ ntpctl -s status
1/1 peers valid, clock unsynced

If it looks like the above, it is not synchronized (yet), but you can see that one peer (peer, referring NTP server) is valid.

$ ntpctl -s status
1/1 peers valid, clock synced, stratum 3

After a while, it was confirmed that the time was synchronized.

ntpctl can also display the state of ntpd in more detail. Inaddition, ntpd itself leaves operation records in log files such as/var/log/daemon and /var/log/messages.
For details, refer to the manual page of each command and configuration file.

[Memo]
ntpd corrects the time drift very slowly. This is because a sudden big change in the time may adversely affect the operation of the system. Therefore, if the time difference is large, it may take a long time to synchronize.

Change OS settings

In the previous section, How to change the NTP server settings.

This section describes the configuration of services running on OpenBSD. Because it's not realistic to give a detailed description of every configuration method, I'll divide the configuration into categories and explain each of those categories.



Front page   New Page list Search Recent changes   Help   RSS of recent changes