Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: wicd restart script?

  1. #1

    Default wicd restart script?

    Hello, as the title suggests, I need a script to restart network if it loses connection.Whenever I lose signal or restart the router(the computer is connected wirelessly ) i have to "sudo rcnetwork restart" to enable network again.Can this be done automatically with a script or a configuration?

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,576

    Exclamation Re: wicd restart script?

    • Please confirm that, the system suffering this issue does not use "systemd" to handle system initialisation.


    A normal openSUSE system, which uses "systemd" to handle system initialisation, regardless of whether "Network Manager" or "Wicked" is used to configure the network interfaces, will automatically reconnect the network path if the connection drops.
    • This is a normal Linux network interface behaviour.


    Please post the customisations which have been made to the network configuration files located in "/etc/sysconfig/network/", especially in the "if-down" and "if-up" areas.

  3. #3

    Default Re: wicd restart script?

    there are too many files on that folders(if-up.d, if-down.d), which ones are needed?
    file:///etc/sysconfig/network/if-up.d/21-dhcpcd-hook-samba
    file:///etc/sysconfig/network/if-up.d/SuSEfirewall2
    file:///etc/sysconfig/network/if-up.d/55-samba-winbindd
    file:///etc/sysconfig/network/if-up.d/avahi-daemon
    file:///etc/sysconfig/network/if-up.d/avahi-autoipd
    file:///etc/sysconfig/network/if-down.d/21-dhcpcd-hook-samba
    file:///etc/sysconfig/network/if-down.d/55-samba-winbindd
    file:///etc/sysconfig/network/if-down.d/avahi-autoipd

  4. #4

    Default Re: wicd restart script?

    The only change I've made to network, is adding manual dns(google ones) to the resolv.conf file, because after switching from NM to wicd, I couldn't use the browser.

  5. #5
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,576

    Default Re: wicd restart script?

    Quote Originally Posted by hara75gr View Post
    there are too many files on that folders(if-up.d, if-down.d), which ones are needed?
    If no customisations have been made then, none.

    Please take a look at the openSUSE Reference Guide Chapter 13 "Basic Networking", Section 13.4 "Configuring a Network Connection with YaST", Sub-Section 13.4.1.2.5 "Activating the Network Device"
    <https://doc.opensuse.org/documentati....basicnet.yast>

    I suspect that, given "Wicked", you need the activation option "On Cable Connection". The YaST help is a bit more informative as to the behaviour of the activation options than the content of the Reference Guide.

  6. #6

    Default Re: wicd restart script?

    Basically I'm "on cable connection" and I've tried every other option available(and I've read the guide).
    My computer is connected wirelessly via a usb adapter, a tp-link wn722n(Qualcomm Atheros AR9271 802.11n, Driver: "ath9k_htc") if that matters.

  7. #7
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,576

    Default Re: wicd restart script?

    Then, and especially for the case of a WiFi (WLAN) connection, I can only recommend "Network Manager" instead of "Wicked" -- there's also the advantage that, the data needed to access the WLAN (passwords and so on . . . ) will be stored on a per-user basis in a "KWallet" wallet.

    Please be aware that, the default wallet "kdewallet" has to be setup before beginning to setup the "Network Manager" WLAN access point(s).
    • My recommendation for the wallet used to store the WLAN connection data ("kdewallet") is to use "Blowfish" encryption for that wallet with an empty wallet password.

  8. #8

    Default Re: wicd restart script?

    I was on NM but I had random disconnects several times. Wicked is rock solid, never loses connection, I only need to manually rcnetwotk restart in case I restart router. I think I'll stay with wicked, but I just need it to restart automatically. I was thinking of a cron script, pinging the router, and restarting network service in case of disconnection, but I've never wrote a script before.

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,795

    Default Re: wicd restart script?

    It should reconnect when your router comes back. When not, you should try to solve that instead of restarting the whole network.

    And rc... isn't the way to do it nowadays in the systemd world (though it may still work for backwards compatibility, but who knows for how long).
    Henk van Velden

  10. #10
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,704
    Blog Entries
    1

    Default Re: wicd restart script?

    Quote Originally Posted by hara75gr View Post
    Basically I'm "on cable connection" and I've tried every other option available(and I've read the guide).
    My computer is connected wirelessly via a usb adapter, a tp-link wn722n(Qualcomm Atheros AR9271 802.11n, Driver: "ath9k_htc") if that matters.
    You could monitor wicked in a terminal window using
    Code:
    sudo journalctl -fu wicked
    and observe the messages when disconnection takes place.

    I'm wondering is USB power management is causing problems here

    It is possible to write a custom udev rule to prevent a particular device from being auto-suspending (if that is the cause of the problem)...
    https://forums.opensuse.org/showthre...35#post2786435
    * You can use 'lsusb' to get the vendor and product IDs.

Page 1 of 2 12 LastLast

Posting Permissions

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