1

I have a Raspberry Pi 3 running a webserver on Ubuntu Snappy Core 16, and I'm usind dynamic DNS to address to my IP. I use NO-IP for a free dynamic DNS and it requires an update every 30 days or it expires. They offer packages for their own Dynamic DNS Update Client, but as far as I know, I'm not able to install these programs with the Snappy Core. My router doesn't support this, so I can't setup it that way.

Is there a way to setup these scheduled updates with Snappy Core 16? Still a bit new with these systems so simpler solutions are preferred.

1 Answers1

1

First of all, you can still use their dynamic update client on Ubuntu Core, just download their tarball and use the pre-built binaries out of it.

If that wasn't good enough for you, it would be incredibly easy to make a snap out of it. Create a snapcraft.yaml file, fill it out like so:

name: dynamic-update-client
version: 2.1.9snap1
summary: No-IP dynamic DNS update client
grade: stable
confinement: strict
description: |
  Dynamic DNS Update Client continually checks for IP address changes in the
  background and automatically updates the DNS at No-IP whenever it changes.

apps:
  noip2:
    command: noip2
    plugs: [network, network-bind]

parts:
  dynamic-update-client:
    plugin: make
    source: https://www.noip.com/client/linux/noip-duc-linux.tar.gz
    source-subdir: noip-2.1.9-1
    artifacts: [noip2] # Otherwise it tries to configure while building
    build-packages: [gcc, libc6-dev]
    organize:
      noip2: bin/

and run snapcraft on it.

kyrofa
  • 7,346
  • 1
  • 32
  • 26
  • Thanks for your reply. I tried to get the tarball before, but hit a wall since I didn't find a way to download it. wget is not avaliable on core 16 as far as I'm aware. Is there alternative for it? I'll try if the snapcraft method works when I have the time. – Make465213 Dec 06 '16 at 20:40
  • 1
    There is a way to get classic tools on the core image, but I'm not 100% sure how on the new images (I'll check and get back to you). However, you can always wget on a classic machine and scp over. – kyrofa Dec 06 '16 at 20:57
  • Yes the scp should work for my case, so I can try both solutions, if I have issues with either. – Make465213 Dec 06 '16 at 21:13
  • 1
    Alright, here's how you can get a classic environment on Ubuntu Core: sudo snap install classic --devmode --edge will get you the required snap, and sudo classic will get you into a new shell with the ability to use apt, etc. – kyrofa Dec 06 '16 at 21:15
  • Okay so I tried the solutions and didn't get far. It seems that I'm unable to do this without enabling the classic mode.

    Solution 1: I installed the classic mode and required packages to make the install. However I didn't manage to do this this way as it errors when I try to build it.

    (classic)myusername@localhost:/usr/local/src/noip-2.1.9-1$ sudo make

    gcc -Wall -g -Dlinux -DPREFIX="/usr/local" noip2.c -o noip2 noip2.c:136:19: fatal error: stdio.h: No such file or directory compilation terminated. Makefile:25: recipe for target 'noip2' failed make: *** [noip2] Error 1

    – Make465213 Dec 10 '16 at 13:35
  • Solution 2: I was able to create and install the snap, but I can't get it running because I'm unable to configure it. myusername@localhost:~$ dynamic-update-client.noip2 Can't locate configuration file /usr/local/etc/no-ip2.conf. (Try -c). Ending! myusername@localhost:~$ sudo dynamic-update-client.noip2 -C -c noip2.conf Auto configuration for Linux client of no-ip.com. Can't create config file (noip2.conf) Permission denied – Make465213 Dec 10 '16 at 16:12
  • You shouldn't have to compile the tarball-- just use the precompiled binaries out of the binaries directory. Also, snaps are very confined regarding where they can write files, see Where can Ubuntu snaps write data for more information. You might have to customize the snap a little to your needs. – kyrofa Dec 10 '16 at 16:57