script execution on halt
Thanks to masonm, I was able to get my PCMCIA nic configured right when I boot my laptop. It has to do with files not being deleted on shutdown. I wrote a small script that I need to execute on shutdown:
cd /etc/dhcpc mv -f dhcpcd-eth0.cache dhcpcd-eth0.cache.bak mv -f dhcpcd-eth0.info dhcpcd-eth0.info.bak mv -f dhcpcd-eth0.pid dhcpcd-eth0.pid.bak Now I just need to figure out how to make this script auto-execute when I log out (I tried putting it in /etc/rc.d/rc.6 and it didn't work right). Any ideas on how to do that? |
Assuming by "logout" you mean "shutdown", you need to put the script (or more preferably, a symlink to it) in the /etc/rc.d/rc0.d directory as well.
|
Where did you put it in rc.6? Location within the script would be everything, as you'd need to execute the commands after the network is shutdown but prior to the filesystem being unmounted.
|
I did mean shutdown. I put the following lines after the dhcpcd shutdown in /etc/rc.d/rc.6:
rm /etc/dhcpc/dhcpcd-eth0.cache rm /etc/dhcpc/dhcpcd-eth0.info rm /etc/dhcpc/dhcpcd-eth0.pid This worked for a couple boots-then I couldn't get online again. I commented out the lines and am back to executing the script manually when I successfully get an IP address. |
How about it this way.
create script like this called /etc/rc.d/init.d/dhcp_cleanup Code:
#!/bin/bash Now make a softlink to your rc6.d ' ln -s /etc/rc.d/init.d/dhcp_cleanup /etc/rc.d/rc6.d/K50dhcp_cleanup ' If not needed why not delete them instead of renaming. Brian1 " Google the Linux way @ http://www.google.com/linux " |
All times are GMT -5. The time now is 11:04 PM. |