4. Post-Install

After the TrueOS® system has finished booting for the first time, TrueOS® presents additional screens to assist in configuring the system.

4.1. Booting Into TrueOS®

After installation, TrueOS® reboots and displays a boot menu. The first menu displayed depends on whether or not rEFInd is installed or the user customized the boot loader during the installation.

4.1.1. rEFInd Boot Manager

For EFI or UEFI systems, the user can choose to install rEFInd. This is a boot manager that is useful when Dual Booting. Figure 4.1.1 shows the initial rEFInd screen.

_images/refind1.png

Fig. 4.1.1 rEFInd Boot Manager

rEFInd displays any installed operating systems, booting into the default choice after a few seconds. Press any key other than Enter to pause automatic booting, then use the arrow keys to select the desired operating system. Press Enter to continue booting.

There are a number of options in rEFInd aside from choosing an operating system:

  • About rEFInd: This option displays the version and copyrights of rEFInd. It also shows the EFI Revision, Platform, Firmware, and Screen Output.
  • Shut Down Computer
  • Reboot Computer
  • Reboot to Computer Setup Utility: Not recommended for use with TrueOS®.

Additional boot options for an operating system are available by highlighting the OS and pressing F2 or Insert.

Once TrueOS® is chosen in rEFInd, the next boot screen displays.

4.1.2. BSD Boot Loader

A system with a default or “BSD” install option for the boot loader loads the boot menu seen in Figure 4.1.2.

Note

This menu is modified from the one seen when booting into the installer. While the options are the same, they are rearranged slightly to prevent confusion and unnecessary clutter.

_images/install4.png

Fig. 4.1.2 TrueOS® Boot Menu

This menu provides several options. Pause this menu by pressing any key except for Enter. To select an option, press either the bolded number or key for that option. Once any selections are made, press Enter to boot using the specified options.

  • 1. Boot TrueOS [Enter]: This is the default option for booting TrueOS®. The system automatically uses this option either after pausing for a moment or if Enter is pressed while the boot menu is displayed.
  • 2. Configure Boot Options: Press either 2 or o to see the boot options screen, shown in Figure 4.1.3. To change an option, press either the bolded number or key for the option to toggle through its available settings. When finished, press either 1 or Backspace to return to the TrueOS® boot menu.
  • 3. Select Boot Environment: In TrueOS®, boot environments are automatically created when the system updates. They can also be manually created using the Boot Environment Manager. This allows the system to boot to the point of time before an update occurred and can be used to recover from a failed update. Press either 3 or e to view the available boot environments.

Tip

The first time the system boots, no additional environments are available. This menu populates as boot environments are created.

_images/boot1c.png

Fig. 4.1.3 Boot Options Menu

Several boot options are available in the Boot Options Menu:

  • 3. Boot Single User: Advanced users can select this option to fix critical system failures.
  • 4. Verbose: Select this option to see more detailed messages during the boot process. This can be useful when troubleshooting a piece of hardware.
  • 5. Kernel: This option indicates how many kernels are available. Press either 5 or k to toggle between available kernels. This option is available to the user if they have created a custom kernel, but wish to have a kernel.old boot option available in case the custom primary kernel fails.
  • 6. Escape to loader prompt: Advanced users can select this option to perform advanced operations, such as loading kernel modules.

4.1.3. Encrypted Disks

If Encrypt disk with GELI was selected during installation, physical access to the TrueOS® system when it boots is required. As the system starts to boot, it displays a message similar to the one shown in Figure 4.1.4.

_images/encrypt1.png

Fig. 4.1.4 Master Key Decryption

The boot process will wait for the password created in the installation screen shown in Configure Encryption. If the correct password is typed, the system calculates the GELI encryption key then continues to boot.

4.2. Display Detection

When booting for the first time, TrueOS® shows a Display Settings screen, reproduced in Figure 4.2.1.

_images/display3a.png

Fig. 4.2.1 Display Settings

Use this screen to view the detected video card and choose a graphics driver from the expanding menu. TrueOS® also suggests a driver.

The vesa driver always works but provides sub-optimal performance. Click on the drop-down menu to select the driver most closely matching your video card name.

When finished, click Apply for the settings to be tested. If anything goes wrong during testing, the system returns to the Display Settings screen in order for the user to select another driver. Once satisfied with the settings, click Yes when prompted to accept them.

Note

The Advanced tab is disabled and scheduled for removal.

4.3. Choose a Language

Figure 4.3.1 shows the language selection screen.

_images/config1a.png

Fig. 4.3.1 Language Selection

This allows for the selection of the language used to access the installed system. It also contains three icons from the installer screens to enable:

  • Light Bulb: Reading the screen’s Help text.
  • Keyboard: Use the onscreen keyboard.
  • Key with US and Brazilian Flag: Choose a different keyboard layout other than the default US style.

Once the selection is made, click Next to move to the next configuration screen.

4.4. Time Zone Selection

The timezone select screen, shown in Figure 4.4.1, allows selection of the timezone and configuring the system’s host and domain names.

_images/config2c.png

Fig. 4.4.1 Time Zone Selection

Use the drop-down menu to select the city closest to the system’s location. If the system is connected to the Internet, the installer automatically attempts to detect the correct timezone.

If the system is dual booting and the other operating system expects the BIOS to use UTC, also check Set BIOS to UTC time.

A default system hostname is created. Change the name by typing the desired hostname in the System Hostname field. If the computer is a member of a DNS domain, the Domain Name is also an option.

When finished, click Next to proceed to the next screen.

4.5. Set the Root Password

This screen, seen in Figure 4.5.1, requires setting the root (administrative) password.

_images/config3b.png

Fig. 4.5.1 Root Password Creation

The password must be a minimum of 4 characters and typed twice to confirm the password. Try to create a complex, but memorable password, as this is used whenever the system indicates administrative access is required. Click Next when finished.

4.6. Create a User

This screen is used to create the primary user account used to login to the system.

Figure 4.6.1 shows the configuration screen used to create the initial user account.

_images/config4b.png

Fig. 4.6.1 User Creation

The User Details tab is used to create a login user. This screen requires completing several fields:

  • Name: This value displays in the login screen. It can be the user’s full name and can contain both capital letters and spaces.
  • Username: This is the name used when logging in. It can not contain spaces and is case sensitive (e.g. Kris is a different username from kris).
  • Password: This is the password to use when logging in. It must be typed twice for confirmation.
  • Specify UID: By default, the user is assigned the next available User ID (UID). If a specific UID is required, it can be set here. A UID can not be set lower than 1001, and a UID already in use by another account is also unavailable.

TrueOS® provides the ability to use a removable device, such as a USB stick, as the user’s encrypted home directory. This is useful in a multi-user or multi-computer environment, as it provides the user with secure access to their encrypted files. When a user initializes PersonaCrypt with their account, their username only appears in the login menu if the removable media associated with that TrueOS® system is inserted. They must input the password associated with the removable device in order to log in.

When a user is configured to use a PersonaCrypt device, that user cannot log in using an unencrypted session on the same system. In other words, the PersonaCrypt username is reserved only for PersonaCrypt use. If necessary to login to both encrypted and unencrypted sessions on the same system, create two different user accounts; one for each type of session.

Note

Encryption is also possible without requiring removable devices using PEFS. Refer to the SysAdm handbook section on PEFS Encryption for more detailed instructions to initialize a user with PEFS.

Figure 4.6.2 shows the PersonaCrypt tab. This is used to initialize PersonaCrypt for the user.

_images/persona1a.png

Fig. 4.6.2 User’s PersonaCrypt Initialization

Check Initialize PersonaCrypt Device, insert a removable media device large enough to hold a user’s home directory, then click Select.

Warning

Ensure there are no desired files on the removable media. Initializing the media for PersonaCrypt formats the device with ZFS and then encrypts it with GELI, deleting any existing data.

Input and repeat the Device Password to associate with the device. A pop-up window indicates the current contents of the device will be wiped. Click Yes to initialize the device.

To share the computer with other users, create additional login and PersonaCrypt accounts using the SysAdm User Manager. After creating at least one user, click Next to continue.

4.7. Configure Audio Output

Figure 4.7.1 shows the Audio Output screen, where you can choose the output device and test it.

_images/audio1b.png

Fig. 4.7.1 Configure Audio Output

Click the Output Device drop-down menu to select the desired sound device. Click Test to verify the setting. If the device works, a test sound plays. The Testing Volume slider is also used to set the default system volume level.

All these settings can be viewed and edited at any time using the instructions in Sound Mixer Tray.

4.8. Connect to a Wireless Network

Note

The network card must be supported by FreeBSD. Refer to Supported Hardware for links to FreeBSD support and a list of known issues with different hardware.

If the system has an active wireless interface, a screen similar to Figure 4.8.1 indicates which wireless networks are automatically detected. Available networks are ordered by signal strength.

_images/config5a.png

Fig. 4.8.1 Wireless Network Connections

To set the default wireless connection, click the desired network in the Available Wireless Networks area. If the network requires a password, a window appears requesting the password and indicating the security type used by the desired network. If the desired network is not visible in the Available Wireless Networks area, click Rescan. If unable to connect or to configure the connection later, refer to Network Manager for more detailed instructions.

4.9. Enable Optional Services

Figure 4.9.1 shows a few optional system services you can toggle.

_images/config6a.png

Fig. 4.9.1 Optional Services

Check Disable IPV6 (Requires Reboot) to reconfigure the system to only support IPv4 addresses. By default, the system supports both IPv4 and IPv6, and IPv6 is preferred over IPv4.

Tip

Altering this setting does not take affect until the next system reboot.

Enable Intel HDA polling enables the audio driver polling mode. It is used in TrueOS® to support additional Intel audio devices that would not function without polling. However, it is recommended to not enable unless you are having extensive audio device issues, or your Intel device requires polling mode enabled. See the FreeBSD Manual Page for more details.

Enable Realtek Wireless activates the Realtek wireless networking drivers.

If Enable SSH is checked, the SSH service both starts immediately and is configured to start on system boot. This option also creates the firewall rules needed to allow incoming SSH connections to the TrueOS® system.

Danger

Do not check this box if SSH connections to the system are undesired.

Enable Verbose Boot is the same option as in Boot Options Menu. Select this option to see more detailed messages during the boot process. This can be useful when troubleshooting a piece of hardware.

When finished choosing optional services, click Next. The screen in Figure 4.9.2 indicates the post-installation setup is complete. Click Finish to access the login menu.

_images/config7a.png

Fig. 4.9.2 Setup Complete

4.10. Logging In

Once finished setting up the system, the PCDM (PC-BSD® Display Manager) graphical login screen displays. An example is seen in Figure 4.10.1.

_images/login1.png

Fig. 4.10.1 TrueOS® Login

The hostname of the system is displayed at the top of the login window. In this example, it is trueos-5026. This login screen has several configuration options:

  • User: Upon first login, the created username (from Create a User) is the only available login user. If additional users are created using the SysAdm User Manager, they are added to the drop-down menu for more login choices. PCDM does not allow logging in as the root user. Instead, whenever a utility requires administrative access, TrueOS® asks for the password of the login account.
  • Password: Input the password associated with the selected user.
  • Desktop: If any additional desktops are installed using AppCafe, use the drop-down menu to select the desktop to log into.

Note

If a PersonaCrypt user is active, insert the PersonaCrypt device in order to log in. As seen in Figure 4.10.2, this adds an extra field to the login screen so the password associated with the PersonaCrypt device can be typed.

_images/login5.png

Fig. 4.10.2 TrueOS® PersonaCrypt Login

The toolbar across the bottom of the screen allows several options to be selected on a per-login basis:

  • Locale: If the localization was not set during installation, or needs to be changed, click this icon to set the locale for this login session.
  • Keyboard Layout: Click this icon to change the keyboard layout for this login session. This opens the window seen in Figure 4.10.3.
_images/keyboard1.png

Fig. 4.10.3 Keyboard Settings

Click the Keyboard model drop-down menu to select the type of keyboard.

Note

The default model of Generic 104-key PC does not support special keys such as multimedia or Windows keys. Choose another model to enable support for hot keys.

This screen also allows selection of the Key Layout and Variant. After making any selections, test them by typing some text into the you may type into the space below... field.

Tip

It is possible to change keyboard layouts during an active desktop session using the included fcitx utility

  • Restart/Shut Down: To restart or shutdown the system without logging in, click the Power Button icon in the lower-right corner of the screen. This icon also allows you to Change DPI, Refresh PCDM, and Change Video Driver.

Once any selections are made, input the password associated with the selected user and press Enter or click the blue arrow to login.

4.11. Updating TrueOS

The TrueOS project is organized around two update tracks: STABLE and UNSTABLE. Updating is handled through the SysAdm Update Manager; refer to the SysAdm Update Manager documentation for more details about using the Update Manager. This section only contains simple instructions to switch between update tracks.

To view or adjust the current update track for TrueOS, click Start Menu Control Panel Update Manager Settings. The Settings tab, seen in Figure 4.11.1, allows you to adjust when and where to perform system updates.

_images/update1.png

Fig. 4.11.1 Update Manager Settings

While both STABLE and UNSTABLE tracks are rolling releases based on FreeBSD-CURRENT, there are a few key differences between them.

Warning

Users with UNSTABLE installed before 7/14/2017 need to run pc-updatemanager syncconf in a command line in order to switch to the new UNSTABLE repository added on that day. Alternately, switch from UNSTABLE to STABLE in the Update Manager and click Save. Then, switch back to UNSTABLE and click Save again.

4.11.1. TrueOS STABLE

As its name implies, STABLE refers to the more solid version of TrueOS. STABLE updates are released infrequently, but are much more tested and polished. All TrueOS installation files are created from the STABLE track, and fresh TrueOS installations only look to the STABLE track for updates.

The STABLE track is recommended for those users who want a more predictable experience with fewer regressions, and are willing to wait longer for bugfixes and new utilities or ports.

4.11.2. TrueOS UNSTABLE

The UNSTABLE track is the bleeding edge of TrueOS development. Experimental fixes, upstream patches from the FreeBSD project, and testing new utilities and applications all happen first with the UNSTABLE track.

UNSTABLE is recommended for power users, those with custom hardware unsupported with STABLE, and project contributors who wish to help test patches committed to TrueOS and/or FreeBSD-CURRENT.

To switch to the UNSTABLE track, open the SysAdm Update Manager and navigate to the Settings tab, seen in Update Manager Settings. Check UNSTABLE Repository, then click Save Settings.

Alternately, you can edit /usr/local/etc/trueos.conf to change update tracks without using SysAdm. Here is an example trueos.conf:

# TrueOS Configuration Defaults

# Default package set to pull updates from
PACKAGE_SET: <STABLE, UNSTABLE, or CUSTOM>
PACKAGE_URL: <CUSTOM url>

# Default type of CDN to use
# IPFS - Use IPFS
# HTTP - Use a standard HTTP connection (default)
# CDN_TYPE: HTTP

# Set the number of automatic boot-environments to create / keep
MAXBE: 5
AUTO_UPDATE: disabled
AUTO_UPDATE_REBOOT: disabled

Rolling back from UNSTABLE to STABLE is done by switching tracks back to the STABLE branch, checking for updates, and rebooting once the previous STABLE update is installed.

4.12. Managing System Services and Daemons

TrueOS® now uses OpenRC to manage system services. OpenRC is an integral component of the TrueOS® operating system, and is a major point of difference between TrueOS® and FreeBSD. This section is intended to provide detailed information about system service management in TrueOS®.

4.12.1. OpenRC in TrueOS® compared with rc

Table 4.12.1 serves as a quick summary and series of working examples contrasting the FreeBSD rc system and OpenRC in TrueOS®.

Table 4.12.1 Comparison between the FreeBSD rc and TrueOS® OpenRC service management
Component or action FreeBSD TrueOS®
Base system rc script location /etc/rc.d /etc/init.d
Ports rc script location /usr/local/etc/rc.d /usr/local/etc/init.d
Service configuration

/etc/rc.conf or /etc/rc.conf.local

All services are configured in a central location.

OpenRC prefers /etc/conf.d/servicename, but can use /etc/rc.conf or /etc/rc.conf.local Each service has its own configuration file.
Starting e.g. the nginx service $ service nginx start $ service nginx start
Configuring e.g. nginx to start on bootup. Edit /etc/rc.conf and add nginx_enable="YES" $ rc-update add nginx default
Check to see if a service is enabled.

$ service nginx rcvar

If the service is enabled, the result is:

nginx_enable="YES"

$ rc-update show default | grep nginx

If the service is enabled, the result is:

nginx | default

Warning

The user may find leftover RC files during the TrueOS® migration to OpenRC. These files do not work with OpenRC and are intended to be removed both from the source tree and via pc-updatemanager when all functionality is successfully migrated. If discovered, do not attempt to use these leftover files.

4.12.2. Service Management in OpenRC

4.12.2.1. Runlevels

Traditionally, FreeBSD operates in single- and multi-user modes. However, OpenRC offers the ability to define runlevels. An OpenRC runlevel is a grouping of services, nothing more. Any number of system services can be associated with a given runlevel. In TrueOS®, there are two main preconfigured runlevels: boot and default. The default runlevel is analogous to the FreeBSD multi-user mode, and is associated with the Normal Bootup option of the TrueOS® bootloader.

Note

No OpenRC runlevels are executed if the system is booted into single-user mode (see Figure 4.1.3.)

Runlevels are defined by subdirectories of /etc/runlevels; all associations between services and runlevels can be shown by running the command:

$ rc-update show -v

OpenRC has a few ordered runlevels in TrueOS®. In order of execution:

  1. sysinit: Used for OpenRC to initialize itself.
  2. boot: Starts most base services from /etc/init.d/.
  3. default: Services started by ports are added here.

Note

Services added by ports cannot be added to boot or sysinit.

OpenRC allows users to add services in the prefix location to the boot runlevel. These services are started before the /usr filesystem is mounted. Finally, there is a shutdown runlevel reserved for a few services like savecore or pc-updatemanager, which installs updates at shutdown.

When a service is added to a runlevel, a symlink is created in /etc/runlevels. When a service is started, stopped, or changed to another state, a symlink is added to /libexec/rc/init.d/, as seen in this example:

[tmoore@Observer] ~% ls /libexec/rc/init.d/
daemons exclusive inactive scheduled starting wasinactive
depconfig failed options softlevel stopping
deptree hotplugged prefix.lock started tmp

4.12.2.2. Services and Runlevels

OpenRC includes options to start, stop, add, or delete services from runlevels as seen in Table 4.12.2. Most of these actions can be accomplished using the Service Manager built into SysAdm. Individuals familiar with the FreeBSD service command may notice some similarities between some of these commands.

Table 4.12.2 Service and Runlevel Management Commands
Command Description
service nginx start Start nginx from /usr/local/etc/init.d/nginx.
service nginx restart Restart nginx from /usr/local/etc/init.d/nginx.
service nginx stop Stop nginx from /usr/local/etc/init.d/nginx.
service nginx status View the status of the nginx service.
rc-status View the status of all running services.
rc-update Views all runlevels. Used in conjunction with service names to add or delete services from the default runlevel.
rc-update add nginx default Adds the nginx service to the default runlevel.
rc-update delete nginx default Removes nginx from the default runlevel.

4.12.2.3. Writing OpenRC Services

OpenRC has a dependency based init system. As an example, examine the SysAdm service, which needs network. Here are the contents of the /usr/local/etc/init.d/sysadm depend section:

depend() {
need net
after bootmisc
keyword -shutdown
}

SysAdm requires network (need net), which is the nickname of the /etc/init.d/network service defined by provide in network. SysAdm also starts after bootmisc. If you don’t want the restarting network to restart SysAdm, then net is unnecessary. To start SysAdm after network, then add network to the actual name of the script in **after bootmisc*.

Here are the contents of /etc/init.d/network:

depend()
{
provide net
need localmount
after bootmisc modules
keyword -jail -prefix -vserver -stop
}

The provide option sets the service nickname to net. Need means restarting localmount restarts network. After indicates the service starts after bootmisc and modules. For example, the keyword -jail option says this service doesn’t run in a jail, prefix, or any of the other options shown.

There is also a cache directory under /libexec/rc. This keeps a dependencies cache that is only updated when those dependencies change. Several other directories exist for other binaries and special binaries used by OpenRC functions.

For more creation options for OpenRC compatible init scripts, type man openrc-run in a CLI.

4.12.3. RC Defaults

Note

RC Defaults are subject to change during development.

TrueOS® and FreeBSD now have very different rc defaults.

TrueOS OpenRC Defaults

The entire TrueOS rc.conf file is viewable on GitHub.

# Global OpenRC configuration settings

# Set to "YES" if you want the rc system to try and start services
# in parallel for a slight speed improvement. When running in parallel
# we prefix the service output with its name as the output will get
# jumbled up.
# WARNING: whilst we have improved parallel, it can still potentially
# lock the boot process. Don't file bugs about this unless you can
# supply patches that fix it without breaking other things!
#rc_parallel="NO"

# Set rc_interactive to "YES" and you'll be able to press the I key
# during boot so you can choose to start specific services. Set to "NO"
# to disable this feature. This feature is automatically disabled if
# rc_parallel is set to YES.
#rc_interactive="YES"

# If we need to drop to a shell, you can specify it here.
# If not specified we use $SHELL, otherwise the one specified in
# /etc/psswd, otherwise /bin/sh

FreeBSD RC Defaults

The entire FreeBSD rc.conf file is available online.

#!/bin/sh

# This is rc.conf - a file full of useful variables that you can set
# to change the default startup behavior of your system.  You should
# not edit this file!  Put any overrides into one of the
# ${rc_conf_files} instead and you will be able to update these
# defaults later without spamming your local configuration information.
#
# The ${rc_conf_files} files should only contain values which override
# values set in this file.  This eases the upgrade path when defaults
# are changed and new features are added.
#
# All arguments must be in double or single quotes.
#
# For a more detailed explanation of all the rc.conf variables, please
# refer to the rc.conf(5) manual page.
#
# $FreeBSD$

##############################################################

The TrueOS® rc.conf file is smaller because rc.conf is now primarily used for tuning OpenRC behavior. By default, TrueOS® uses 3 elements, documented in Table 4.12.4.

Table 4.12.3 lists services and their default runlevels in TrueOS®.

Table 4.12.3 Services and runlevels
Service Runlevel
abi boot
adjkerntz boot
automount default
bootmisc boot
bridge boot
cron boot
cupsd default
dbus default
devd boot
dumpon boot
fsck boot
hostid boot
hostname boot
ipfw boot
local default nonetwork
localmount boot
lockd default
loopback boot
modules boot
motd boot
moused default
netmount default
network boot
newsyslog boot
openntpd default
pcdm default
root boot
rpcbind default
savecache shutdown
savecore boot
statd default
staticroute boot
swap boot
sysadm default
syscons boot
sysctl boot
syslogd boot
trueosinit default
urandom boot
zfs boot
zvol boot

4.12.4. Tuneables

Table 4.12.4 OpenRC Primary Tunables
Tunable Description
rc_parallel=”YES” Starts all services in parallel (experimental).
rc_logger=”YES” Enables logging
rc_log_path=”/var/log/rc.log” Defines the location for logging rc activity

Table 4.12.5 shows all other tunables enabled on a clean TrueOS® installation. Many of these tunables continue to work in /etc/rc.conf to ensure a smoother migration for existing users to upgrade. The eventual target locations for these services are also listed.

Note

These migration targets are estimates and subject to change.

Table 4.12.5 OpenRC Other Tunables
Tunable Description Migration Target
linux_enable=”YES” Notifies /etc/init.d/abi service to enable the Linux compatability during boot /etc/conf.d/abi
ifconfig_re0=”DHCP” Auto-obtain IP address on the re0 device. /etc/conf.d/network
ifconfig_re0_ipv6=”inet6 accept_rtadv” Configure IPv6. /etc/conf.d/network
hostname=”trueos-4843” Set the system hostname. /etc/conf.d/hostname
kldload_i915kms=”i915kms” TrueOS specific. Allows loading an individual module via the installer post installation. etc/conf.d/modules
zfs_enable=”YES” Obsolete, marked for removal None
wlans_iwm0=”wlan 0 DHCP” Configure iwm wireless with DHCP. /etc.conf.d.network
ifconfig_wlan0_ipv6=”inet6 accept_rtadv” Configure iwm wireless with IPv6. /etc.conf.d.network

4.12.5. OpenRC Install Scripts

There are number of scripts used for older TrueOS® systems and new installations. These are listed below.

4.12.5.1. One-time Migration Script

A one time migration script is available for TrueOS® installations dated 10-28-16 or older still using the legacy FreeBSD rc system:

Note

This block is truncated from the original file

#!/bin/sh

if [ ! -e /etc/rc.conf ] ; then
  exit 0
fi

. /etc/rc.conf

for var in `set | grep "_enable="`
do
  key=`echo $var | cut -d '=' -f 1 | sed 's|_enable||g'`
  val=`echo $var | cut -d '=' -f 2`
  if [ "$val" != "YES" ] && [ "$val" != "NO" ] ; then continue; fi
  if [ "$val" = "NO" ] && [ -e "/etc/runlevels/default/$key" ] ; then
      echo "Deleting OpenRC service for $key to default runlevel..."
      rc-update delete $key default
  fi
  if [ -e "/etc/init.d/$key" -o -e "/usr/local/etc/init.d/$key" ] ; then
    if [ -e "/etc/runlevels/default/$key" ] ; then
      echo "OpenRC service for $key already enabled, skipping.."

With this migration, rc.conf.trueos, located in /etc/, has been phased out of TrueOS® and is automatically removed from legacy installs dated 10-28-16 and older by pc-updatemanger:

This script defines a list of services such as PCDM designated to boot by default on a desktop. It also defines what drivers to load on a desktop. This is now accomplished when the trueos-desktop or trueos-server package is installed using sysrc or other methods. Now there is no need to keep an extra overlay file to accomplish this behaviour.

4.12.5.2. TrueOS® Desktop pkg-install Script

Note

This is an excerpt from the TrueOS® Desktop pkg-install file, available online: https://github.com/trueos/trueos-desktop/blob/master/port-files/pkg-install

#!/bin/sh
# Script to install preload.conf

PREFIX=${PKG_PREFIX-/usr/local}

if [ "$2" != "POST-INSTALL" ] ; then
   exit 0
fi

# If this is during staging, we can skip for now
echo $PREFIX | grep -q '/stage/'
if [ $? -eq 0 ] ; then
   exit 0
fi

# REMOVEME - Temp fix to ensure i915kms is loaded on upgraded systems
# 8-29-2016
if [ -e "/etc/rc.conf.trueos" ] ; then
  set +e
  grep -q "i915kms" /etc/rc.conf.trueos

4.12.5.3. TrueOS Server pkg-install script

Note

This is an excerpt from the TrueOS® Server pkg-install file, available on GitHub: https://github.com/trueos/trueos-server/blob/master/port-files/pkg-install

#!/bin/sh
# Script to install preload.conf

PREFIX=${PKG_PREFIX-/usr/local}

if [ "$2" != "POST-INSTALL" ] ; then
   exit 0
fi

# If this is during staging, we can skip for now
echo $PREFIX | grep -q '/stage/'
if [ $? -eq 0 ] ; then
   exit 0
fi

# Copy over customizations for TrueOS
  install -m 644 ${PREFIX}/share/trueos/conf/loader.conf.trueos /boot/loader.conf.trueos
  install -m 644 ${PREFIX}/share/trueos/conf/brand-trueos.4th /boot/brand-trueos.4th
  install -m 644 ${PREFIX}/share/trueos/server-defaults/etc/conf.d/modules /etc/conf.d/modules/

The typical nginx_enable=”YES” is no longer used to enable services. Instead, rc-update adds or deletes services from runlevels. The one time migration script automatically adds previously defined user services to the OpenRC default runlevel. Leftover lines can be removed after migration.

4.12.6. Updating a Port’s Makefile

There are many required updates to adjust each port’s Makefile to the new format, USE_OPENRC_SUBR=. However, these are to be changed only when each service file has the new OpenRC ready format:

Note

This is an excerpt from the TrueOS® openrc-dbus.in file, which is available on the TrueOS® freebsd-ports GitHub repository

#!/sbin/openrc-run
# Copyright (c) 2007-2015 The OpenRC Authors.
# See the Authors file at the top-level directory of this distribution
# and https://github.com/OpenRC/openrc/blob/master/AUTHORS
#
# This file is part of OpenRC. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution and at
# https://github.com/OpenRC/openrc/blob/master/LICENSE.
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.

command=/usr/local/bin/dbus-daemon
pidfile=/var/run/dbus/pid
command_args="${dbusd_args---system}"
name="Message Bus Daemon"

depend()
{
        need localmount
        after bootmisc
}

Here is an example from FreeBSD of dbus using the legacy rc script format:

Note

This is an excerpt from the legacy FreeBSD dbus.in file, which is available online: https://github.com/freebsd/freebsd-ports/blob/master/devel/dbus/files/dbus.in

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: dbus
# REQUIRE: DAEMON ldconfig
#
# Add these lines to /etc/rc.conf to enable the D-BUS messaging system:
#
# dbus_enable="YES"
#

. /etc/rc.subr
. %%GNOME_SUBR%%

dbus_enable=${dbus_enable-${gnome_enable}}
dbus_flags=${dbus_flags-"--system"}

name=dbus
rcvar=dbus_enable

Several developers are working on the thousands of instances as quickly as possible. Anyone can begin transitioning to defining all service configurations in /etc/conf.d/, if desired. All configuration files should reside in that directory with the name of the service for the configuration file itself. For example, nginx is /etc/conf.d/nginx.

Generally, usage of /etc/rc.conf is minimized. Tweaking the default OpenRC configuration parameters is recommended only for advanced users. It is still possible to use service configurations through /etc/rc.conf, but this file is unusable for enabling or disabling services for startup.