The Handbook

    Theme
    • Guides
        • Check a system before installing FreeBSD
        • Orient a Linux administrator on FreeBSD
        • Supported FreeBSD releases
        • Choose a FreeBSD documentation and support channel
        • Move files safely without GNU mv -t
        • Update and Upgrade FreeBSD
        • Upgrade 14.4 or 15.0 to FreeBSD 15.1
        • Choose packages, ports, or poudriere
        • Choose the quarterly or latest package branch
        • Choose a FreeBSD download or package mirror
        • Make a system setting persistent
        • Run a command from cron reliably
        • Configure locale, keyboard, and time zone
        • Configure a serial console for recovery
        • Choose a custom kernel, module, or loader setting
        • Run a Linux binary with the compatibility layer
        • Check desktop and laptop hardware before installation
        • Choose and check a graphics driver
        • Choose Xorg or Wayland
        • Build a maintainable desktop baseline
        • Install and check a desktop browser
        • Check laptop Wi-Fi, power, and suspend
        • Check multimedia readiness
        • Choose and configure a printing stack
        • Run Windows applications with Wine
        • Snapshot and replicate a ZFS dataset
        • Choose a filesystem and storage layout
        • Operate ZFS without losing the recovery path
        • Restore files from a ZFS snapshot
        • Find what is using ZFS space
        • Grow a ZFS virtual disk
        • Read ZFS pool health and run a scrub
        • Replace a failed device in a ZFS mirror
        • Replicate a ZFS dataset over SSH
        • Change PF safely on a remote host
        • Configure a narrow WireGuard tunnel
        • Share a directory with NFS
        • Share files with a named Samba account
        • Plan a FreeBSD home server
        • Choose a mail server or an outgoing relay
        • Publish a network service safely
        • Choose a jail network model
        • Choose native jails or a jail manager
        • Choose a jail or a bhyve virtual machine
        • Establish a FreeBSD security baseline
        • Choose a MAC policy
        • Audit security-relevant activity
        • Start a DTrace performance investigation
    • Integrations
        • Create a first jail with Bastille
        • Compare jail managers and OCI tooling
        • Publish a Bastille service through PF
        • Mount a ZFS dataset in a Bastille jail
        • Update and upgrade Bastille jails
        • Back up and restore a Bastille jail
        • Prepare bhyve and vm-bhyve
        • Choose NFS or Samba for file sharing
        • Choose ZFS backup automation
        • Build a first signed poudriere repository
        • Operate a signed poudriere repository
        • Manage FreeBSD configuration with Ansible or Salt
        • Run Motion with webcamd on FreeBSD
        • Design a reverse proxy, certificates, and monitoring
    • FAQ
      • Troubleshooting
          • Recover an interrupted freebsd-update run
          • Resolve a package repository or ABI mismatch
          • Diagnose the FreeBSD boot path
          • Recover with a ZFS boot environment
          • Diagnose DNS, routing, and firewall paths
          • Diagnose network mbuf exhaustion
          • Bind a service to a low port without running it as root
          • Diagnose a service that will not start
          • Diagnose audio output or input
          • Diagnose webcamd, cuse, and a webcam
          • Fix USB device permissions without opening every device
      • About this handbook
      • Synopsis
      • Find the service and its enable variable
      • Choose temporary or persistent startup
      • Check configuration and the listener
      • Inspect a process that exits
      • Primary references

      Diagnose a service that will not start

      Last reviewed
      7 November 2026
      Applies to
      15.1-RELEASE
      Tested on
      15.1-RELEASE

      Synopsis #

      Installing a package, enabling its service, and starting it are separate operations. A message asking to set an rc.conf variable usually means that startup is disabled, not that the package is broken. A process that starts and exits immediately needs a different investigation.

      The examples use an installed, configured nginx service. Substitute the actual service name and its documented configuration check for another application.

      Find the service and its enable variable #

      List available scripts and inspect the selected service:

      $ service -l
      # service nginx rcvar
      

      The rc script name and its enable variable need not match. Use the variable reported by rcvar; do not invent one from the package name. Packaged scripts normally live under /usr/local/etc/rc.d and package configuration under /usr/local/etc.

      Choose temporary or persistent startup #

      For a temporary test that leaves boot policy unchanged:

      # service nginx onestart
      # service nginx onestatus
      

      The one prefix bypasses the enable-variable check. It does not bypass configuration validation, permissions, an occupied port, or other application failures. Stop that temporary instance when finished:

      # service nginx onestop
      

      For startup now and on future boots:

      # sysrc nginx_enable=YES
      # service nginx start
      # service nginx status
      

      sysrc saves the setting; it does not start the process. Do not rely solely on a command’s exit status: an rc script can print a refusal to start while returning success. Read the message and verify process and application state.

      Check configuration and the listener #

      For nginx, validate before starting or reloading:

      # /usr/local/sbin/nginx -t
      

      Then inspect the actual sockets:

      # sockstat -4 -6 -l
      

      Confirm the intended address, port, and owning process. A listener bound only to loopback is unavailable to remote clients. A wildcard listener can expose more interfaces than intended. Use the application’s own request or health check; for a local nginx configured on its default HTTP port:

      $ fetch -o /dev/null http://127.0.0.1/
      

      If local requests succeed but remote requests fail, continue with DNS, routing, and firewall diagnosis . Reinstalling the package does not repair an upstream packet path.

      Inspect a process that exits #

      Read the application’s configured log and package messages:

      $ pkg info -D nginx
      # tail -n 50 /var/log/messages
      

      Check the configuration error, data-directory ownership, required mounts, dependencies, and port conflict before retrying. service uses a restricted startup environment, so a daemon that works when launched from an interactive shell may still depend on a missing path or environment variable. Put required settings in the application’s documented configuration or rc variables.

      After a controlled reboot, repeat the status and request checks. See Make a system setting persistent when the service works now but does not return at boot.

      Primary references #

      • service(8)
      • rc(8)
      • rc.conf(5)
      • sysrc(8)
      • FreeBSD Handbook: Managing Services

      Independent documentation. Not affiliated with or endorsed by the FreeBSD Project or the FreeBSD Foundation.

      Report a bug
      • Synopsis
      • Find the service and its enable variable
      • Choose temporary or persistent startup
      • Check configuration and the listener
      • Inspect a process that exits
      • Primary references