RC script daemon fails if PID set

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
Hi,

I have a Jail running FreeBSD 13.1-RELEASE-p9 attempting to get HomeAssistant to run natively. It actually works now if I start it manually (painful, but hey ho). However, I can't for the life of me get the RC script to start it as a daemon.

I've tried two versions of the RC script, one that is more fully featured and one that was as simple as I could get it. And in both cases, what it seems to me, is that as soon as I add the `-P` and/or `-p` flags to `daemon` to record a PID, it just fails silently on startup. No log messages or output, just the daemon doesn't start. If I take both the PID flags off then the daemon will start correctly, but the RC script won't know it's running and can't stop it (obviously). I've tested this just invoking `daemon` from the command line with the same arguments too - same results.

It's driving me mad. What am I missing? Is there output being logged somewhere I can't find?

Simple script:

Code:
#!/bin/sh
#
# https://github.com/tprelog/iocage-homeassistant/blob/master/overlay/usr/local/etc/rc.d/homeassistant
#
# PROVIDE: homeassistant
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# homeassistant_enable: Set to YES to enable the homeassistant service.
#       Default: NO
#
# homeassistant_user: The user account used to run the homeassistant daemon.
#       This is optional, however do not specifically set this to an
#       empty string as this will cause the daemon to run as root.
#       Default:  "homeassistant"
#
# homeassistant_group: The group account used to run the homeassistant daemon.
#       Default:  "homeassistant"
#
# homeassistant_config_dir: Directory where the homeassistant `configuration.yaml` is located.
#       Default:   "$HOME/.homeassistant"
#       Change:    `sysrc homeassistant_config_dir="/usr/local/etc/homeassistant"`
#       Reset to default: `sysrc -x homeassistant_config_dir`
#
# homeassistant_venv: Directory where the homeassistant virtualenv is located.
#       Default:  "/usr/local/share/homeassistant"
#       Change:    `sysrc homeassistant_venv="/srv/homeassistant"`
#       Reset to default: `sysrc -x homeassistant_venv`

# -------------------------------------------------------
# Copy this file to '/usr/local/etc/rc.d/homeassistant'
# `chmod +x /usr/local/etc/rc.d/homeassistant`
# `sysrc homeassistant_enable=yes`
# `service homeassistant start`
# -------------------------------------------------------

. /etc/rc.subr
name=homeassistant
rcvar=${name}_enable

pidfile_child="/var/run/${name}.pid"
pidfile="/var/run/${name}_daemon.pid"
logfile="/var/log/${name}.log"

load_rc_config ${name}
: ${homeassistant_enable:="NO"}
: ${homeassistant_user:="homeassistant"}
: ${homeassistant_group:="homeassistant"}
: ${homeassistant_config_dir:="/home/homeassistant/.homeassistant"}
: ${homeassistant_venv:="/usr/local/share/homeassistant"}
: "${homeassistant_restart_delay:=1}"

command="/usr/sbin/daemon"

start_precmd=${name}_prestart
homeassistant_prestart() {

  install -g ${homeassistant_group} -m 664 -o ${homeassistant_user} -- /dev/null "${logfile}" \
  && install -g ${homeassistant_group} -m 664 -o ${homeassistant_user} -- /dev/null "${pidfile}" \
  && install -g ${homeassistant_group} -m 664 -o ${homeassistant_user} -- /dev/null "${pidfile_child}" \
  || return 1

  if [ ! -d "${homeassistant_config_dir}" ]; then
    install -d -g ${homeassistant_group} -m 775 -o ${homeassistant_user} -- "${homeassistant_config_dir}" \
    || return 1
  fi

  HA_CMD="${homeassistant_venv}/bin/hass"
  HA_ARGS="--ignore-os-check --config ${homeassistant_config_dir}"

  if [ -n "${homeassistant_log_file}" ]; then
    install -g ${homeassistant_group} -m 664 -o ${homeassistant_user} -- /dev/null "${homeassistant_log_file}" \
    && HA_ARGS="${HA_ARGS} --log-file ${homeassistant_log_file}"
  fi

  if [ -n "${homeassistant_log_rotate_days}" ]; then
    HA_ARGS="${HA_ARGS} --log-rotate-days ${homeassistant_log_rotate_days}"
  fi

  rc_flags="-f -o ${logfile} -P ${pidfile} -p ${pidfile_child} -R ${homeassistant_restart_delay} ${HA_CMD} ${HA_ARGS}"
  echo $rc_flags
}

start_postcmd=${name}_poststart
homeassistant_poststart() {
  sleep 1
  run_rc_command status
}

restart_precmd="${name}_prerestart"
homeassistant_prerestart() {
  eval "${homeassistant_venv}/bin/hass" --config "${homeassistant_config_dir}" --script check_config
}

status_cmd=${name}_status
homeassistant_status() {
  if [ -n "$rc_pid" ]; then
    echo "${name} is running as pid $rc_pid."
    echo "http://`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'`:8123"
  else
    echo "${name} is not running."
    return 1
  fi
}

stop_postcmd=${name}_postcmd
homeassistant_postcmd() {
    rm -f -- "${pidfile}"
    rm -f -- "${pidfile_child}"
}

run_rc_command "$1"


Cheers,
Martin
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Just a quick guess: daemon is trying to create the pid files as the homessistant user and cannot write in /var/run. Create /var/run/homeassistant, chown to homeassistant, adjust the pid file paths.
 

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
Just a quick guess: daemon is trying to create the pid files as the homessistant user and cannot write in /var/run. Create /var/run/homeassistant, chown to homeassistant, adjust the pid file paths.
It's a good guess but I have just tried this (and previously also tried some other chown type fixes) and it doesn't help. What's really painful is I don't have any kind of log or output that explains what's going on.

Code:
root@hass:/usr/local/etc/rc.d # service homeassistant start
-f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant

Starting homeassistant.
homeassistant is not running.


I'm printing the `rc_flags` at the top there just to show what is being sent to the command (I think). There's a PID (for a process that doesn't keep running) recorded in `homeassistant_daemon.pid` and `homeassistant.pid` is empty.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Try sh -x /usr/local/etc/rc.d/homeassistant start and if that does not help truss -f service homeassistant start. That should give some clues.
 

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
Thank you! It's a case of "no information" to "too much information" I think :)

Code:
+ . /etc/rc.subr
+ : 76359
+ export RC_PID
+ [ -n '' ]
+ _rc_subr_loaded=YES
+ SYSCTL=/sbin/sysctl
+ SYSCTL_N='/sbin/sysctl -n'
+ SYSCTL_W=/sbin/sysctl
+ PROTECT=/usr/bin/protect
+ ID=/usr/bin/id
+ IDCMD='if [ -x /usr/bin/id ]; then /usr/bin/id -un; fi'
+ PS='/bin/ps -ww'
+ JID=0
+ rc_service=/usr/local/etc/rc.d/homeassistant
+ _rc_namevarlist='program chroot chdir env flags fib nice user group groups prepend setup'
+ kenv -q rc.debug
+ name=homeassistant
+ rcvar=homeassistant_enable
+ pidfile_child=/var/run/homeassistant/homeassistant.pid
+ pidfile=/var/run/homeassistant/homeassistant_daemon.pid
+ logfile=/var/log/homeassistant.log
+ load_rc_config homeassistant
+ local _name _rcvar_val _var _defval _v _msg _new _d
+ _name=homeassistant
+ false
+ [ -r /etc/defaults/rc.conf ]
+ debug 'Sourcing /etc/defaults/rc.conf'
+ . /etc/defaults/rc.conf
+ : /usr/local
+ rc_info=NO
+ rc_startmsgs=YES
+ rcshutdown_timeout=90
+ early_late_divider=FILESYSTEMS
+ always_force_depends=NO
+ apm_enable=NO
+ apmd_enable=NO
+ apmd_flags=''
+ ddb_enable=NO
+ ddb_config=/etc/ddb.conf
+ devd_enable=YES
+ devd_flags=''
+ devmatch_enable=YES
+ devmatch_blocklist=''
+ kldxref_enable=YES
+ kldxref_clobber=NO
+ kldxref_module_path=''
+ powerd_enable=NO
+ powerd_flags=''
+ tmpmfs=AUTO
+ tmpsize=20m
+ tmpmfs_flags=-S
+ varmfs=AUTO
+ varsize=32m
+ varmfs_flags=-S
+ mfs_type=auto
+ populate_var=AUTO
+ cleanvar_enable=YES
+ var_run_enable=NO
+ var_run_autosave=NO
+ var_run_mtree=/var/db/mtree/BSD.var-run.mtree
+ local_startup=/usr/local/etc/rc.d
+ script_name_sep=' '
+ rc_conf_files='/etc/rc.conf /etc/rc.conf.local'
+ zfs_enable=NO
+ zfskeys_enable=NO
+ zfs_bootonce_activate=NO
+ zpool_reguid=''
+ zfsd_enable=NO
+ gptboot_enable=YES
+ gbde_autoattach_all=NO
+ gbde_devices=NO
+ gbde_attach_attempts=3
+ gbde_lockdir=/etc
+ geli_devices=''
+ geli_groups=''
+ geli_tries=''
+ geli_default_flags=''
+ geli_autodetach=YES
+ root_rw_mount=YES
+ root_hold_delay=30
+ fsck_flags=-p
+ fsck_y_enable=NO
+ fsck_y_flags='-T ffs:-R -T ufs:-R'
+ background_fsck=YES
+ background_fsck_delay=60
+ growfs_enable=NO
+ growfs_swap_size=''
+ netfs_types='nfs:NFS smbfs:SMB'
+ extra_netfs_types=NO
+ hostname=''
+ hostid_enable=YES
+ hostid_file=/etc/hostid
+ hostid_uuidgen_flags=-r
+ machine_id_file=/etc/machine-id
+ nisdomainname=NO
+ dhclient_program=/sbin/dhclient
+ dhclient_flags=''
+ background_dhclient=NO
+ synchronous_dhclient=NO
+ defaultroute_delay=30
+ defaultroute_carrier_delay=5
+ netif_enable=YES
+ netif_ipexpand_max=2048
+ wpa_supplicant_program=/usr/sbin/wpa_supplicant
+ wpa_supplicant_flags=-s
+ wpa_supplicant_conf_file=/etc/wpa_supplicant.conf
+ firewall_enable=NO
+ firewall_script=/etc/rc.firewall
+ firewall_type=UNKNOWN
+ firewall_quiet=NO
+ firewall_logging=NO
+ firewall_logif=NO
+ firewall_flags=''
+ firewall_coscripts=''
+ firewall_client_net=192.0.2.0/24
+ firewall_simple_iif=em1
+ firewall_simple_inet=192.0.2.16/28
+ firewall_simple_oif=em0
+ firewall_simple_onet=192.0.2.0/28
+ firewall_myservices=''
+ firewall_allowservices=''
+ firewall_trusted=''
+ firewall_logdeny=NO
+ firewall_nologports='135-139,445 1026,1027 1433,1434'
+ firewall_nat_enable=NO
+ firewall_nat_interface=''
+ firewall_nat_flags=''
+ firewall_nat64_enable=NO
+ firewall_nptv6_enable=NO
+ firewall_pmod_enable=NO
+ dummynet_enable=NO
+ ipfw_netflow_enable=NO
+ ip_portrange_first=NO
+ ip_portrange_last=NO
+ ike_enable=NO
+ ike_program=/usr/local/sbin/isakmpd
+ ike_flags=''
+ ipsec_enable=NO
+ ipsec_file=/etc/ipsec.conf
+ natd_program=/sbin/natd
+ natd_enable=NO
+ natd_interface=''
+ natd_flags=''
+ ipfilter_enable=NO
+ ipfilter_program=/sbin/ipf
+ ipfilter_rules=/etc/ipf.rules
+ ipfilter_flags=''
+ ippool_enable=NO
+ ippool_program=/sbin/ippool
+ ippool_rules=/etc/ippool.tables
+ ippool_flags=''
+ ipnat_enable=NO
+ ipnat_program=/sbin/ipnat
+ ipnat_rules=/etc/ipnat.rules
+ ipnat_flags=''
+ ipmon_enable=NO
+ ipmon_program=/sbin/ipmon
+ ipmon_flags=-Ds
+ ipfs_enable=NO
+ ipfs_program=/sbin/ipfs
+ ipfs_flags=''
+ pf_enable=NO
+ pf_rules=/etc/pf.conf
+ pf_program=/sbin/pfctl
+ pf_flags=''
+ pf_fallback_rules_enable=NO
+ pf_fallback_rules='block drop log all'
+ pf_fallback_rules_file=/etc/pf-fallback.conf
+ pflog_enable=NO
+ pflog_logfile=/var/log/pflog
+ pflog_program=/sbin/pflogd
+ pflog_flags=''
+ ftpproxy_enable=NO
+ ftpproxy_flags=''
+ pfsync_enable=NO
+ pfsync_syncdev=''
+ pfsync_syncpeer=''
+ pfsync_ifconfig=''
+ tcp_extensions=YES
+ log_in_vain=0
+ tcp_keepalive=YES
+ tcp_drop_synfin=NO
+ icmp_drop_redirect=auto
+ icmp_log_redirect=NO
+ network_interfaces=auto
+ cloned_interfaces=''
+ sppp_interfaces=''
+ ppp_enable=NO
+ ppp_program=/usr/sbin/ppp
+ ppp_mode=auto
+ ppp_nat=YES
+ ppp_profile=papchap
+ ppp_user=root
+ hostapd_program=/usr/sbin/hostapd
+ hostapd_enable=NO
+ syslogd_enable=YES
+ syslogd_program=/usr/sbin/syslogd
+ syslogd_flags=-s
+ syslogd_oomprotect=YES
+ altlog_proglist=''
+ inetd_enable=NO
+ inetd_program=/usr/sbin/inetd
+ inetd_flags='-wW -C 60'
+ iscsid_enable=NO
+ iscsictl_enable=NO
+ iscsictl_flags=-Aa
+ hastd_enable=NO
+ hastd_program=/sbin/hastd
+ hastd_flags=''
+ ctld_enable=NO
+ local_unbound_enable=NO
+ local_unbound_tls=NO
+ blacklistd_enable=NO
+ blacklistd_flags=''
+ resolv_enable=YES
+ kdc_enable=NO
+ kdc_program=/usr/libexec/kdc
+ kdc_flags=''
+ kadmind_enable=NO
+ kadmind_program=/usr/libexec/kadmind
+ kpasswdd_enable=NO
+ kpasswdd_program=/usr/libexec/kpasswdd
+ kfd_enable=NO
+ kfd_program=/usr/libexec/kfd
+ kfd_flags=''
+ ipropd_master_enable=NO
+ ipropd_master_program=/usr/libexec/ipropd-master
+ ipropd_master_flags=''
+ ipropd_master_keytab=/etc/krb5.keytab
+ ipropd_master_slaves=''
+ ipropd_slave_enable=NO
+ ipropd_slave_program=/usr/libexec/ipropd-slave
+ ipropd_slave_flags=''
+ ipropd_slave_keytab=/etc/krb5.keytab
+ ipropd_slave_master=''
+ gssd_enable=NO
+ gssd_program=/usr/sbin/gssd
+ gssd_flags=''
+ rwhod_enable=NO
+ rwhod_flags=''
+ rarpd_enable=NO
+ rarpd_flags=-a
+ bootparamd_enable=NO
+ bootparamd_flags=''
+ pppoed_enable=NO
+ pppoed_provider='*'
+ pppoed_flags='-P /var/run/pppoed.pid'
+ pppoed_interface=em0
+ sshd_enable=NO
+ sshd_program=/usr/sbin/sshd
+ sshd_flags=''
+ ftpd_enable=NO
+ ftpd_program=/usr/libexec/ftpd
+ ftpd_flags=''
+ autofs_enable=NO
+ automount_flags=''
+ automountd_flags=''
+ autounmountd_flags=''
+ nfs_client_enable=NO
+ nfs_access_cache=60
+ nfs_server_enable=NO
+ nfs_server_flags='-u -t'
+ nfs_server_managegids=NO
+ nfs_server_maxio=131072
+ mountd_enable=NO
+ mountd_flags='-r -S'
+ weak_mountd_authentication=NO
+ nfs_reserved_port_only=NO
+ nfs_bufpackets=''
+ rpc_lockd_enable=NO
+ rpc_lockd_flags=''
+ rpc_statd_enable=NO
+ rpc_statd_flags=''
+ rpcbind_enable=NO
+ rpcbind_program=/usr/sbin/rpcbind
+ rpcbind_flags=''
+ rpc_ypupdated_enable=NO
+ keyserv_enable=NO
+ keyserv_flags=''
+ nfsv4_server_enable=NO
+ nfsv4_server_only=NO
+ nfscbd_enable=NO
+ nfscbd_flags=''
+ nfsuserd_enable=NO
+ nfsuserd_flags=''
+ tlsclntd_enable=NO
+ tlsclntd_flags=''
+ tlsservd_enable=NO
+ tlsservd_flags=''
+ ntpdate_enable=NO
+ ntpdate_program=/usr/sbin/ntpdate
+ ntpdate_flags=-b
+ ntpdate_config=/etc/ntp.conf
+ ntpdate_hosts=''
+ ntpd_enable=NO
+ ntpd_program=/usr/sbin/ntpd
+ ntpd_config=/etc/ntp.conf
+ ntpd_sync_on_start=NO
+ ntpd_flags=''
+ ntp_src_leapfile=/etc/ntp/leap-seconds
+ ntp_db_leapfile=/var/db/ntpd.leap-seconds.list
+ ntp_leapfile_sources=https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
+ ntp_leapfile_fetch_opts=-mq
+ ntp_leapfile_expiry_days=30
+ ntp_leapfile_fetch_verbose=NO
+ nis_client_enable=NO
+ nis_client_flags=''
+ nis_ypset_enable=NO
+ nis_ypset_flags=''
+ nis_server_enable=NO
+ nis_server_flags=''
+ nis_ypxfrd_enable=NO
+ nis_ypxfrd_flags=''
+ nis_yppasswdd_enable=NO
+ nis_yppasswdd_flags=''
+ nis_ypldap_enable=NO
+ nis_ypldap_flags=''
+ bsnmpd_enable=NO
+ bsnmpd_flags=''
+ defaultrouter=NO
+ static_arp_pairs=''
+ static_ndp_pairs=''
+ static_routes=''
+ gateway_enable=NO
+ routed_enable=NO
+ routed_program=/sbin/routed
+ routed_flags=-q
+ arpproxy_all=NO
+ forward_sourceroute=NO
+ accept_sourceroute=NO
+ hcsecd_enable=NO
+ hcsecd_config=/etc/bluetooth/hcsecd.conf
+ sdpd_enable=NO
+ sdpd_control=/var/run/sdp
+ sdpd_groupname=nobody
+ sdpd_username=nobody
+ bthidd_enable=NO
+ bthidd_config=/etc/bluetooth/bthidd.conf
+ bthidd_hids=/var/db/bthidd.hids
+ bthidd_evdev_support=AUTO
+ rfcomm_pppd_server_enable=NO
+ rfcomm_pppd_server_profile='one two'
+ rfcomm_pppd_server_one_channel=1
+ rfcomm_pppd_server_two_channel=3
+ ubthidhci_enable=NO
+ netwait_enable=NO
+ netwait_timeout=60
+ netwait_if_timeout=30
+ icmp_bmcastecho=NO
+ ipv6_network_interfaces=auto
+ ipv6_activate_all_interfaces=NO
+ ipv6_defaultrouter=NO
+ ipv6_static_routes=''
+ ipv6_gateway_enable=NO
+ ipv6_cpe_wanif=NO
+ ipv6_privacy=NO
+ route6d_enable=NO
+ route6d_program=/usr/sbin/route6d
+ route6d_flags=''
+ ipv6_default_interface=NO
+ rtsol_flags=-i
+ rtsold_enable=NO
+ rtsold_flags='-a -i'
+ rtadvd_enable=NO
+ rtadvd_interfaces=''
+ stf_interface_ipv4addr=''
+ stf_interface_ipv4plen=0
+ stf_interface_ipv6_ifid=0:0:0:1
+ stf_interface_ipv6_slaid=0000
+ ipv6_ipv4mapping=NO
+ ipv6_ipfilter_rules=/etc/ipf6.rules
+ ip6addrctl_enable=YES
+ ip6addrctl_verbose=NO
+ ip6addrctl_policy=AUTO
+ keyboard=''
+ keymap=NO
+ keyrate=NO
+ keybell=NO
+ keychange=NO
+ cursor=NO
+ scrnmap=NO
+ font8x16=NO
+ font8x14=NO
+ font8x8=NO
+ blanktime=300
+ saver=NO
+ moused_nondefault_enable=YES
+ moused_enable=NO
+ moused_type=auto
+ moused_port=/dev/psm0
+ moused_flags=''
+ mousechar_start=NO
+ allscreens_flags=''
+ allscreens_kbdflags=''
+ mta_start_script=/etc/rc.sendmail
+ sendmail_enable=NO
+ sendmail_pidfile=/var/run/sendmail.pid
+ sendmail_procname=/usr/sbin/sendmail
+ sendmail_flags='-L sm-mta -bd -q30m'
+ sendmail_cert_create=YES
+ sendmail_submit_enable=YES
+ sendmail_submit_flags='-L sm-mta -bd -q30m -ODaemonPortOptions=Addr=localhost'
+ sendmail_outbound_enable=YES
+ sendmail_outbound_flags='-L sm-queue -q30m'
+ sendmail_msp_queue_enable=YES
+ sendmail_msp_queue_flags='-L sm-msp-queue -Ac -q30m'
+ sendmail_rebuild_aliases=NO
+ auditd_enable=NO
+ auditd_program=/usr/sbin/auditd
+ auditd_flags=''
+ auditdistd_enable=NO
+ auditdistd_program=/usr/sbin/auditdistd
+ auditdistd_flags=''
+ cron_enable=YES
+ cron_program=/usr/sbin/cron
+ cron_dst=YES
+ cron_flags=''
+ cfumass_enable=NO
+ cfumass_dir=/var/cfumass
+ cfumass_image=/var/tmp/cfumass.img
+ lpd_enable=NO
+ lpd_program=/usr/sbin/lpd
+ lpd_flags=''
+ nscd_enable=NO
+ chkprintcap_enable=NO
+ chkprintcap_flags=-d
+ dumpdev=NO
+ dumpon_flags=''
+ dumpdir=/var/crash
+ savecore_enable=YES
+ savecore_flags='-m 10'
+ service_delete_empty=NO
+ crashinfo_enable=YES
+ crashinfo_program=/usr/sbin/crashinfo
+ quota_enable=NO
+ check_quotas=YES
+ quotaon_flags=-a
+ quotaoff_flags=-a
+ quotacheck_flags=-a
+ accounting_enable=NO
+ firstboot_sentinel=/firstboot
+ sysvipc_enable=NO
+ linux_enable=NO
+ linux_mounts_enable=YES
+ clear_tmp_enable=NO
+ clear_tmp_X=YES
+ ldconfig_insecure=NO
+ ldconfig_paths='/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg'
+ ldconfig32_paths='/usr/lib32 /usr/lib32/compat'
+ ldconfigsoft_paths='/usr/libsoft /usr/libsoft/compat /usr/local/libsoft'
+ ldconfig_local_dirs=/usr/local/libdata/ldconfig
+ ldconfig_local32_dirs=/usr/local/libdata/ldconfig32
+ ldconfig_localsoft_dirs=/usr/local/libdata/ldconfigsoft
+ kern_securelevel_enable=NO
+ kern_securelevel=-1
+ update_motd=YES
+ entropy_boot_file=/boot/entropy
+ entropy_file=/entropy
+ entropy_dir=/var/db/entropy
+ entropy_save_sz=4096
+ entropy_save_num=8
+ harvest_mask=511
+ osrelease_enable=YES
+ osrelease_file=/var/run/os-release
+ osrelease_perms=444
+ dmesg_enable=YES
+ watchdogd_enable=NO
+ watchdogd_flags=''
+ watchdogd_timeout=''
+ watchdogd_shutdown_timeout=''
+ devfs_rulesets='/etc/defaults/devfs.rules /etc/devfs.rules'
+ devfs_system_ruleset=''
+ devfs_set_rulesets=''
+ devfs_load_rulesets=YES
+ performance_cx_lowest=NONE
+ performance_cpu_freq=NONE
+ economy_cx_lowest=Cmax
+ economy_cpu_freq=NONE
+ virecover_enable=YES
+ ugidfw_enable=NO
+ bsdextended_script=/etc/rc.bsdextended
+ newsyslog_enable=YES
+ newsyslog_flags=-CN
+ mixer_enable=YES
+ opensm_enable=NO
+ rctl_enable=YES
+ rctl_rules=/etc/rctl.conf
+ iovctl_files=''
+ jail_enable=NO
+ jail_conf=/etc/jail.conf
+ jail_confwarn=YES
+ jail_parallel_start=NO
+ jail_list=''
+ jail_reverse_stop=NO
+ [ -z '' ]
+ source_rc_confs_defined=yes
+ [ -r /etc/defaults/vendor.conf ]
+ source_rc_confs
+ local i sourced_files
+ sourced_files=:/etc/rc.conf:
+ [ -r /etc/rc.conf ]
+ . /etc/rc.conf
+ cron_flags=' -J 15'
+ sendmail_enable=NO
+ sendmail_submit_enable=NO
+ sendmail_outbound_enable=NO
+ sendmail_msp_queue_enable=NO
+ syslogd_flags='-c -ss'
+ ipv6_activate_all_interfaces=YES
+ ifconfig_epair0b=SYNCDHCP
+ homeassistant_enable=YES
+ sourced_files=:/etc/rc.conf::/etc/rc.conf.local:
+ [ -r /etc/rc.conf.local ]
+ _rc_conf_loaded=true
+ [ -n homeassistant ]
+ _d=/etc
+ [ -f /etc/rc.conf.d/homeassistant ]
+ [ -d /etc/rc.conf.d/homeassistant ]
+ _d=/usr/local/etc
+ [ -f /usr/local/etc/rc.conf.d/homeassistant ]
+ [ -d /usr/local/etc/rc.conf.d/homeassistant ]
+ eval '_defval=$homeassistant_enable_defval'
+ _defval=''
+ [ -n '' ]
+ : YES
+ : homeassistant
+ : homeassistant
+ : /home/homeassistant/.homeassistant
+ : /usr/local/share/homeassistant
+ : 1
+ command=/usr/sbin/daemon
+ start_precmd=homeassistant_prestart
+ start_postcmd=homeassistant_poststart
+ restart_precmd=homeassistant_prerestart
+ status_cmd=homeassistant_status
+ stop_postcmd=homeassistant_postcmd
+ run_rc_command start
+ _return=0
+ rc_arg=start
+ [ -z homeassistant ]
+ shift 1
+ rc_extra_args=''
+ _rc_prefix=''
+ eval '_override_command=$homeassistant_program'
+ _override_command=''
+ command=/usr/sbin/daemon
+ _keywords='start stop restart rcvar enable disable delete enabled describe extracommands '
+ rc_pid=''
+ _pidcmd=''
+ _procname=/usr/sbin/daemon
+ [ -n /usr/sbin/daemon ]
+ [ -n /var/run/homeassistant/homeassistant_daemon.pid ]
+ _pidcmd='rc_pid=$(check_pidfile /var/run/homeassistant/homeassistant_daemon.pid /usr/sbin/daemon )'
+ _keywords='start stop restart rcvar enable disable delete enabled describe extracommands  status poll'
+ [ -z start ]
+ [ start '=' enabled ]
+ [ -n '' ]
+ eval 'rc_flags=$homeassistant_flags'
+ rc_flags=''
+ eval '_chdir=$homeassistant_chdir' '_chroot=$homeassistant_chroot' '_nice=$homeassistant_nice' '_user=$homeassistant_user' '_group=$homeassistant_group' '_groups=$homeassistant_groups' '_fib=$homeassistant_fib' '_env=$homeassistant_env' '_prepend=$homeassistant_prepend' '_login_class=${homeassistant_login_class:-daemon}' '_limits=$homeassistant_limits' '_oomprotect=$homeassistant_oomprotect' '_setup=$homeassistant_setup' '_env_file=$homeassistant_env_file' '_umask=$homeassistant_umask'
+ _chdir='' _chroot='' _nice='' _user=homeassistant _group=homeassistant _groups='' _fib='' _env='' _prepend='' _login_class=daemon _limits='' _oomprotect='' _setup='' _env_file='' _umask=''
+ [ -n '' ]
+ [ -n homeassistant ]
+ eval if [ -x /usr/bin/id '];' then /usr/bin/id '-un;' fi
+ [ -x /usr/bin/id ]
+ /usr/bin/id -un
+ [ homeassistant '=' root ]
+ [ -z '' ]
+ eval 'rc_pid=$(check_pidfile' /var/run/homeassistant/homeassistant_daemon.pid /usr/sbin/daemon ')'
+ check_pidfile /var/run/homeassistant/homeassistant_daemon.pid /usr/sbin/daemon
+ _pidfile=/var/run/homeassistant/homeassistant_daemon.pid
+ _procname=/usr/sbin/daemon
+ _interpreter=''
+ [ -z /var/run/homeassistant/homeassistant_daemon.pid -o -z /usr/sbin/daemon ]
+ [ ! -f /var/run/homeassistant/homeassistant_daemon.pid ]
+ read _pid _junk
+ [ -z 71942 ]
+ _find_processes /usr/sbin/daemon . '-p 71942'
+ [ 3 -ne 3 ]
+ _procname=/usr/sbin/daemon
+ _interpreter=.
+ _psargs='-p 71942'
+ _pref=''
+ [ . '!=' . ]
+ _procnamebn=daemon
+ _fp_args='_arg0 _argv'
+ _fp_match=$'case "$_arg0" in
\t\t    $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")'
+ _proccheck=$'\t\t/bin/ps -ww 2>/dev/null -o pid= -o jid= -o command= -p 71942 |
\t\twhile read _npid _jid _arg0 _argv; do
\t\t\tcase "$_arg0" in
\t\t    $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")
\t\t\t\tif [ "$JID" -eq "$_jid" ];
\t\t\t\tthen echo -n "$_pref$_npid";
\t\t\t\t_pref=" ";
\t\t\t\tfi
\t\t\t\t;;
\t\t\tesac
\t\tdone'
+ eval /bin/ps -ww '2>/dev/null' -o 'pid=' -o 'jid=' -o 'command=' -p 71942 '|' while read _npid _jid _arg0 '_argv;' do case '"$_arg0"' in '$_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")' if [ '"$JID"' -eq '"$_jid"' '];' then echo -n '"$_pref$_npid";' '_pref="' '";' fi ';;' esac done
+ /bin/ps -ww -o 'pid=' -o 'jid=' -o 'command=' -p 71942
+ read _npid _jid _arg0 _argv
+ rc_pid=''
+ [ start '!=' start ]
+ [ -n homeassistant_enable -a start '!=' rcvar -a start '!=' stop -a start '!=' delete -a start '!=' enable -a start '!=' describe -a start '!=' status ]
+ checkyesno homeassistant_enable
+ eval '_value=$homeassistant_enable'
+ _value=YES
+ debug 'checkyesno: homeassistant_enable is set to YES.'
+ return 0
+ [ start '=' start -a -z '' -a -n '' ]
+ eval '_cmd=$start_cmd' '_precmd=$start_precmd' '_postcmd=$start_postcmd'
+ _cmd='' _precmd=homeassistant_prestart _postcmd=homeassistant_poststart
+ [ -n '' ]
+ [ ! -x /usr/sbin/daemon ]
+ _run_rc_precmd
+ check_required_before start
+ local _f
+ return 0
+ [ -n homeassistant_prestart ]
+ debug 'run_rc_command: start_precmd: homeassistant_prestart '
+ eval 'homeassistant_prestart '
+ homeassistant_prestart
+ install -g homeassistant -m 664 -o homeassistant -- /dev/null /var/log/homeassistant.log
+ install -g homeassistant -m 664 -o homeassistant -- /dev/null /var/run/homeassistant/homeassistant_daemon.pid
+ install -g homeassistant -m 664 -o homeassistant -- /dev/null /var/run/homeassistant/homeassistant.pid
+ [ ! -d /home/homeassistant/.homeassistant ]
+ HA_CMD=/usr/local/share/homeassistant/bin/hass
+ HA_ARGS='--ignore-os-check --config /home/homeassistant/.homeassistant'
+ [ -n '' ]
+ [ -n '' ]
+ rc_flags='-f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant'
+ echo -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant
-f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant
+ _return=0
+ [ 0 -ne 0 ]
+ check_required_after start
+ local _f _args
+ return 0
+ return 0
+ startmsg 'Starting homeassistant.'
+ check_startmsgs
+ [ -n '' ]
+ return 0
+ echo 'Starting homeassistant.'
Starting homeassistant.
+ [ -n '' ]
+ _cd=''
+ _doit='/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant '
+ [ -n homeassistant ]
+ _doit=$'su -m homeassistant -c \'sh -c "/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant "\''
+ [ -n '' ]
+ [ -n '' ]
+ [ -n '' ]
+ _doit=$' limits -C daemon  su -m homeassistant -c \'sh -c "/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant "\''
+ _run_rc_doit $' limits -C daemon  su -m homeassistant -c \'sh -c "/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant "\''
+ local _m
+ debug $'run_rc_command: doit:  limits -C daemon  su -m homeassistant -c \'sh -c "/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant "\''
+ umask
+ _m=0022
+
+ eval $' limits -C daemon  su -m homeassistant -c \'sh -c "/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant "\''
+ limits -C daemon su -m homeassistant -c 'sh -c "/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant "'
+ _return=0
+ umask 0022
+ [ 0 -ne 0 ]
+ return 0
+ _run_rc_postcmd
+ [ -n homeassistant_poststart ]
+ debug 'run_rc_command: start_postcmd: homeassistant_poststart '
+ eval 'homeassistant_poststart '
+ homeassistant_poststart
+ sleep 1
+ run_rc_command status
+ _return=0
+ rc_arg=status
+ [ -z homeassistant ]
+ shift 1
+ rc_extra_args=''
+ _rc_prefix=''
+ eval '_override_command=$homeassistant_program'
+ _override_command=''
+ command=/usr/sbin/daemon
+ _keywords='start stop restart rcvar enable disable delete enabled describe extracommands '
+ rc_pid=''
+ _pidcmd=''
+ _procname=/usr/sbin/daemon
+ [ -n /usr/sbin/daemon ]
+ [ -n /var/run/homeassistant/homeassistant_daemon.pid ]
+ _pidcmd='rc_pid=$(check_pidfile /var/run/homeassistant/homeassistant_daemon.pid /usr/sbin/daemon )'
+ _keywords='start stop restart rcvar enable disable delete enabled describe extracommands  status poll'
+ [ -z status ]
+ [ status '=' enabled ]
+ [ -n '' ]
+ eval 'rc_flags=$homeassistant_flags'
+ rc_flags=''
+ eval '_chdir=$homeassistant_chdir' '_chroot=$homeassistant_chroot' '_nice=$homeassistant_nice' '_user=$homeassistant_user' '_group=$homeassistant_group' '_groups=$homeassistant_groups' '_fib=$homeassistant_fib' '_env=$homeassistant_env' '_prepend=$homeassistant_prepend' '_login_class=${homeassistant_login_class:-daemon}' '_limits=$homeassistant_limits' '_oomprotect=$homeassistant_oomprotect' '_setup=$homeassistant_setup' '_env_file=$homeassistant_env_file' '_umask=$homeassistant_umask'
+ _chdir='' _chroot='' _nice='' _user=homeassistant _group=homeassistant _groups='' _fib='' _env='' _prepend='' _login_class=daemon _limits='' _oomprotect='' _setup='' _env_file='' _umask=''
+ [ -n '' ]
+ [ -n homeassistant ]
+ eval if [ -x /usr/bin/id '];' then /usr/bin/id '-un;' fi
+ [ -x /usr/bin/id ]
+ /usr/bin/id -un
+ [ homeassistant '=' root ]
+ [ -z '' ]
+ eval 'rc_pid=$(check_pidfile' /var/run/homeassistant/homeassistant_daemon.pid /usr/sbin/daemon ')'
+ check_pidfile /var/run/homeassistant/homeassistant_daemon.pid /usr/sbin/daemon
+ _pidfile=/var/run/homeassistant/homeassistant_daemon.pid
+ _procname=/usr/sbin/daemon
+ _interpreter=''
+ [ -z /var/run/homeassistant/homeassistant_daemon.pid -o -z /usr/sbin/daemon ]
+ [ ! -f /var/run/homeassistant/homeassistant_daemon.pid ]
+ read _pid _junk
+ [ -z 76372 ]
+ _find_processes /usr/sbin/daemon . '-p 76372'
+ [ 3 -ne 3 ]
+ _procname=/usr/sbin/daemon
+ _interpreter=.
+ _psargs='-p 76372'
+ _pref=''
+ [ . '!=' . ]
+ _procnamebn=daemon
+ _fp_args='_arg0 _argv'
+ _fp_match=$'case "$_arg0" in
\t\t    $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")'
+ _proccheck=$'\t\t/bin/ps -ww 2>/dev/null -o pid= -o jid= -o command= -p 76372 |
\t\twhile read _npid _jid _arg0 _argv; do
\t\t\tcase "$_arg0" in
\t\t    $_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")
\t\t\t\tif [ "$JID" -eq "$_jid" ];
\t\t\t\tthen echo -n "$_pref$_npid";
\t\t\t\t_pref=" ";
\t\t\t\tfi
\t\t\t\t;;
\t\t\tesac
\t\tdone'
+ eval /bin/ps -ww '2>/dev/null' -o 'pid=' -o 'jid=' -o 'command=' -p 76372 '|' while read _npid _jid _arg0 '_argv;' do case '"$_arg0"' in '$_procname|$_procnamebn|${_procnamebn}:|"(${_procnamebn})"|"[${_procnamebn}]")' if [ '"$JID"' -eq '"$_jid"' '];' then echo -n '"$_pref$_npid";' '_pref="' '";' fi ';;' esac done
+ /bin/ps -ww -o 'pid=' -o 'jid=' -o 'command=' -p 76372
+ read _npid _jid _arg0 _argv
+ rc_pid=''
+ [ start '!=' status ]
+ continue
+ [ stop '!=' status ]
+ continue
+ [ restart '!=' status ]
+ continue
+ [ rcvar '!=' status ]
+ continue
+ [ enable '!=' status ]
+ continue
+ [ disable '!=' status ]
+ continue
+ [ delete '!=' status ]
+ continue
+ [ enabled '!=' status ]
+ continue
+ [ describe '!=' status ]
+ continue
+ [ extracommands '!=' status ]
+ continue
+ [ status '!=' status ]
+ [ -n homeassistant_enable -a status '!=' rcvar -a status '!=' stop -a status '!=' delete -a status '!=' enable -a status '!=' describe -a status '!=' status ]
+ [ -n homeassistant_enable -a status '=' stop -a -z '' ]
+ [ status '=' start -a -z '' -a -n '' ]
+ eval '_cmd=$status_cmd' '_precmd=$status_precmd' '_postcmd=$status_postcmd'
+ _cmd=homeassistant_status _precmd='' _postcmd=''
+ [ -n homeassistant_status ]
+ [ -n '' ]
+ _run_rc_precmd
+ check_required_before status
+ local _f
+ return 0
+ [ -n '' ]
+ check_required_after status
+ local _f _args
+ return 0
+ return 0
+ _run_rc_doit 'homeassistant_status '
+ local _m
+ debug 'run_rc_command: doit: homeassistant_status '
+ umask
+ _m=0022
+
+ eval 'homeassistant_status '
+ homeassistant_status
+ [ -n '' ]
+ echo 'homeassistant is not running.'
homeassistant is not running.
+ return 1
+ _return=1
+ umask 0022
+ [ 1 -ne 0 ]
+ [ -z '' ]
+ return 1
+ return 1
+ _return=1
+ return 0
+ return 1


The most logical thing I can take out of this is:

Code:
su -m homeassistant -c 'sh -c "/usr/sbin/daemon -f -o /var/log/homeassistant.log -P /var/run/homeassistant/homeassistant_daemon.pid -p /var/run/homeassistant/homeassistant.pid -R 1 /usr/local/share/homeassistant/bin/hass --ignore-os-check --config /home/homeassistant/.homeassistant"'


And if I run that directly in the shell it returns immediately with no output and a return code of zero. I can only make it work by removing the `-o`, `-p` and `-P` flags (and their arguments). I can change the values to any other path, e.g. one in the `homeassistant` user's home directory, and it fails silently.

If I set `-P` (aka `--supervisor-daemon`) it will write a PID but it's a very short-lived process.

Looking at the `daemon` manpage, it does look to me like maybe specifying these options change the way `daemon` works:

Code:
     -P, --supervisor-pidfile supervisor_pidfile
             Write the ID of the daemon process into the supervisor_pidfile
             using the pidfile(3) functionality.  The program is executed in a
             spawned child process while the daemon waits until it terminates
             to keep the supervisor_pidfile locked and removes it after the
             process exits.  The supervisor_pidfile owner is the user who runs
             the daemon regardless of whether the --user option is used or
             not.

     -p, --child-pidfile child_pidfile
             Write the ID of the created process into the child_pidfile using
             the pidfile(3) functionality.  The program is executed in a
             spawned child process while the daemon waits until it terminates
             to keep the child_pidfile locked and removes it after the process
             exits.  The child_pidfile owner is the user who runs the daemon
             regardless of whether the --user option is used or not.
...

    If any of the options --child-pidfile, --output-mask, --restart,
     --restart-delay, --supervisor-pidfile, --syslog, --syslog-facility
     --syslog-priority, --syslog-tag, or --output, are specified, the program
     is executed in a spawned child process.  The daemon waits until it
     terminates to keep the pid file(s) locked and removes them after the
     process exits or restarts the program.  In this case if the monitoring
     daemon receives software termination signal (SIGTERM) it forwards it to
     the spawned process.  Normally it will cause the child to exit, remove
     the pidfile(s) and then terminate.


So I am wondering now if the root cause here is the "spawned child process" somehow not working on my system?
 

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
This is almost certainly the problem. Here's a much more minimal test, run as root:

Code:
root@hass:~ # cat dummy.sh
#!/bin/bash

echo "starting"
sleep 10
echo "exiting"
exit 0
root@hass:~ # daemon -p dummy.pid sh dummy.sh  # <-- returns immediately, no output
root@hass:~ # daemon sh dummy.sh # <-- returns immediately but program is running in the background, "exiting" message appears after 10s
root@hass:~ # starting
exiting


Note that if I do an equivalent test outside my jail, it works as expected, so the problem is ... in the jail?
 

victort

Guru
Joined
Dec 31, 2021
Messages
973

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Don't have the time to dig deeper right now, but you are on the right track. There is always two ways to start any application:

- the application knows how to properly "daemonize" itself, that is close file descriptors, drop privileges, put itself in the background
- the application doesn't do this so you need the daemon tool for that

You need the right combination of flags and PID file for everything to work. I have always used

- use some flag in the call of $APP to not daemonize but stay in the foreground
- tell daemon that the application will stay in the foreground and to record the PID of daemon, not of the child in the pidfile (not 100% sure about the second part)

IIRC - sorry, quick write up from memory.

Alternatively you could use py39-supervisor to start home assistant. It's easier to understand IMHO and quite common on Linux, so if you come from a Linux background, you might find it easier to work with than the FreeBSD RC system.
 

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
Don't have the time to dig deeper right now, but you are on the right track. There is always two ways to start any application:

- the application knows how to properly "daemonize" itself, that is close file descriptors, drop privileges, put itself in the background
- the application doesn't do this so you need the daemon tool for that

You need the right combination of flags and PID file for everything to work. I have always used

- use some flag in the call of $APP to not daemonize but stay in the foreground
- tell daemon that the application will stay in the foreground and to record the PID of daemon, not of the child in the pidfile (not 100% sure about the second part)

IIRC - sorry, quick write up from memory.

Alternatively you could use py39-supervisor to start home assistant. It's easier to understand IMHO and quite common on Linux, so if you come from a Linux background, you might find it easier to work with than the FreeBSD RC system.
I actually know the guy who wrote supervisord :)

Good shout. Might try. But “daemon” is definitely broken in my jail (independent in RC scripts etc) and not broken outside it.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
Ok, this is not an elegant solution, but neither is anything else about this bastardised Home Assistant install (I had to backport a numpy bug fix to 1.26.0 because HA pins the dependency; I had to install all kinds of weird and wonderful dependencies; etc.).

I just copied the `daemon` binary from `/usr/sbin` on the host TrueNAS system into the jail itself and altered the RC script to use this binary instead of `/usr/sbin/daemon`. Works fine. :)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What does freebsd-version in your jail output? I strongly suspect "13.3". Did you check the version with uname when asked last time? This is not the correct tool to use. You checked the kernel version of the host instead.

So if your jail is indeed running 13.3 then simply start over with a 13.2 jail and all will be well. Promise :wink:

For reference.
 

Martin Aspeli

Dabbler
Joined
Jan 13, 2016
Messages
29
D’oh. I’m on 13.3 indeed. `uname` reports 13.1 but `freebsd-version` reports 13.3. Which now provides an explanation.

Starting again is a bit painful because Home Assistant is so hard to install natively now. My hack of copying and using the 13.1 `daemon` binary works in the meantime, though I do wonder what else might break in due course.

Thank you for bearing with me!
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
13.3 jails will run fine once the next release of TN CORE is published. Some time in April. You decide whether you want to jump on the beta bandwagon or wait for the final release.

I just updated my post about the fundamental issue with your workaround - thanks.
 
Last edited:
Top