LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-22-2020, 12:43 PM   #1
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Rep: Reputation: 19
Restart a netctl profile on failure


Hi all,

I have a system set up to start certain netctl profiles on boot. In some cases, the system may boot before the network's DHCP server does, so that profile fails to start. I would like it if I could configure this netctl profile kind of like a systemd service with Restart=on-failure, so that after a little delay, it'll try to start again. Is there a way to do that?

Alternatively, might netctl hooks be a way to do this (I haven't read up on them yet)? Or will I have to do brute-force it and write a script that constantly checks if the profile is running and tries to start it if it isn't?

Thanks!
 
Old 10-22-2020, 03:36 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Wouldn't it be easier to start netctl only after the network is definitely online?
How are you starting it in the first place? Via systemd? That has options to start something after something.
 
Old 10-22-2020, 04:44 PM   #3
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
Quote:
Wouldn't it be easier to start netctl only after the network is definitely online?
I suppose it would, but how do I know if the network is definitely online before trying to bring up the interface with netctl? Also, if there is no DHCP server available, I still want the system to finish booting, and if the netctl profile times out, it never tries to start again. So, if the DHCP server eventually shows up, the profile wouldn't try to start up again.
 
Old 10-23-2020, 03:27 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by MALDATA View Post
I suppose it would, but how do I know if the network is definitely online before trying to bring up the interface with netctl? Also, if there is no DHCP server available, I still want the system to finish booting, and if the netctl profile times out, it never tries to start again. So, if the DHCP server eventually shows up, the profile wouldn't try to start up again.
systemd provides for all these scenarios & possibilities.
A good start: https://wiki.archlinux.org/index.php/Systemd
 
Old 10-23-2020, 08:15 AM   #5
MALDATA
Member
 
Registered: Mar 2005
Posts: 157

Original Poster
Rep: Reputation: 19
Quote:
systemd provides for all these scenarios & possibilities.
Yep, that's why I'm hoping netctl does as well, but as I mentioned in my post, I don't know how to do that, and it's not a function of systemd. As far as I am aware, the netctl profile does not allow you to set systemd-type options (like Restart and RestartSec). Is there a way to add a systemd-style unit file that configures how that profile should behave as a "service?"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Use Netctl in Arch Linux to Set Up a Network Connection LXer Syndicated Linux News 0 04-04-2018 02:03 PM
mobile broad band internet using netctl profile netpumber Linux - Newbie 6 07-11-2016 03:14 PM
How To Install Netctl Package Through Arch Linux Terminal njdevils9 Linux - Wireless Networking 5 08-20-2014 02:15 PM
Arch Liux: netctl failure for static IP linux555 Arch 7 02-27-2014 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration