Hallo, danke für deine Lösung.
Ich habe nur ein kleines Problem wegen dem Autostart. Derzeit starten bei mir diverse Plugins und Scripte nicht über die Autostart Datei sondern von einem Ordner "init.d".
Dort sind diverse Dateien wie S10pyload, S20oscam Die Autostart Datei habe ich modifiziert wie es im Qnap Forum beschrieben ist. Somit muss ich an der Autorun.sh nicht viel verändern,
wenn ein neuer Dienst hinzukommt sondern einfach unter "init.d" eine neues Startscript einfügen und die Sache ist erledigt. Allerdings wie mache ich es in diesem Fall.
Derzeit meine Autostart.sh im Ordner /share/MD0_DATA/.qpkg/autorun/autorun.sh
#!/bin/sh
#Determine optware directory and symlink it to /opt
for optwaredirexists in `ls -d /share/* | grep "_DATA" | sort`
do
#optware was determined
if [ -d ${optwaredirexists%/}/.qpkg/Optware ]; then
OPTWARE=${optwaredirexists%/}/.qpkg/Optware
#optware is already symlinked
if [ -h /opt ]; then
#symlinked but wrong directory
if [ $(readlink "/opt") != ${OPTWARE} ]; then
rm -Rf /opt
ln -sf ${OPTWARE} /opt
fi
#optware is a directory
elif [ -d /opt ]; then
rm -Rf /opt
ln -sf ${OPTWARE} /opt
#optware does not exist
else
ln -sf ${OPTWARE} /opt
fi
fi
done
#execute if OPTWARE was determined
if [ ! -z ${OPTWARE} ]; then
#set environment variables
SET_ENV_VARS="/opt/bin:/opt/sbin:/usr/local/bin:/usr/local/sbin"
export PATH=$PATH:$SET_ENV_VARS
echo "export PATH=$PATH" >> /etc/profile
#load libs if directory exists
if [ -d /opt/lib ]; then
echo "/opt/lib" >> /etc/ld.so.conf
/sbin/ldconfig
fi
#Starting Optware daemons and create shutdown rcK symlink (starting at K200)
#if directory /opt/etc/init.d exists
if [ -d /opt/etc/init.d ]; then
#if directory is not empty
if [ "$(ls -A "/opt/etc/init.d")" ]; then
I=200
for optdaemon in `ls /opt/etc/init.d/S* | grep -v '~' | sort`
do
#execute only if init script is executable
if [ -x ${optdaemon} ]; then
${optdaemon} start
#create symlink in rcK.d to shutdown the daemon
ln -s ${OPTWARE}/etc/init.d/${optdaemon##*/} /etc/rcK.d/K${I}${optdaemon##*/}
I=$(($I+1))
fi
done
fi
fi
fi
Hier starte ich zum Beispiel Oscam, diese Datei ist in /share/MD0_DATA/.qpkg/Optware/etc/init.d/S10oscam
oder hier starte ich zum Beispiel Pyload, die Datei ist in /share/MD0_DATA/.qpkg/Optware/etc/init.d/S20pyload#!/bin/sh start()
{
echo "Starting "
/mnt/HDA_ROOT/.config/cs/bin/oscam -b -c /mnt/HDA_ROOT/.config/cs/etc
}
stop()
{
echo "Shutting down "
killall -9 oscam
}
# you do not need to edit this lines
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
# Restarting the Daemon
$0 stop
$0 start
;;
*)
## If no parameters are given, print which are avaiable.
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
#!/bin/sh
start()
{
echo "Starting "
/opt/pyload/pyLoadCore.py --configdir=/opt/etc/pyload --daemon
}
stop()
{
echo "Shutting down "
/opt/pyload/pyLoadCore.py --configdir=/opt/etc/pyload --quit
}
# you do not need to edit this lines
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
# Restarting the Daemon
$0 stop
$0 start
;;
*)
## If no parameters are given, print which are avaiable.
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
Geht das auch mit dem Copybefehl? Bitte um Hilfe
@winklernorbert28
@shadow18
Bezüglich der upsyec Geschichte die 90%+ CPU Load verursachen könnte.
Für alle jene welche mit init.d Scripts arbeiten, legt ein neues Script mit diesem Inhalt an:
#!/bin/bash
#ups_yec workaround
#
COUNT=0
MAXWAIT=60
while (( COUNT <= MAXWAIT ))
do
NUM=$(ps -ef | grep -c "ps_yec")
if (( NUM == 0 ))
then
sleep 1
(( COUNT++ ))
else
/sbin/daemon_mgr ups_yec stop "/sbin/ups_yec &"
rm -f /tmp/ups_temp
echo "#!/bin/sh" > /sbin/ups_yec
break
fi
done
Solltet Ihr mit der autorun.sh arbeiten, einfach die selben Zeilen dort rein.
Das ganze wurde hier schon mal erwähnt, finde es nur nicht mehr und habs aus meiner QNAP rausgekramt
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?
Wir verwenden Cookies und ähnliche Technologien für folgende Zwecke:
Akzeptieren Sie Cookies und diese Technologien?