Ask Your Question

For whatever reason, I need to run "systemctl restart network" after I login in order for everything to run smoothly. What do I need to do to automate this?

asked 2015-01-21 20:05:51 -0500

GobleSt gravatar image

I have a XEN bridge and for my networking and VM network to work correctly I need to do this. I do not want to troubleshoot the issue just automate the running of the command.

edit retag flag offensive close merge delete



I imagine you'd have to troubleshoot it to, at least, find out why it's doing that; no?

ILMostro gravatar imageILMostro ( 2015-01-21 23:04:20 -0500 )edit

work around is fine with me. I have other things to work on. :-)

GobleSt gravatar imageGobleSt ( 2015-01-22 08:33:39 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-22 03:43:08 -0500

sideburns gravatar image

As root, create the file /etc/rc.d/rc.local if it doesn't already exist, and put that command in it. A very simple form of the file might look like this:


systemctl restart network

Then use chmod to make it executable, like this

chmod o+x /etc/rc.d/rc.local

Systemctl is supposed to activate rc-local.service whenever it finds that file, but it can't hurt to make sure:

systemctl enable rc-local.service

This will restart your network at the very end of boot but before you log in. As ILMostro points out, finding out why this is happening would be better, but at least this should make things easier until you do.

edit flag offensive delete link more


Thanks for that. Will try now. Just FYI, when entering "systemctl enable rc-local.service" the response is: The unit files have no [Install] section....

GobleSt gravatar imageGobleSt ( 2015-01-22 08:23:21 -0500 )edit

Looks like that did the trick. Much better than spending any more hours troubleshooting. Thanks!

GobleSt gravatar imageGobleSt ( 2015-01-22 08:31:18 -0500 )edit

Don't forget to accept the answer, GobleSt!

bitwiseoperator gravatar imagebitwiseoperator ( 2015-01-22 11:34:43 -0500 )edit

Question Tools

1 follower


Asked: 2015-01-21 20:05:51 -0500

Seen: 5,483 times

Last updated: Jan 22 '15