Digital Eliteboard - Das Digitale Technik Forum

Registriere dich noch heute kostenloses um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereiche, welche für Gäste verwehrt bleiben

FritzBox 7390 Freetz OpenVPN startet nicht

kabelek

Newbie
Registriert
4. Juni 2013
Beiträge
3
Reaktionspunkte
0
Punkte
21
Herzlich Willkommen.

Ich nehme an, weil meine Hände fallen etwa bereits, ich kann es nicht helfen.

Ich an den Router FritzBox 7390 internationale Version kompiliert Freetz Firmware'''' und ich kann nicht auf FREETZU'''' laufen "OpenVPN" alle anderen Plugins arbeiten wie Samba, Getriebe, und ein paar andere und OpenVPN nicht kämpfen, den anderen Tag.
Ich kam, um das, dass irgendwo etwas muss in configach sein zu verbessern, aber nicht wissen, wo kann mir jemand helfen:

Wenn Sie versuchen, starten immer diese Meldung:

ln: /mod/sbin/openvpn: File exists
Starting openvpn ... could not execute openvpn, failed.
You may get some more hints by starting openvpn w/o "--daemon":
openvpn --config /mod/etc/openvpn.conf


Beginnen Sie nicht.

Normalerweise sieht openvpn.config wie folgt aus:
Das Hotel liegt in
: /mod/etc/openvpn.conf

# OpenVPN 2.1 Config, Fri May 9 15:49:16 CEST 2014
proto udp
dev tun
dev-node /dev/tun
secret /tmp/flash/openvpn/static.key
remote 125.56.589.52 123
nobind
ifconfig 192.168.200.1 192.168.200.2
tun-mtu 1500
mssfix
log /var/tmp/debug_openvpn.out
verb 3
cipher BF-CBC
comp-lzo
keepalive 10 120
resolv-retry infinite
cd /var/tmp/openvpn
chroot /var/tmp/openvpn
user openvpn
group openvpn
persist-tun
persist-key

rc.openvpn befindet sich unter:
/etc/init.d/rc.openvpn
und sieht wie folgt aus:


#!/bin/sh

scriptname=$0
DAEMON=${scriptname##*/rc.}
. /etc/init.d/modlibrc

mypidof() {
ps -w | sed -n "/\/m[o]d\/etc\/${1}.conf/ s/^[ ]*\([0-9]*\)[ ].*/\1/ p"
}

config(){
if [ -r "/tmp/flash/openvpn/own_${DAEMON}.conf" ]; then
cp /tmp/flash/openvpn/own_${DAEMON}.conf /mod/etc/${DAEMON}.conf
else
modlib_config ${DAEMON} /mod/etc/${DAEMON}.conf
fi
}

start() {
cp -f /etc/resolv.conf /tmp/openvpn/etc
cp -f /etc/TZ /tmp/openvpn/etc
mknod -m 444 /tmp/openvpn/dev/urandom c 1 9 2>/dev/null
for file in $(echo ${OPENVPN_FILES2CP#*#} | tr ';#' '\n\n'); do
if [ ! -r $file ]; then # not a full path? Try to find a binary
fullpath=$(which $file);
[ ! x = x$fullpath ] && file=$fullpath
fi
if [ -r $file ]; then
mkdir -p /tmp/openvpn${file%/*}
cp -a $file /tmp/openvpn${file%/*}
else
echo "Copying files to chroot. File $file not found. Skipped"
fi
done

trap 'echo -e "You may get some more hints by starting ${DAEMON} w/o \"--daemon\":\n\t$DAEMON --config /mod/etc/${DAEMON}.conf"' EXIT
modlib_startdaemon ${DAEMON} --config /mod/etc/${DAEMON}.conf --writepid /var/run/${DAEMON}.pid --daemon
trap - EXIT

# if we have brctl, then try to add tap to "lan" if requestet (ignore errors)
if [ $(which brctl) ] && TAP=$(grep "#Helperline" /mod/etc/${DAEMON}.conf | grep -o tap[0-9] ); then
brctl addif lan $TAP 2> /dev/null
fi
}


stop() {
echo -n "Stopping ${DAEMON} ... "
PID=$(mypidof $DAEMON)

if [ -z "$PID" ]; then
echo "not running."
return 1
fi

kill $PID > /dev/null 2>&1
exitval=$?

if [ "$exitval" -eq 0 ]; then
echo 'done.'
else
echo 'failed.'
exit $exitval
fi

rm -f /var/run/${DAEMON}.pid
}


if [ ! -e /var/tmp/.openvpnfirstrun ]; then
touch /var/tmp/.openvpnfirstrun
/mod/etc/default.openvpn/openvpn_dynamic_conf
fi
[ -x /mod/sbin/$DAEMON ] || ln -s /usr/sbin/openvpn /mod/sbin/$DAEMON

case $1 in
""|load)
if [ "$DAEMON" = "openvpn" ]; then
modreg cgi 'openvpn' 'OpenVPN'
modreg daemon openvpn
modreg extra openvpn 'Verbundene Clients' 2 "openvpn_clients"
modreg file openvpn 'box_crt' 'Box Cert' 0 "box_crt"
modreg file openvpn 'box_key' 'Private Key' 0 "box_key"
modreg file openvpn 'ca_crt' 'CA Cert' 0 "ca_crt"
modreg file openvpn 'crl_pem' 'CRL' 0 "crl_pem"
modreg file openvpn 'dh_pem' 'DH Param' 0 "dh_pem"
modreg file openvpn 'static_key' 'Static Key' 0 "static_key"
modlib_add_user_and_group openvpn
mkdir -p /tmp/openvpn/etc
mkdir -p /tmp/openvpn/dev
mkdir -p /tmp/flash/openvpn
[ "$OPENVPN_CONFIG_COUNT" -eq 1 -a "$OPENVPN_ENABLED" = inetd ] && /mod/etc/default.openvpn/openvpn_conf > /mod/etc/openvpn.conf
fi
if [ ! -e "/tmp/flash/openvpn/static.key" ]; then
echo -n "creating static.key ... "
openvpn --genkey --secret /tmp/flash/openvpn/static.key
/usr/bin/modsave flash >/dev/null
fi
d_BU="$DAEMON"
as="${OPENVPN_AUTOSTART#*#}"
for d in $(echo "openvpn${OPENVPN_CONFIG_NAMES#*DEFAULT#}" | sed 's/#/ openvpn_/g' ); do
TMP_ENABLE=${as%%#*}
[ -z "$TMP_ENABLE" ] && TMP_ENABLE="no"
DAEMON="$d"
DAEMON_LONG_NAME=$DAEMON
DAEMON_BIN=$DAEMON
PID_FILE=/var/run/${DAEMON_BIN}.pid
modlib_start $TMP_ENABLE
as=${as#*#}
done
DAEMON="$d_BU"
DAEMON_LONG_NAME=$DAEMON
;;
unload)
stop
if [ "$DAEMON" = "openvpn" ]; then
for d in $(echo "${OPENVPN_CONFIG_NAMES#*DEFAULT#}" | sed 's/#/ openvpn_/g' ); do
DAEMON="$d"
DAEMON_LONG_NAME=$DAEMON
stop
done
modunreg file openvpn
modunreg daemon openvpn
modunreg cgi openvpn
modunreg extra openvpn
fi
;;
start)
modlib_start
;;
stop)
stop
;;
restart)
stop
sleep 1
start
;;
reload)
if [ -r "/var/run/${DAEMON}.pid" ]; then
kill -HUP $(cat /var/run/${DAEMON}.pid)
fi
;;
status)
if [ "$OPENVPN_ENABLED" = inetd ]; then
echo "inetd"
elif [ -z "$(mypidof $DAEMON)" ]; then
echo 'stopped'
else
echo 'running'
fi
;;
*)
echo "Usage: $0 [load|unload|start|stop|restart|reload|status]" 1>&2
exit 1
;;

esac

exit 0


Und "modlibrc"

Es ist in der: / etc / init.d / modlibrc


# Shell functions for the rc-scripts in /etc/init.d/

# Reference material on init scripts:
# * Linux Standards Base Core Specification 4.0:
Du musst dich Anmelden oder Registrieren um diesen link zusehen!


# optional environment variables:
#
# name default description
# ============= ============= =============
# DAEMON <empty> default for some other variables
# DAEMON_LONG_NAME ${DAEMON} full name of daemon to display in start/stop messages
# CONF_NAME ${DAEMON} config is in /mod/etc/conf/${CONF_NAME}.cfg
# CONF_ENABLED ${DAEMON}_ENABLED variablename with starttype of daemon (yes,no,inetd) in .cfg-file
# DAEMON_CONFIG /mod/etc/${DAEMON}.conf modlib_config will generate this file
# DAEMON_BIN ${DAEMON} other binary name than $DAEMON
# DAEMON_ENV <empty> additional environment settings
# DAEMON_CHECK <empty> daemon(s) to check with pidof for running-status
# PID_FILE /var/run/${DAEMON_BIN}.pid pid-file for DAEMON

export PATH=/mod/sbin:/mod/bin:/mod/usr/sbin:/mod/usr/bin:/mod/etc/init.d:/sbin:/bin:/usr/sbin:/usr/bin
export LD_LIBRARY_PATH=/mod/lib:/mod/usr/lib

: ${DAEMON_LONG_NAME:=$DAEMON}
: ${CONF_NAME:=$DAEMON}
: ${CONF_ENABLED:=${DAEMON}_ENABLED}
: ${DAEMON_CONFIG:=/mod/etc/${DAEMON}.conf}
: ${DAEMON_BIN:=$DAEMON}
: ${PID_FILE:=/var/run/${DAEMON_BIN}.pid}

# config:
# dummy function if "config" is not defined in parent-script
config() { :; }

# startdaemon_pre:
# dummy function if "startdaemon_pre" is not defined in parent-script
startdaemon_pre() { :; }

# startdaemon_post:
# dummy function if "startdaemon_post" is not defined in parent-script
startdaemon_post() { :; }

# stop_pre:
# dummy function if "stop_pre" is not defined in parent-script
stop_pre() { :; }

# stop_post:
# dummy function if "stop_post" is not defined in parent-script
# parameter $1: return-value of stop(), 0=sucessfully
stop_post() { :; }


# modlib_addgroup:
# check for group and create it if not found.
# No check is done for a change in the optional arguments!
# $1: group name
# $2-n: optional arguments for addgroup
modlib_addgroup() {
local group=$1
shift
grep -q "^$group:" /etc/group && return 0
echo -n "Creating group '$group' ... "
local msg=$(addgroup $@ $group 2>&1)
if [ $? -eq 0 ]; then
echo -n "saving ... "
modusers save && echo "done." || echo "failed."
else
echo "failed: $msg"
exit 1
fi
}

# modlib_adduser:
# check for user and create it if not found.
# No check is done for a change in the optional arguments!
# $1: user name
# $2-n: optional arguments for adduser
modlib_adduser() {
local user=$1
shift
grep -q "^$user:" /etc/passwd && return 0
echo -n "Creating user '$user' ... "
local msg="$(adduser $@ $user 2>&1)"
if [ $? -eq 0 ]; then
echo -n "saving ... "
modusers save && echo "done." || echo "failed."
else
echo "failed: $msg"
exit 1
fi
}

# modlib_add_user_and_group:
# check for user & group and create them if not found.
# $1: user name
# $2: group name (optional)
modlib_add_user_and_group() {
local user=$1
[ $# -gt 1 ] && local group=$2 || local group=$1
modlib_addgroup $group
modlib_adduser $user -s /bin/false -D -S -H -G $group -g "$user"
}

# modlib_check_running
# checks if the daemon is currently running.
# return values:
# 0: running
# 3: stopped
# 5: inetd
# use CONF_ENABLED for other variablename with manual/automatic/inetd in .cfg-file
modlib_check_running() {
[ -n "$FORCE_STATUS" ] && return $FORCE_STATUS
if [ -x /mod/etc/init.d/rc.inetd ]; then
[ "$(eval echo \$$(echo ${CONF_ENABLED} | tr [:lower:]- [:upper:]_))" == "inetd" ] && return 5
fi
if [ -n "$DAEMON_CHECK" ]; then
for DAEMON_single in $DAEMON_CHECK; do
pidof $DAEMON_single >/dev/null 2>&1 || return 3
done
return 0
fi
local fn=$PID_FILE
[ ! -s "$fn" ] && return 3
if kill -0 $(cat "$fn") 2> /dev/null; then
return 0
else
rm -f "$fn"
return 3
fi
}

# modlib_config
# creates /mod/etc/$DAEMON.conf
# parameters:
# $1 (optional): overwrites the $DAEMON part in input filenames
# $2 (optional): overwrites output path+filename, default is $DAEMON_CONFIG (=/mod/etc/${DAEMON}.conf)
modlib_config() {
local in_files=${1-$DAEMON}
local out_file=${2-$DAEMON_CONFIG}
(
if [ -x "/tmp/flash/${in_files}_conf" ]; then
echo "### generated by /tmp/flash/${in_files}_conf"
/tmp/flash/${in_files}_conf
elif [ -x "/tmp/flash/${DAEMON}/${in_files}_conf" ]; then
echo "### generated by /tmp/flash/${DAEMON}/${in_files}_conf"
/tmp/flash/${DAEMON}/${in_files}_conf
else
/mod/etc/default.${DAEMON}/${in_files}_conf
fi
if [ -f /tmp/flash/${in_files}.extra ]; then
echo "### content of /tmp/flash/${in_files}.extra"
cat /tmp/flash/${in_files}.extra
elif [ -f /tmp/flash/${DAEMON}/${in_files}.extra ]; then
echo "### content of /tmp/flash/${DAEMON}/${in_files}.extra"
cat /tmp/flash/${DAEMON}/${in_files}.extra
fi
) > $out_file
}

# modlib_startdaemon
# starts the binary with a clean environment
# "$@": commandline to execute
# if available runs "config" of rc.$DAEMON
# use $DAEMON_BIN for other binary name than $DAEMON
# use $DAEMON_ENV for additional environment settings
modlib_startdaemon() {
echo -n "Starting ${DAEMON_LONG_NAME} ... "
config

if [ ! -x "$(which $1)" ]; then
echo "could not execute $1, failed."
exit 1
fi

startdaemon_pre
local rv_pre=$?
env - PATH="$PATH" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" $DAEMON_ENV "$@" 1>&2
local rv=$?
startdaemon_post
local rv_post=$?

if [ $rv_pre -ne 0 -o $rv -ne 0 -o $rv_post -ne 0 ]; then
echo 'failed.'
exit $rv
fi

# even daemons without pid-support creates a .pid file:
local fn=$PID_FILE
if [ ! -s "$fn" ]; then
local dp=$(pidof "$DAEMON_BIN" | sed 's/.* //')
if [ $? -ne 0 ]; then
echo 'failed.'
exit 1
fi
[ -n "$dp" ] && echo "$dp" > $fn
fi

echo 'done.'
}

# modlib_start
# decide if daemon is started in inetd mode
# function "start" has to be defined in the calling script
# $1: value for DAEMON_ENABLED
# returns: 0=success or 1=error
modlib_start() {
local DAEMON_ENABLED=$1
if [ "$DAEMON_ENABLED" == "no" ]; then
echo "${DAEMON_LONG_NAME} is disabled." 1>&2
exit 1
fi
if [ "$DAEMON_ENABLED" == "inetd" -a ! -x /mod/etc/init.d/rc.inetd ]; then
echo "WARNING: ${DAEMON_LONG_NAME} could not find inetd." 1>&2
fi

modlib_check_running
case $? in
0)
echo "Starting ${DAEMON_LONG_NAME} ... already running."
;;
3)
start
return $?
;;
5)
config
/mod/etc/init.d/rc.inetd config $DAEMON
;;
*)
echo "${DAEMON_LONG_NAME} start prohibited, status is uncertain!" 1>&2
;;
esac
return 1
}

# modlib_force_start
# forces start of the daemon
modlib_force_start() {
if [ -x /mod/etc/init.d/rc.inetd ]; then
config
/mod/etc/init.d/rc.inetd config $DAEMON
fi
modlib_start
}

# stop
# could be overwritten in parent script
stop() {
local retval=0
case "$1" in
0)
local id=$(cat "$PID_FILE" 2>/dev/null)
local cnt=9
while [ $cnt -ge 0 ] && kill -0 $id 2>/dev/null; do
kill $id 2>/dev/null
local retval=$?
sleep 1
let cnt--
done
if kill -0 $id 2>/dev/null; then
kill -9 $id 2>/dev/null
local retval=$?
sleep 1
kill -0 $id 2>/dev/null || local retval=0
fi
;;
5)
killall $DAEMON_BIN 2>/dev/null
;;
esac
return $retval
}

# modlib_stop
# stops the daemon
# kills daemon with "stop" of rc.$DAEMON if available
modlib_stop() {
local fn=$PID_FILE
local id=$(cat "$fn" 2>/dev/null)
echo -n "Stopping ${DAEMON_LONG_NAME} ... "
modlib_check_running
case $? in
0)
stop_pre
stop 0
local retval=$?
stop_post $retval
if ! kill -0 $id 2>/dev/null && [ "$retval" -eq 0 ]; then
rm -f "$fn"
echo 'done.'
else
echo 'failed.'
return $retval
fi
;;
3)
echo 'not running.'
;;
5)
stop 5
echo 'inetd instances killed, done.'
;;
*)
echo 'status unknown, failed.'
return 1
;;
esac
return 0
}

# modlib_force_stop
# forces stop of the daemon
modlib_force_stop() {
echo -n "Stopping ${DAEMON_LONG_NAME} forced ... "
FORCE_STATUS="0"
modlib_stop >/dev/null
if [ -e /mod/etc/default.$DAEMON/*.inetd ]; then
FORCE_STATUS="5"
modlib_stop >/dev/null
fi
FORCE_STATUS=""
echo 'done.'
}

# modlib_restart
# restarts the daemon
modlib_restart() {
modlib_stop
modlib_start
}

# modlib_force_restart
# forces restart of the daemon
modlib_force_restart() {
modlib_force_stop
modlib_force_start
}

# reload
# could be overwritten in parent script
reload() {
local retval=1
case "$1" in
0)
kill -HUP $(cat "$PID_FILE") 2> /dev/null
local retval=$?
;;
5)
killall -HUP $DAEMON_BIN 2>/dev/null 1>&2
local retval=0
;;
esac
return $retval
}

# modlib_reload
# reloads the daemon with SIGHUP
# if available runs "config" of rc.$DAEMON
# reloads daemon with "reload" of rc.$DAEMON if available
modlib_reload() {
local fn=$PID_FILE
echo -n "Reloading ${DAEMON_LONG_NAME} ... "
modlib_check_running
case $? in
0)
config
reload 0
local retval=$?
if [ $retval -eq 0 ]; then
echo 'done.'
return 0
else
rm -f "$fn"
echo 'failed.'
return $retval
fi
;;
3)
echo 'not running.'
;;
5)
config
reload 5
echo 'inetd.'
;;
*)
echo 'status unknown, failed.'
return 1
;;
esac
return 0
}

# modlib_status
# checks if the daemon is running
# return values:
# 0: running
# 3: stopped
# 5: inetd
# <other>: unknown
modlib_status() {
modlib_check_running
retval=$?
case $retval in
0)
echo 'running'
;;
3)
echo 'stopped'
;;
5)
echo 'inetd'
;;
*)
echo 'unknown'
;;
esac
return $retval
}

# modlib_loadconfig
# loads the configuration
modlib_loadconfig() {
local CONF_FILE="/mod/etc/conf/${1-$CONF_NAME}.cfg"
if [ ! -r "$CONF_FILE" ]; then
echo "Error [${DAEMON_LONG_NAME}]: not configured." 1>&2
exit 1
fi
. "$CONF_FILE"
}

# for each parameter passed creates symlink httpd-$parameter pointing to httpd
modlib_add_httpd_symlink() {
local HTTPD=$(which httpd)
while [[ "$1" != "" ]]; do
ln -sfn "$HTTPD" "/mod$HTTPD-$1"
shift
done
}

# load config
[ -n "$DAEMON" ] && modlib_loadconfig


Bitte helfen Sie, wenn Sie etwas anderes brauchen, schreiben Sie bitte diese Kopie.

Grüße
 
Zurück
Oben