I am writing a C++ program. I am developing on Fedora, but it will be run on a wide variety of distros. At some point, it needs to restart the network. Before the advent of systemd, one would have issued the command:
/etc/init.d/network restart
or perhaps
/etc/init.d/networking restart
I have noticed that on some systemd systems, the network is implemented through NetworkManager. Someone told me that when systemd is in use, the network is always implemented through NetworkManager, but I have found that sometimes it somehow still involves /etc/init.d/network instead.
Once my program figures out that systemd is in use, how can it figure out how to restart the network, given that the network is implemented in a variety of ways on different systems?
/etc/init.d/network restart
or perhaps
/etc/init.d/networking restart
I have noticed that on some systemd systems, the network is implemented through NetworkManager. Someone told me that when systemd is in use, the network is always implemented through NetworkManager, but I have found that sometimes it somehow still involves /etc/init.d/network instead.
Once my program figures out that systemd is in use, how can it figure out how to restart the network, given that the network is implemented in a variety of ways on different systems?