Forum › Forums › Official Releases › antiX-21/22 “Grup Yorum” › How to restart network services (runit)?
- This topic has 14 replies, 7 voices, and was last updated Apr 26-6:01 pm by techore.
-
AuthorPosts
-
April 24, 2023 at 8:58 pm #105380Member
techore
How do I restart the network stack under runit without reboot?
Not seeing an /etc/init.d/network or equivalent but I may just be tired.
Thank you.
April 24, 2023 at 10:12 pm #105385MemberRobin
::sudo sv status connman sudo sv stop connman sudo sv start connman sudo sv restart connmanThe folders to look into are found in /etc/service/…
Further reading about managing runit services from command line: http://smarden.org/runit/faq.html#control
Windows is like a submarine. Open a window and serious problems will start.
April 24, 2023 at 10:43 pm #105387Member
techore
::@Robin, excellent answer but I failed to provide details. Thank you.
At boot, interfaces are brought up as defined in /etc/network/interfaces that are not managed, e.g. blacklisted, by connman. How do those get reset without a reboot?
April 24, 2023 at 11:48 pm #105388MemberRobin
::Maybe you need to look into the subfolders within
/etc/runit/runsvdirThis should be the place where runit runlevel structure can be found which is followed at system startup. You’ll find some scripts in them, obviously representing the services to be started when a specific runlevel is entered.
To switch to another runlevel there is a command
runsvchdirI have not tested all this by now, so I can’t give you any details. Maybe somebody else?
Further reading about runit runlevels: http://smarden.org/runit/runlevels.html
Windows is like a submarine. Open a window and serious problems will start.
April 25, 2023 at 12:17 am #105389Memberolsztyn
::I think the question @techore articulated is very interesting. To me there should be an established process to restart network stack without rebooting. This is Linux after all and stacks like this should not need the entire system rebooted to be restarted.
Thanks @techore for raising attention to such question…Live antiX Boot Options (Previously posted by Xecure):
https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_ParametersApril 25, 2023 at 2:37 am #105390Member
techore
::Maybe you need to look into the subfolders within /etc/runit/runsvdir
@Robin, I will dig into the runit service scripts and see what I can find. Thank you for sharing runsvdir command. I either forgot or never knew.
This is Linux after all and stacks like this should not need the entire system rebooted to be restarted.
@olsztyn, agreed, but this is probably a matter of my own ignorance-I have only been using antiX for eighteen months. I suspect there is a command or script to reset the entire network stack that uses both /etc/network/interfaces and connman’s service unit. ‘ifup’ and ‘ifdown’ work for the immediate need to manage bridge0.
Thank you both. If I find a solution, I will share.
April 25, 2023 at 9:30 am #105395MemberXunzi_23
::Hi Techore,
Maybe useful
using the runit service manager in the antiX 23 Beta you can stop and restart conmann.
/etc/runit
The conmann runit service files are in /etc/runit/runsvdir/current/connman- This reply was modified 2 weeks ago by Xunzi_23.
April 25, 2023 at 10:40 am #105397Moderator
caprea
::Maybe I’m wrong but if you use the /etc/network/interfaces file for your connection then ceni is used.
Ceni isn’t a service. It just works when it is configured,uses less resources, cant get restartet as a service like connman.April 25, 2023 at 8:38 pm #105418Member
techore
::Hi Techore,
Maybe useful
using the runit service manager in the antiX 23 Beta you can stop and restart conmann.
/etc/runit
The conmann runit service files are in /etc/runit/runsvdir/current/connmanThe runit service manager is very nice. anticapitalista (?), did a great job on it.
I spend most of my time on the cli and use ‘sv’, but I do use the runit-service-manager from time to time.
April 25, 2023 at 9:10 pm #105420Member
techore
::Maybe I’m wrong but if you use the /etc/network/interfaces file for your connection then ceni is used.
Ceni isn’t a service. It just works when it is configured,uses less resources, cant get restartet as a service like connman.You are correct that ceni uses /etc/network/interfaces on antiX but it doesn’t support bridges. As I recollect, /etc/network/interfaces predates systemd so it is not new nor ceni specific. The only reason the antix-dwm spin has connman is ceni wireless scans take a very long time, otherwise, I would use ceni over connman. They both have their pros/cons.
Lunch! Time to dig into antiX 22 runit init files.
April 26, 2023 at 1:36 pm #105452Memberabc-nix
::Hi.
I am curious of what you are trying to achieve. Is this the same as restarting the networking service in sysVinit-based systems?
In antix runit I could only find this service in the antix-core folder. And it seems to be referenced in the antix-wifi-switch script also.Would this work under runit?
sudo /etc/runit-core/S14networking restartApril 26, 2023 at 3:49 pm #105464Forum Admin
anticapitalista
::If using ceni or dhclient and not connmann, there are no runit services.
Try ifup eg
ifup eth0Philosophers have interpreted the world in many ways; the point is to change it.
antiX with runit - leaner and meaner.
April 26, 2023 at 5:39 pm #105477Member
techore
::If using ceni or dhclient and not connmann, there are no runit services.
Thank you for stating there isn’t runit service to manage non-connman interfaces. I wasn’t seeing one but.. thank you.
I’ve been using ifup, ifdown, and ifstatus without issue. I think that I will write a wrapper to reset both connman managed and unmanaged interfaces.
April 26, 2023 at 5:46 pm #105478Member
techore
::Would this work under runit? ‘sudo /etc/runit-core/S14networking restart’
Looks promising! It does restart the bridge interface and triggers dhcp. Nice!
April 26, 2023 at 6:01 pm #105479Member
techore
::@abc-nix, /hugs.
I’ll need to test this further but it is working thus far.
> cat /usr/local/bin/netrestart #!/usr/bin/env bash # Project: antix-dwm # Location: /usr/local/bin/netrestart.sh # Dependencies: connman # Description: Simple script to reset network interfaces using # connman and /etc/runit-core/S14networking. Symlink for convenience. # ln -s /usr/local/bin/netrestart /etc/init.d/networking # Usage: sudo /etc/init.d/networking printf "\n========> Restarting connman runit service\n\n" sv restart connman printf "\n========> Restarting /etc/runit-core/S14networking\n\n" /etc/runit-core/S14networking restartResults:
========> Restarting connman runit service ok: run: connman: (pid 52441) 0s ========> Restarting /etc/runit-core/S14networking Running /etc/runit-core/S14networking restart is deprecated because it may not re-enable some interfaces ... (warning). Reconfiguring network interfaces...Killed old client process Internet Systems Consortium DHCP Client 4.4.1 Copyright 2004-2018 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/bridge0/9e:86:de:ae:3f:7b Sending on LPF/bridge0/9e:86:de:ae:3f:7b Sending on Socket/fallback DHCPRELEASE of 192.168.34.108 on bridge0 to 192.168.34.2 port 67 Internet Systems Consortium DHCP Client 4.4.1 Copyright 2004-2018 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/bridge0/9e:86:de:ae:3f:7b Sending on LPF/bridge0/9e:86:de:ae:3f:7b Sending on Socket/fallback DHCPDISCOVER on bridge0 to 255.255.255.255 port 67 interval 7 DHCPOFFER of 192.168.34.108 from 192.168.34.2 DHCPREQUEST for 192.168.34.108 on bridge0 to 255.255.255.255 port 67 DHCPACK of 192.168.34.108 from 192.168.34.2 bound to 192.168.34.108 -- renewal in 1584 seconds. done.Thank you all!
-
AuthorPosts
- You must be logged in to reply to this topic.