I solved it creating this script in
/etc/NetworkManager/dispatcher.d/02knockd.sh (owned by root:root and
with u=rwx,og=rx permissions):

#!/bin/bash

set -o nounset

declare iface="${1:-}"
declare event="${2:-}"

case "$event" in
  up|vpn-up)
    if ! pidof knockd >/dev/null; then
     service knockd start 2>&1
    fi
    ;;
  down|vpn-down|hostname|dhcp4-change|dhcp6-change) ;;
  *)
          echo "$0: called with unknown action \`$2'" 1>&2
    exit 1
    ;;
esac

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/837954

Title:
  knockd service fails to start when connecting with NetworkManager

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/knockd/+bug/837954/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to