OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: loredo on April 01, 2018, 07:11:00 pm

Title: /etc/hostid not being generated
Post by: loredo on April 01, 2018, 07:11:00 pm
Hi,

is there any reason /etc/hostid file is not generated automatically?
I see quite a lot of error messages when using command line, similar to this one:

Code: [Select]
cat: /etc/hostid: No such file or directory
However, hostid should be generated during bootup:

Code: [Select]
root@hostname:~ # sysrc -A|grep hostid
hostid_enable: YES
hostid_file: /etc/hostid

Apologies should this be a too simple question. I am new to BSD and wasn't able to find anything useful from Google about this so I assume it must be something OPNsense or HardenedBSD related?

If I run the hostid service manually it shows me the generated IDs but still wouldn't write those to the desired file(s).


Many thanks,
Julian
Title: Re: /etc/hostid not being generated
Post by: loredo on April 01, 2018, 09:55:19 pm
Looking into /etc/rc.d/hostid a simple start does not (re)generate non-existing file /etc/hostid.
Executing

Code: [Select]
service hostid reset
helps but shouldn't this be done automatically after OPNsense initial bootup?
Title: Re: /etc/hostid not being generated
Post by: franco on April 04, 2018, 08:16:38 am
The proper sequence seems to be:

/etc/rc.d/hostid start
/etc/rc.d/hostid_save start

So I've added this commit:

https://github.com/opnsense/core/commit/e49a6176

It could be that sometime during FreeBSD development hostid and hostid_save were broken up and we missed it.


Cheers,
Franco