Re: /etc/init.d/update-hostname and Networkmanager.
On Fri, Mar 11, 2011 at 05:20:47PM +0100, Andreas Schockenhoff wrote:
> Hi,
>
> in /etc/init.d/update-hostname we try to set the hostname for the
> workstations .... from DNS Server.
>
> This can not work because Networkmanager is not started.
>
> First I try to move update-hostname behind start
> /etc/rc2.d/S23network-manager but this does not solve the problem.
>
> This hack does work. It waits until tjener(dns) can be reached and then
> update. Really ugly or?
>
> do_start() {
> FLAGS=""
> [ "$VERBOSE" != no ] && log_action_begin_msg "Updating hostname from
> DNS"
> while ! ping -c 1 tjener.intern ; do "$UPDATE" -q ; done &
> ES=$?
> if [ "$VERBOSE" != no ] ; then
>
> Any better ideas?
Why not put the update-hostname script to /etc/network/ip-up.d/ ?
It will then be called as soon as network-manager (or ifup)
assigns an address to the client.
Regards
-Klaus
Reply to: