/usr/local/etc/rc.d/optware.sh start
/usr/local/etc/rc.d/optware.sh: line 1: ptware: not found
/opt/etc/init.d/S99pyload: line 2: ad: not found
pyLoad 0.4.9: try to start
pyLoad 0.4.9: Daemon PID 4283
pyLoad 0.4.9: successfully started
/opt/etc/init.d/S99pyload start
/opt/etc/init.d/S99pyload: line 2: ad: not found
pyLoad 0.4.9: try to start
pyLoad 0.4.9: Daemon PID 7469
pyLoad 0.4.9: successfully started
#!/bin/sh
##########################################################################
# pyLoad STARTUP and UPDATE SCRIPT for Synology NAS
# AUTOSTART pyLoad as DAEMON - UPDATE PROGRAM FILES
# <./S99pyload info> for more details and help
##########################################################################
PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin
SYNO=/usr/syno/bin
DAEMON="python /opt/share/pyload/pyLoadCore.py --daemon"
DAEMON_OPTS="--debug"
QUIT="python /opt/share/pyload/pyLoadCore.py --quit"
STATUS="python /opt/share/pyload/pyLoadCore.py --status"
VERSION="python /opt/share/pyload/pyLoadCore.py --version"
RELEASE_SRC="https://bitbucket.org/spoob/pyload/get/v0.4.8.zip" #edit v0.4.8.zip if a new release is out there!
UPDATE_SRC="https://bitbucket.org/spoob/pyload/get/tip.zip"
LOG="/volume1/public/.pyload/Logs/log.txt" #your path to the Logfile here!
SCRN=/opt/etc/init.d/S99pyload
##########################################################################
# COMMANDS START
##########################################################################
start()
{
echo "`$VERSION`: try to start"
echo "`$VERSION`:" `$DAEMON`
sleep 2
if [ `$STATUS` -gt 3 ]; then
echo "`$VERSION`: successfully started"
else
`$DAEMON`
fi
}
##########################################################################
stop()
{
echo "`$VERSION`: try to kill myself"
echo "`$QUIT`"
}
##########################################################################
setup()
{
echo "pyLoad: installing latest stable release - only run once!"
cd /opt/; $SYNO/wget --no-check-certificate -q $RELEASE_SRC
if [ $? -eq 0 ] ; then
echo "pyLoad: successfully loaded latest stable release"
else
setup
fi
unzip -q spoob-pyload*.zip; rm spoob-pyload*.zip
if [ $? -eq 0 ] ; then
echo "pyLoad: archive unzipped and removed"; sleep 2
else
setup
fi
mv spoob-pyload* pyload
if [ $? -eq 0 ] ; then
cd /opt/share/pyload/
python pyLoadCore.py -s
else
setup
fi
}
##########################################################################
update()
{
# if [ `$STATUS` -gt 3 ]; then
stop; sleep 5;
# fi
echo "UPDATE: updating `$VERSION`"
echo "`date '+%d.%m.%Y %T'` INFO Updating `$VERSION`" >>$LOG
cd /opt/
$SYNO/wget --no-check-certificate -q $UPDATE_SRC
if [ $? -eq 0 ] ; then
echo "UPDATE: successfully loaded dev version"
else
update
fi
unzip -q spoob-pyload*.zip; rm spoob-pyload*.zip
if [ $? -eq 0 ] ; then
echo "UPDATE: archive unzipped and removed"; sleep 2
else
update
fi
$SYNO/rsync -qr /opt/spoob-pyload-*/ /opt/share/pyload/
if [ $? -eq 0 ] ; then
echo "UPDATE: `$VERSION` successfully updated"
else
update
fi
rm -rf /opt/spoob-pyload-*/
echo "`date '+%d.%m.%Y %T'` INFO Update complete" >>$LOG
start
}
##########################################################################
stable()
{
if [ `$STATUS` -gt 3 ]; then
stop; sleep 5;
fi
echo "`$VERSION`: installing latest stable release"
mkdir pyload_tip; cd /opt/share/pyload/; cp -r * /opt/pyload_tip/
cd /opt/
$SYNO/wget --no-check-certificate -q $RELEASE_SRC
if [ $? -eq 0 ] ; then
echo "`$VERSION`: successfully loaded latest stable release"
else
stable
fi
unzip -q spoob-pyload*.zip; rm spoob-pyload*.zip
if [ $? -eq 0 ] ; then
echo "`$VERSION`: archive unzipped and removed"; sleep 2
else
stable
fi
$SYNO/rsync -qr /opt/spoob-pyload-*/ /opt/share/pyload/
if [ $? -eq 0 ] ; then
echo "`$VERSION`: successfully installed"
else
stable
fi
rm -rf /opt/spoob-pyload-*/
start
}
##########################################################################
debug()
{
if [ `$STATUS` -gt 3 ]; then
echo "`$VERSION`: already performing ... restart"
stop
sleep 5
debug
else
echo "`$VERSION`: try to start in debug mode + show output"
echo "`$VERSION`:" `$DAEMON $DAEMON_OPTS`
sleep 2
if [ `$STATUS` -gt 3 ]; then
echo "`$VERSION`: successfully startet in debug mode"
echo ""
echo "***** ctrl + c to STOP OUTPUT and return *****"
echo ""
tail -f $LOG
else
`$DAEMON $DAEMON_OPTS`
fi
fi
}
##########################################################################
info()
{
if [ `$STATUS` -gt 3 ];
then
echo "`$VERSION`: Process ID is `$STATUS`"
echo ""
echo -e '\e[33m####################################################################\e[0m'
echo -e '\e[33m# OPERATIONS\e[0m'
echo -e '\e[33m# start = start pyLoad (default)\e[0m'
echo -e '\e[33m# stop = stop pyLoad\e[0m'
echo -e '\e[33m# restart = stop and start pyLoad\e[0m'
echo -e '\e[33m# setup = install pyLoad **only run at the first time**\e[0m'
echo -e '\e[33m# stable = run the latest stable version\e[0m'
echo -e '\e[33m# update = update program files\e[0m'
echo -e '\e[33m# debug = enable debug mode + output\e[0m'
echo -e '\e[33m# info = print out PID and status of pyLoad\e[0m'
echo -e '\e[33m# show = print out Logfile while executing\e[0m'
echo -e '\e[33m####################################################################\e[0m'
else
echo "`$VERSION`: process is NOT active"
fi
}
##########################################################################
show()
{
start
while [ `$STATUS` -gt 3 ]; do
echo ""
echo "***** ctrl + c to STOP OUTPUT and return *****"
echo ""
tail -f $LOG
done
}
##########################################################################
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 5
start
;;
setup)
setup
;;
stable)
stable
;;
update)
update
;;
debug)
debug
;;
info)
info
;;
show)
show
;;
*)
echo "Usage: $SCRN (start|stop|restart|setup|stable|update|debug|info|show)" >&2
exit 1
;;
esac
exit 0
##########################################################################
# End of script
##########################################################################
# optware setup
# Alternatives Optware Startup und Shutdown Script #/usr/local/etc/rc.d/optware.sh
#
case $1 in
start)
[ ! -h /opt -a ! -d /opt ] && ln -s /volume1/@optware /opt
for i in /opt/etc/init.d/S??* ;do
#
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
#
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
;;
#
stop)
#
for i in /opt/etc/init.d/S??* ;do
#
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
#
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set stop
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i stop ;;
esac
done
;;
#
*)
echo "Usage: $0 [start|stop]"
;;
esac
#
# End
sh optware.sh start
Traceback (most recent call last):
File "/opt/share/pyload/pyLoadCore.py", line 43, in <module>
from module.plugins.AccountManager import AccountManager
File "/volume1/@optware/share/pyload/module/plugins/AccountManager.py", line 26, in <module>
from module.utils import chmod, lock
ImportError: cannot import name chmod
: try to start
Traceback (most recent call last):
File "/opt/share/pyload/pyLoadCore.py", line 43, in <module>
from module.plugins.AccountManager import AccountManager
File "/volume1/@optware/share/pyload/module/plugins/AccountManager.py", line 26, in <module>
from module.utils import chmod, lock
ImportError: cannot import name chmod
Traceback (most recent call last):
File "/opt/share/pyload/pyLoadCore.py", line 43, in <module>
from module.plugins.AccountManager import AccountManager
File "/volume1/@optware/share/pyload/module/plugins/AccountManager.py", line 26, in <module>
from module.utils import chmod, lock
ImportError: cannot import name chmod
:
Traceback (most recent call last):
File "/opt/share/pyload/pyLoadCore.py", line 43, in <module>
from module.plugins.AccountManager import AccountManager
File "/volume1/@optware/share/pyload/module/plugins/AccountManager.py", line 26, in <module>
from module.utils import chmod, lock
ImportError: cannot import name chmod
sh: 3: unknown operand
Traceback (most recent call last):
File "/opt/share/pyload/pyLoadCore.py", line 43, in <module>
from module.plugins.AccountManager import AccountManager
File "/volume1/@optware/share/pyload/module/plugins/AccountManager.py", line 26, in <module>
from module.utils import chmod, lock
ImportError: cannot import name chmod
python /opt/share/pyload/pyLoadCore.py
Traceback (most recent call last):
File "/opt/share/pyload/pyLoadCore.py", line 43, in <module>
from module.plugins.AccountManager import AccountManager
File "/volume1/@optware/share/pyload/module/plugins/AccountManager.py", line 26, in <module>
from module.utils import chmod, lock
ImportError: cannot import name chmod
Hallo,
klappt denn der direkte Aufruf?
/opt/share/pyload/pyLoadCore.py --daemon
Wenn der Fehler immer noch auftritt scheint Deine Installation im Eimer zu sein.
Gruß Götz
Hallo,
rm -R /opt/share/pyload
Gruß Götz
Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.
Als Dankeschön schalten wir deinen Account werbefrei.