Quote:
Originally Posted by d_K
...the problem there however: restarting a service needs root privileges...maybe just put in cron with "@reboot", I'd rather not have to type out my pw on every reboot.
|
You can add a line to
/etc/sudoers to allow you to restart the service without needing a password. Obviously some caution is needed when editing the
sudoers file. Use
visudo to add the following to the tail end of
sudoers for the user "dk" as a line by itself:
Code:
dk ALL=(root:root) NOPASSWD: /bin/systemctl restart network-manager.service
Read the manual page for
sudoers to see the meaning and, again, be sure to use
visudo to ensure that at least the syntax is correct.
Then the code in your script could be the following:
Code:
#!/bin/sh
sleep 20
sudo /bin/systemctl restart network-manager.service
About changing the boot order, changing the boot order in systemd seems (to me) to be a tangled mess. You'll have to get an overview by generating a graph using
systemd-analyze plot > startup.svg and then examining the resulting file
startup.svg to see where network-manager.service might possibly be moved. Then fiddle with the value for "After=" in the network-manager.service file.