On 08/10/2011 01:46 AM, "Jóhann B. Guðmundsson" wrote:
On 08/08/2011 11:41 AM, Radek Vykydal wrote:
NM is started by systemd before anaconda writes out initial ifcfg files
which results in creating of automatic default connections (e.g.
"Wired connection 1"). The settings of auto connections are not
persistent
so we are ok just restarting the NM.
Just going to point out systemd path units that might be able to take
care of this for you and you can save your self few lines of code in
anaconda unfortunetly ( yet ) it only supports starting a service thus
you need to *work around* that limitation by creating an additional
unit which you would call from the path unit
So an example unit files for this would be.. ( node that unit name
match thus no need for Unit= in the path file )
# network-restart.path
[Unit]
Description=Restarting NetworkManager When Config files are in place
[Path]
PathChanged=/etc/sysconfig/network-scripts
# network-restart.service
[Unit]
Description=Restarting NetworkManager
[Service]
Type=oneshot
ExecStart=/bin/systemctl restart NetworkManager
RemainAfterExit=yes
man systemd.path for details...
Thanks for the tip, but I don't think this is something that should
be done using new systemd unit. We just simply need to restart
NM service at the right time. I am not sure if it is even possible
in our case, because
1) we want to restart NM exactly after *all* initial ifcfg files (i.e.
for all
network devices) are created, I suppose creating each of the files in
the path would trigger the restart.
2) we want to do it only once - after the NM restart ifcfg files will be
modified in process of network configuration (by anaconda and nm-c-e
/NM, NM itself is using inotify on the ifcfg)
Radek
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list