Results 1 to 4 of 4

Thread: Sudo command on startup

  1. #1
    Join Date
    Jul 2009
    Location
    California
    Beans
    261
    Distro
    Kubuntu 19.10 Eoan Ermine

    Sudo command on startup

    I'm trying to configure my wireless network so it activates on booting up. Adding ndiswrapper to /etc/modules only causes GNOME to freeze and since I have no idea on how to fix it, I was forced to find another solution. I soon realized that the network worked after running sudo modprobe ndiswrapper. So I would like to know if anyone knows of a way to run that command on startup applications or any other way. The reason it won't work under startup applications is that sudo prompts for a password, which I can't enter upon loging in. I tried adding modprobe and ndiswrapper to sudoers, but that didn't work. This is what my sudoers file looks like:

    Code:
    # /etc/sudoers
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # See the man page for details on how to write a sudoers file.
    #
    
    Defaults        env_reset
    
    # Host alias specification
    
    # User alias specification
    
    # Cmnd alias specification
    Cmnd_Alias TEST = /sbin/modprobe; /usr/sbin/ndiswrapper
    
    # User privilege specification
    root    ALL=(ALL) ALL
    
    # Uncomment to allow members of group sudo to not need a password
    # (Note that later entries override this, so you might need to move
    # it further down)
    # %sudo ALL=NOPASSWD: ALL
    
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL
    
    Defaults:myname timestamp_timeout=1
    myname ALL=(ALL) NOPASSWD: TEST
    Last edited by Buuntu; August 4th, 2009 at 11:06 PM.

  2. #2
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Sudo command on startup

    Try putting your commands, without sudo, into /etc/rc.local (/etc/rc.local runs as root, last, during boot)
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  3. #3
    Join Date
    Jul 2009
    Location
    California
    Beans
    261
    Distro
    Kubuntu 19.10 Eoan Ermine

    Re: Sudo command on startup

    That worked! Thanks . Just out of curiosity, do you know why adding ndiswrapper to /etc/modules would cause the system (or GNOME) to crash?

  4. #4
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Sudo command on startup

    I have no idea =)

    My guess is it has to do with the order (during the boot process) of when the modules are added. Adding ndiswrapper into /etc/modules causes ndiswrapper to load before something, most likely networking, is ready.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •