neocturne / fastd

Fast and Secure Tunnelling Daemon
Other
119 stars 16 forks source link

Broken init script? #14

Closed xnoreq closed 3 years ago

xnoreq commented 4 years ago

Hello, using fastd21 on openwrt master.

/etc/init.d/fastd start results in

Syntax: /etc/init.d/fastd [command]

Available commands:

        show_key        shows the public keys of the instances given as
                        additional arguments
        generate_key    generates the private keys for the instances given as
                        additional arguments and saves them in the configuration
                        (when there in no key configured yet)
        running         Check if service is running
        status          Service status
        trace           Start with syscall trace

as does /etc/init.d/fastd start myinstance, or restart, or enable.

xnoreq commented 4 years ago

The problem is with directly setting EXTRA_COMMANDS, which overwrites all default commands that rc.common adds.

Here's the fixed portion:

#!/bin/sh /etc/rc.common
# Copyright (c) 2012-2020, Matthias Schiffer <mschiffer@universe-factory.net>

set -o pipefail

START=95

USE_PROCD=1

extra_command 'up' 'up?'
extra_command 'down' 'down?'
extra_command 'show_key' 'shows the public keys of the instances given as additional arguments'
extra_command 'generate_key' 'generates the private keys for the instances given as additional arguments and saves them in the configuration (when there in no key configured yet)'
#EXTRA_COMMANDS='up down show_key generate_key'
neocturne commented 4 years ago

Hmm, I think this was broken by a recent commit in OpenWrt master (https://github.com/openwrt/openwrt/commit/1a69f50dc627f6fc5860f871edec357cc0a187e6 seems like a likely candidate). I'll also look into fixing the backwards compatibility in OpenWrt.

neocturne commented 4 years ago

Will be fixed by https://github.com/openwrt/openwrt/pull/3598

xnoreq commented 4 years ago

Yeah, that's the issue and your commit should fix the unnecessary breakage of backwards compatibility. Thanks.