Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Boot process (Read 1424 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Boot process

Hi to all.

Maybe this is an already answered question.

I'm Using Artixlinux OpenRC and I had a problem with network when dhcpcd was update to 9.3.1.

So I've removed the "manual" network configuration, the configuration done using the hints on the installation document:

Quote
"Alternatively, if you will use openrc, Gentoo's netifrc modules can be used"


As it hangs the boot process.

I'm using a 4G router through  Wifi with a Wifi Adapter (the type you plung into AC and connect to the Ethernet port), from time to time the connection is not available and I don't want that the boot process hangs the machine.

There is a place where i could put a little script that ius executed at the end of the boot process that simply calls
Code: [Select]
dhcpcd eth0

So I could be able to manage a lack of internet connection?

Arch linux wiki is not useful as it use systemd and the relevant informations are not present, or I can't find them.

Tanks in advance and Regards

Carlo D.

Re: Boot process

Reply #1
OpenRC (and, thanks to our runit and s6 guys, runit and s6 too) supports /etc/rc.local for executing custom commands at startup. You can also create separate scripts inside /etc/local.d ending in .start (e.g. dhcpcd.start) to get the job done. Don't forget to background the execution of dhcpcd with &.

It's all in the wiki.

Re: Boot process

Reply #2
I found dhclient is easier to use from the command line, in it's out-of-the-box config it's better at connecting and a lot better at reconnecting if the signal is briefly lost, I'm sure dhcpcd can be set up better though, it doesn't have any reconnection trouble when used with Network Manager. I usually use wireless, not ethernet though. I think Network Manager (and probably various other equivalents) can use either dhcpcd or dhclient too.  But anyway dhclient is more or less a straight replacement to achieve the same result, just use the equivalent args when calling it. In the case below dhclient.conf is just an empty file to satisfy the command requirements.
Code: [Select]
Connect:
#dhcpcd -4 -t 0 -K wlpXsY
dhclient -v -cf /path/to/dhclient.conf wlpXsY

Disconnect:
#dhcpcd -4 -x wlpXsY
dhclient -x wlpXsY

I tried the version of dhcpcd that gave the recent problems and that still worked when run manually, I think the fixed version is in the main repos now, perhaps you have found other problems though.
Possibly you could skip dhcp completely and set up a static connection too.

Re: Boot process

Reply #3
Many thanks.

I've missed the documentation about OpenRC in the Wiki.

please you could explain better the  part about rc.local:

The scripts in /etc/local.d are executed or have to be activated in some manner.

i.e. i have to write a dhcpcd.start and then

Code: [Select]
chmod +x dhcpcd.start

and I'm done or I've to do some other things like activate the local service with:

Code: [Select]
rc-update add local default 

the documentation is not so clear, ad it explains way to mimic the rc.local file.

Plus lexical order of execution, means that i cpuld prefix it with say 00- 01- to make them executed in such order?

Regards

Carlo D.




Re: Boot process

Reply #4
The local service is by default enabled in OpenRC. This scans /etc/local.d for scripts ending in .start (or .stop, for shutdown time) and executes them.
Lexical order is exactly what you described.

Re: [SOLVED] Boot process

Reply #5
Many Thanks, I wil mark it as SOLVED.

Regards

Carlo D.