You are not logged in.
netctl works fine, but I'd like to start it after login, instead of during boot. netctl-auto fails with some permission problems. netctl uses sudo, I think. So is there a way I can get it to start after boot, perhaps by adding it to my xinitrc? Or should I consider some other tool, like wicd?
Last edited by murukesh (2013-06-12 05:34:21)
Offline
Why do you think it uses sudo?
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Because when I run it manually, this happens:
[bro3886@~] $ netctl start belkin
[sudo] password for bro3886:
[bro3886@~] $
Offline
Regardless of the utility, network operations require root privileges. networkmanager and wicd handle this by running a daemon as root, and an applet as user. netctl handles it by requiring you to use root privileges.
If you want to run it within a user session, you will have to use sudo - but to be clear, netctl does not use sudo by default. The response you posted comes from your sudo configuration, not from netctl.
Offline
Ah.
I'm not that familiar with the sudo config, but if I were to add a NOPASSWD line in sudoers for netctl, it'd work fine?
Offline
Nope. Adding a NOPASSWD line to sudoers didn't help. Now I get this error:
[bro3886@~] $ netctl start belkin
sudo: sorry, you are not allowed to preserve the environment
code 1
I should sleep on this.
Offline
Instead of sleeping on it, how about you read the documentation? I think that might be the better plan here. Both sudo and its configuration file, visudo, have ver well dosumented man pages. Sleeping is not going to bring this information to you I don't think.
Offline
Meditating might also help ... or praying, consulting a shaman, starring into tea leaves.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
At least if you talk to a shaman, and he is a shaman/sys admin, then maybe you might actually get an answer...
Offline
funny but sleep may help if he has been working on it a while and needs eyes and mind that is fresh.
the real question is what would be the purpose of running it as a user and more importantly why. it seems to me it would put all kinds of security issues. why not put in your bash file something like alias
wifi='sudo wifi-menu'
or use netctl and disable all profiles and start them when needed like using an alias like
home='sudo start netctl home'
all you will have to do is type home and password.
Last edited by dag (2013-06-12 03:05:42)
--------------------------------------
alcoves wonder creates the wonder unto the ages; never lose that.
Offline
Aliases are what I assume the murukesh must have. I actually do have these aliases as well, but if I get this if I run it wil the full path w/o root access:
% /usr/bin/netctl enable profile1
netctl needs root privileges
Offline
wouldnt it work if you put in visudo
user host= NOPASSWD: /usr/bin/netctl
and then in bash file use sudo (it seems to need it) but it wont ask for password, or use the full command.
Last edited by dag (2013-06-12 04:36:57)
--------------------------------------
alcoves wonder creates the wonder unto the ages; never lose that.
Offline
Yes it would, but the OP was being encouraged to do his own research by reading the docs. But I guess now he has the answer.
Offline
wouldnt it work if you put in visudo
user host= NOPASSWD: /usr/bin/netctl
and then in bash file use sudo (it seems to need it) but it wont ask for password, or use the full command.
I tried that, but that's when I get the error about preserving the environment.
[bro3886@~] $ sudo netctl start belkin
sudo: sorry, you are not allowed to preserve the environment
code 1
Note that, if I have a NOPASSWD tag for netctl, this error is thrown irrespective of whether I call sudo or netctl calls sudo.
I'm trying to see how fast I can get Arch to boot, and the biggest bottleneck is netctl connecting to my home wifi. That's why I'm trying to move netctl to post-login.
I would add it to my bashrc, but it would require me to type my password twice upon login, wouldn't it?
Offline
maybe this will help
I would add it to my bashrc, but it would require me to type my password twice upon login, wouldn't it?
no
--------------------------------------
alcoves wonder creates the wonder unto the ages; never lose that.
Offline
maybe this will help
murukesh wrote:I would add it to my bashrc, but it would require me to type my password twice upon login, wouldn't it?
no
I feel extremely stupid. Just after my reply I thought of checking for aliases. There were aliases for both netctl and sudo. Using the full paths and the NOPASSWD option, things are working fine. Boot time reduced to 15.6s from 20. Thanks, all of you!
Offline