SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a Router with Slackware 10 running. I just changed from Debian to Slackware and I don't know much about the Slackware init style by now. I have an DynDNS account and want to update my IP with DDClient. I copied the executable to /usr/sbin and the ddclient.conf to /etc. Works great. Now I don't want to do that manually, but have that done whenever a new internet conncection is established/IP changes. I also have a cronjob running which disconnects and reconnects twice a day, so a call to /sbin/ddclient in rc.local wouldn't do the job. Unfortunately I have no clue where to place the call instead.
Sorry for the stupid question. Must be really easy, but can't figure it out right now.
Could you not just run the DDClient after the cronjob that disconnects and reconnects you? Alternatively you could pipe your address into a file and check periodically to see if your current address matches the one in the file, if it does not then update the file and call DDClient. But this would still effectively be a cron job.
@Cedrik:
Thanks for the fast reply. I placed a simple /usr/sbin/ddclient at the end of rc.inet2, but i doesn't work. It doesn't run it ?!?. I also couldn't find anything in the logs..
@Mephisto:
I also thought about to run it after the cronjob, but sometimes I have to manually close the internet connection for maintenance and so on.. In that cases I would still have to call ddclient by hand..
Originally posted by Lars79 @Cedrik:
Thanks for the fast reply. I placed a simple /usr/sbin/ddclient at the end of rc.inet2, but i doesn't work. It doesn't run it ?!?. I also couldn't find anything in the logs..
@Mephisto:
I also thought about to run it after the cronjob, but sometimes I have to manually close the internet connection for maintenance and so on.. In that cases I would still have to call ddclient by hand..
what commands do you use to restart your connection? You could alias the command. Better yet why don't you create a bash script for when you manually close/start the connection that does whatever you need to do then calls ddclient.
If you can get the script working on load you should be set. I tend to suggest rc.local since it is the last thing called and is meant for your local specific scripts, but whatever works for you.
what commands do you use to restart your connection?
I normally use the simple adsl-stop and adsl-start. Even the cronjob does a simple
adsl-stop; sleep 60; adsl-start
You could alias the command. Better yet why don't you create a bash script for when you manually close/start the connection that does whatever you need to do then calls ddclient.
Hm, that's a good idea. But the problem is that when the connection is terminated f.e. by accident (provider problem, whatever), it will connect again on demand. I don't know how to get an alias to work with that.
I tend to suggest rc.local since it is the last thing called and is meant for your local specific scripts, but whatever works for you.
I actually have an adsl-start in rc.local. If I could get it to work whenever a connection is established no matter how, ddclient would be run automatically.
I really appreciate your suggestions, but for the different possibilities to connect (connection at startup, manually connect and disconnect, connection on demand) I would really like a solution with an init script, because that is always run and I don't have to worry about the connection type.
I can't think of a solution then. Manually connecting and disconnecting is one thing, If the program automatically reconnects you I can't think of a way to know when that hapens. At best you could do a cron job as I mentioned above.
What about an ip-up script in /etc/ppp?
Thanks, sounds interesting. So far I don't have an ip-up or ip-up.local file in /etc/ppp. Would it be enough to just create the file and place the command in it, or ist there something else I had to do? Thanks =).
Edit: That works =). Thanks a lot. I just had to create the file, chmod it 755 and that's it.
My first project to learn a little BASH was to hack pppsetup so that it will set up dynamic DNS and simplify setup, so I had to study up on ppp. BTW if you are using dynamic DNS you might alos put a 'ping' line(5min) in ip-up so that it will maintain the connection.
BTW if you are using dynamic DNS you might alos put a 'ping' line(5min) in ip-up so that it will maintain the connection.
Also a good idea, thanks. But I have MLDonkey running on the router and there's enough traffic to keep the connection alive =). But the ip-up and ip-down scripts are really helpfull. I also placed a call to the MLDonkey start script in ip-up and a call to the stop script in ip-down. Works great =)..
Lars79, one suggestion. when you are quoting somebody use [ QUOTE ] the message you are quoting [/ QUOTE ] taking out the spaces I added inside the brackets. This makes the message a little easier to read as to what you are quoting and what your response is.
Lars79, one suggestion. when you are quoting somebody use [ QUOTE ] the message you are quoting [/ QUOTE ] taking out the spaces I added inside the brackets. This makes the message a little easier to read as to what you are quoting and what your response is.
You're right =), sorry for that. I didn't notice the Quote button.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.