New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qubes setup ip hook never fires #2720

Closed
Rudd-O opened this Issue Mar 20, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@Rudd-O

Rudd-O commented Mar 20, 2017

Qubes OS version (e.g., R3.2):

R3.2

Affected TemplateVMs (e.g., fedora-23, if applicable):

Standard fedora 24.

Setup-ip snippet:

    network=$(qubesdb-read /qubes-netvm-network 2>/dev/null)
    if [ "x$network" != "x" ] && [ "x$disabledns" != "x1" ]; then
        gateway=$(qubesdb-read /qubes-netvm-gateway)
        netmask=$(qubesdb-read /qubes-netvm-netmask)
        primary_dns=$(qubesdb-read /qubes-netvm-primary-dns 2>/dev/null || echo $gateway)
        secondary_dns=$(qubesdb-read /qubes-netvm-secondary-dns)
        echo "NS1=$primary_dns" > /var/run/qubes/qubes-ns
        echo "NS2=$secondary_dns" >> /var/run/qubes/qubes-ns
        /usr/lib/qubes/qubes-setup-dnat-to-ns
    fi
    if [ "x$network" != "x" ]; then
        if [ -x /rw/config/qubes-ip-change-hook ]; then
            /rw/config/qubes-ip-change-hook
        fi
        # XXX: Backward compatibility
        if [ -x /rw/config/qubes_ip_change_hook ]; then
            /rw/config/qubes_ip_change_hook
        fi
    fi
fi

This happens when run:

[root@engineering user]# qubesdb-read /qubes-netvm-network
Failed to read /qubes-netvm-network

Since that fails, the comparison x$network fails, then the ip change hook never fires.

What gives?

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 20, 2017

Member

That is expected:

/rw/config/qubes-ip-change-hook - script run in NetVM after external IP change (or connection to the network)

Lack of /qubes-netvm-network clearly means this isn't NetVM.

Member

marmarek commented Mar 20, 2017

That is expected:

/rw/config/qubes-ip-change-hook - script run in NetVM after external IP change (or connection to the network)

Lack of /qubes-netvm-network clearly means this isn't NetVM.

@marmarek marmarek closed this Mar 20, 2017

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 20, 2017

OK. How do I run something when the resolv.conf stuff is written? I need to append to it.

Rudd-O commented Mar 20, 2017

OK. How do I run something when the resolv.conf stuff is written? I need to append to it.

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 20, 2017

Also, can the answer be documented?

Rudd-O commented Mar 20, 2017

Also, can the answer be documented?

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

unman Mar 21, 2017

Member

@Rudd-O What is it you want to do? And where?

Member

unman commented Mar 21, 2017

@Rudd-O What is it you want to do? And where?

@Rudd-O

This comment has been minimized.

Show comment
Hide comment
@Rudd-O

Rudd-O Mar 21, 2017

Rudd-O commented Mar 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment