You are not logged in.

#1 2005-07-05 08:03:48

gojamiegirl
Member
From: Pacific Beach, CA
Registered: 2005-07-05
Posts: 19
Website

Cannot Kill DHCPCD

Hello

I just cannot figure this one out on my own, I know it's a big post, I hope I didn't confuse smile

My problem is that I cannot kill dhcpcd, as it seems to not be running.  I don't seem to be able to release my IP address. 

[jamie@beetlemeyer ~]$ sudo dhcpcd -k
Password:
****  dhcpcd: not running

It gives the same response even if  I put "dhcpcd -k eth0 | wlan0"

I have a D-Link dwl-122 which connects to D-link Dl-524.  I have the same problems on all my Arch machines, like my laptop, an HP ze4610us. 

I can connect just fine and made a script to handle some things for me as other ways of handling Arch wireless confuse me.  I included it here, just in case.

You may notice I also have problems w/ Gnome + network that I work around, I'll save that for another post smile

#================================================================
# This is my profile config file, of course with the wep key Xed out
# file location: /home/jamie/Kinetic/nattie/Profiles/home
# profile=home

PRIVACY=true
DEF_KEY=0
RESTRICTED=true
SSID=gnbnet
KEY=xx:xx:xx:xx:xx
AUTH=sharedkey

#==================================================
# Here's my (not finished but mostly working) script:
   (part of which is from another post, thanks Corneliax)
#===================================================

#!/bin/bash
# nattie  # my niece
# Version: 0.2
# Completed: 7/4/05
# requires the wlan-ng26 arch package

#================================================================

PROF_LOC=/home/jamie/Kinetic/nattie/Profiles
POST_CONNECT=/home/jamie/Kinetic/nattie/post_connect

#================================================================

USAGE ()
{
echo -e "n    usage: `basename $0` -h|-p [profile]|-w [start|stop]n
-h          display usage
-p profile  use the profile entered
-w action   use settings for wired connectionn"
exit
}

#========================

WIRED ()
{
/etc/rc.d/network $ACTION
}

#========================

WIRELESS ()
{
      . $PROF_LOC/$PROFILE

####LOAD MODULE
#modprobe prism2_usb prism2_doreset=1

# This line will fail, and slows the script, but without it gnome won't work
#
/etc/rc.d/network start

ifconfig eth0 up

####RESET CARD
wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable

####SETUP FOR WEP AND THEN CONNECT
wlanctl-ng wlan0 lnxreq_hostwep decrypt=true encrypt=true
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKeyID=$DEF_KEY
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11ExcludeUnencrypted=$RESTRICTED
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11PrivacyInvoked=$PRIVACY
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey0=$KEY
wlanctl-ng wlan0 lnxreq_autojoin ssid="$SSID" authtype=$AUTH

####DHCP
dhcpcd wlan0
}

#================================================================
if
    while
      getopts "hp:w" options; do
        case $options in
         h ) USAGE;;
            p ) PROFILE=$OPTARG && WIRELESS;;
            w ) WIRED && ACTION=$OPTARG
        esac
    done
[[ ! -z $* ]]
then :  # do nothing and branch ahead
else

    echo "  Press Enter To Exit"
    read ready
    exit 0
fi

#================================================================
# If online, run post_connect

IP=`/sbin/ifconfig | grep 'inet addr'  | cut -d: -f2 | cut -d " " -f1 | grep -v '127.0.0.1'`
if
   echo $IP | grep '[bd{1,3}.d{1,3}.d{1,3}.d{1,3}b]' &>/dev/null
then
   . $POST_CONNECT
fi

# hey, don't make fun of my script, I said I wasn't finished smile
# And thank you everybody that makes Arch so cool and helps me

Offline

#2 2005-07-05 15:01:11

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Cannot Kill DHCPCD

this is a router issue - if your router's DHCP leases are set to infinite/forever/a jillion days (whatever the actual setting is), then dhcp will not remain running as there is no need to refresh or free the lease... switch the lease to like 10 hours or something fairly long and it should work fine (you can also override it on dhcpcd command line with "-l <lease in seconds>" where "-l 0xffffffff" is infinite)

PS there's about 6 different wireless script implementations, and the official version is in the testing repo, which I would recommend vs writing your own implementation

Offline

#3 2005-07-05 23:43:13

gojamiegirl
Member
From: Pacific Beach, CA
Registered: 2005-07-05
Posts: 19
Website

Re: Cannot Kill DHCPCD

Thank You Phrakture

Of course, ...you were correct.  I knew it was something like that.  See what happens when you don't RTFM!

I actually had my router set for 2 hr. leases because I had read this before, but *apparently* I never actually made sure it was giving 2 hour leases.  The -l option on dhcpcd made it work just fine...  and thanks for letting me know about the wireless scripts in testing.

Offline

#4 2005-07-06 15:05:21

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Cannot Kill DHCPCD

No problem, always happy to help (when I'm not blathering like a fool wink )

Offline

Board footer

Powered by FluxBB