Missing rc.local & rc.conf.local

Hi

rc.local & rc.conf.local missing in /etc file(s) list! Foolishly deleted them, cannot remember why.

Receive error messages during boot. May be linked to above files, though the OS works as usual apart from some newly installed application software, most probably added lately!

Is there a way to re-generate them? If yes ,then how?

Thanks
rraj
 
here are mine:
Bash:
$ ls -l /etc/rc.local /etc/rc.conf.local
ls: /etc/rc.local: No such file or directory
-rw-r--r--  1 root wheel 0 25 Juni  2023 /etc/rc.conf.local
 
Receive error messages during boot. May be linked to above files, though the OS works as usual apart from some newly installed application software, most probably added lately!

These files are optional, them missing shouldn't trigger errors.

It is also considered impolite to say you got errors without telling us what the errors were.
 
These files are optional, them missing shouldn't trigger errors.
Unless something optional requiring them without error handling. ;)

Any optional files should be checked for the existence BEFORE actually read / source them.

If not, it's the bug of any scripts/executables unconditionally requiring optional thing. And I believe there should be nothing in base (without ports/pkgs and/or site/host specific things intalled) doing such a thing, at least cleanly installed supported releases.
 
Unless something optional requiring them without error handling. ;)

Any optional files should be checked for the existence BEFORE actually read / source them.

If not, it's the bug of any scripts/executables unconditionally requiring optional thing. And I believe there should be nothing in base (without ports/pkgs and/or site/host specific things intalled) doing such a thing, at least cleanly installed supported releases.
Hi T-Aoki

Question arose when pondering over optional OR other apps though installed not working as intended.

Any pointers in this regard?

Can furnish dmesg.boot here upon request!

Thanks
rraj
 
Hi T-Aoki

Question arose when pondering over optional OR other apps though installed not working as intended.

Any pointers in this regard?

Can furnish dmesg.boot here upon request!

Thanks
rraj
dmesg is from kernel, not scripts and/or binaries themselves. So putting it aside.

Errors from scripts / binaries that can be logged (basically using syslog functionalities) are logged into /var/log/messages, unless specifically configured to send to other places or external syslog server. So it would be the first place to look for hints.

And as far as I know, scripts in base has guards for default-non-existent but read if existed things like this.

So if something in base exposes error that needed file(s) is (are) not exist, it usually is because of mis-configurations of site- (or host-) specific configs, for example, in /etc/rc.conf, /etc/fstab and so on.

On the other hand, what complaining exists under /usr/local, it basically is something from ports/pkgs or in-the-wild thing that admin (including yourself if you can su to root) installed under /usr/local.

Ports (pkgs are built using ports) is typicall ported from other OS'es, thus, if the maintainer or committer overlooked something to be modified for FreeBSD, problems can happen much easier than in base. The whole bunch of ports are in far larger scale than base nowadays.
 
Hi

rc.local & rc.conf.local missing in /etc file(s) list! Foolishly deleted them, cannot remember why.

Receive error messages during boot. May be linked to above files, though the OS works as usual apart from some newly installed application software, most probably added lately!

Is there a way to re-generate them? If yes ,then how?

Thanks
rraj
A particular configuration deserves a good backup.
You don't have a ZFS file system, I imagine?
 
dmesg is from kernel, not scripts and/or binaries themselves. So putting it aside.

Errors from scripts / binaries that can be logged (basically using syslog functionalities) are logged into /var/log/messages, unless specifically configured to send to other places or external syslog server. So it would be the first place to look for hints.

And as far as I know, scripts in base has guards for default-non-existent but read if existed things like this.

So if something in base exposes error that needed file(s) is (are) not exist, it usually is because of mis-configurations of site- (or host-) specific configs, for example, in /etc/rc.conf, /etc/fstab and so on.

On the other hand, what complaining exists under /usr/local, it basically is something from ports/pkgs or in-the-wild thing that admin (including yourself if you can su to root) installed under /usr/local.

Ports (pkgs are built using ports) is typicall ported from other OS'es, thus, if the maintainer or committer overlooked something to be modified for FreeBSD, problems can happen much easier than in base. The whole bunch of ports are in far larger scale than base nowadays.
Hi T-Aoki

Any pkg/app to check validity of settings made in rc.conf & loader.conf!

Any help from app ‘bsdconfig’ etc.?

Thanks
rraj
 
Hi fjdlr

Don’t have ZFS! Any particular reason why UFS would not work as zfs?

I actually have UFS!

Thanks
rraj
Have you active and configure dump ?
dump (UFS) ?
Another backup solution is rsnapshot
ZFS is another story, by enabling snapshots manually (send | receive), for example.
You can easily retrieve files from ~/.zfs
man zfs
In any case, you should consider seriously backing up your data and configuration files.
It's very easy to reinstall the base system and reconfigure everything.
 
Don’t have ZFS! Any particular reason why UFS would not work as zfs?
Many big differences. For your situation the big ones are:
(a) ZFS has built-in checksums, so if you get an unreported disk error, you don't get data corruption.
(b) When using ZFS as the root file system, snapshots of your configuration are taken automatically whenever you do an upgrade, and can be taken by hand. Those snapshots are called "boot environments", so if your setup gets screwed up, you can just boot into the state of the system before the change.
(c) ZFS and its long history of snapshots have created better integration with backup tools.

But UFS is also a great file system, easier to use (fewer commands, more traditional commands), and today it also supports snapshots.
 
Hi

rc.local & rc.conf.local missing in /etc file(s) list! Foolishly deleted them, cannot remember why.

Receive error messages during boot. May be linked to above files, though the OS works as usual apart from some newly installed application software, most probably added lately!

Is there a way to re-generate them? If yes ,then how?

Thanks
rraj
touch /etc/rc.local /etc/rc.conf.local

As other's have mentioned, these 2 files aren't part of the system when you install it. You create them manually later on.

I actually use these 2 files quite a bit along side /etc/rc.shutdown

For system-related services(networking,pf,syslogd,cron), these go into /etc/rc.conf and this file rarely changes..

For ports/pkg services, I place them in /etc/rc.conf.local. I usually split them up this way.

I use /etc/rc.local to control the order of how ports/pkg services are started. I have a need to start them all up in a certain order. The last stage of the boot process is where this file is read and executed.

For /etc/rc.shutdown, I use this file to control which services I don't want to start during boot and have them started through /etc/rc.local instead..
 
Back
Top