Hallo,
wie schon in der Überschrift beschrieben habe ich ein kleineres Problem mit nice / vdr.
Ich habe 2 VDR und einen Server mit Debian Squeeze und den e-Tobi Repositoties aufgebaut.
Damit der VDR auf den Server wartet und den auch startet, wenn er mal nicht laufen sollte, habe ich das Startscript etwas angepasst ( siehe unten )
Soweit funktioniert auch alles ganz gut, nur der nice Befehl klappt irgendwie nicht richtig.
Beim Starten wird die Priorität zwar geändert, aber wenn ich mit top nachschaue ist Sie wieder auf 0 - wie geht das????
Wenn mir da mal jemand einen Tip geben könnte wäre ich echt dankbar.
Gruß
badekap
VDR-Start :
Code
root@vdr:~# /etc/init.d/vdr restart
Restarting Linux Video Disk Recorder: vdr
Searching for plugins (VDR 1.7.18/1.7.18) (cache miss): remotetimers mplayer dvd mp3 image clock xine skinenigmang epgsearch conflictcheckonly epgsync femon dvbsddevice epgsearchonly svdrpservice quickepgsearch fritzbox sysinfo1814: old priority 0, new priority -10
.
top :
Code
root@vdr:~# top
top - 12:47:02 up 5 min, 1 user, load average: 0.20, 0.30, 0.15
Tasks: 132 total, 1 running, 131 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.2%sy, 0.2%ni, 99.4%id, 0.0%wa, 0.0%hi, 0.2%si, 0.0%st
Mem: 2057756k total, 163332k used, 1894424k free, 6468k buffers
Swap: 370680k total, 0k used, 370680k free, 68828k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1956 vdr 20 0 184m 42m 8012 S 2 2.1 1:08.36 vdr
1976 root 20 0 2464 1184 896 R 1 0.1 0:00.88 top
224 root 20 0 0 0 0 S 0 0.0 0:00.04 scsi_eh_1
1 root 20 0 2032 708 612 S 0 0.0 0:01.22 init
2 root 20 0 0 0 0 S 0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0 0.0 0:00.00 ksoftirqd/0
Alles anzeigen
VDR-Startscript :
Code
#! /bin/bash -p
#
# vdr start-stop script
#
### BEGIN INIT INFO
# Provides: vdr
# Required-Start: $remote_fs $network $syslog $portmap
# Required-Stop: $remote_fs $network $syslog $portmap
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts the Linux Video Disk Recorder (VDR)
# Description: Starts the Linux Video Disk Recorder (VDR),
# if it is enabled in /etc/default/vdr.
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=vdr
DESC="Linux Video Disk Recorder"
DAEMON=/usr/sbin/runvdr
PIDFILE=/var/run/runvdr.pid
VDRPRG=/usr/bin/vdr
NWZAELER=0
test -x $DAEMON || exit 0
test -x $VDRPRG || exit 0
. /usr/lib/vdr/config-loader.sh
# Set shutdown command
test "$ENABLE_SHUTDOWN" = "1" && VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown.wrapper" \
|| VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown-message"
. /usr/lib/vdr/plugin-loader.sh
. /usr/lib/vdr/commands-loader.sh
clean_console()
{
if [ "$KEYB_TTY" != "" ]; then
tput -Tlinux clear > $KEYB_TTY
fi
}
configure_console_input()
{
if [ "$KEYB_TTY" != "" ]; then
clean_console
echo -e "This tty is currently mapped to VDR, keypresses aren't echoed.\r" > $KEYB_TTY
echo -n "For a login prompt switch to another console." > $KEYB_TTY
REDIRECT="< $KEYB_TTY"
if [ "$KEYB_TTY_SWITCH" = "1" ]; then
chvt `echo "$KEYB_TTY" | sed "s/\/dev\/tty//"`
fi
fi
}
get_status()
{
if start-stop-daemon --start --startas $DAEMON --test \
--name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
then
echo " - is not running."
exit 3
else
echo " - is running."
exit 0
fi
}
startvdr()
{
if [ "$ENABLED" != "0" ] ; then
# only start vdr if there is no other instance running
while [ ! -w /media/video/.update ] ; do
echo " VDR-Server wird aufgeweckt " >> /var/log/syslog
wakeonlan 00:0f:ea:e9:6e:2c
echo $NWZAELER "Sekunden wartezeit auf Server " >> /var/log/syslog
let NWZAELER=$NWZAELER+1
sleep 1
if nc -z 192.168.1.250 2049 ; then
mount -a
fi
if [ $NWZAELER -gt 60 ] ; then
echo " Server nicht verfügbar - starte ohne Server " >> /var/log/syslog
break
fi
done
if start-stop-daemon --start --startas $DAEMON --test \
--name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
then
getplugins
mergecommands "commands"
mergecommands "reccmds"
configure_console_input
if [ "$VFAT" == "1" ]; then
OPTIONS="--vfat $OPTIONS"
fi
if [ -n "$LIRC" ]; then
LIRC_OPT="--lirc=$LIRC"
else
LIRC_OPT="--lirc"
fi
start-stop-daemon --start --quiet --startas $DAEMON --background \
--name $(basename $DAEMON) --pidfile $PIDFILE --make-pidfile -- \
-v $VIDEO_DIR -c $CFG_DIR -L $PLUGIN_DIR -r $REC_CMD \
-s $VDRSHUTDOWN -E $EPG_FILE -u $USER -g /tmp \
--port $SVDRP_PORT $LIRC_OPT $PLUGINS $OPTIONS $REDIRECT
else
echo -n " - seems to be running already"
fi
else
echo -n " - aborted (to enable the daemon, edit /etc/default/vdr)"
fi
renice -n -5 ` ps h -o pid -C vdr `
}
stopvdr()
{
if start-stop-daemon --stop --retry 30 \
--name $(basename $DAEMON) --pidfile $PIDFILE >/dev/null
then
start-stop-daemon --stop --retry 30 --oknodo --exec $VDRPRG >/dev/null
rm -f $PIDFILE
clean_console
else
echo -n " - seems not to be running"
fi
}
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
startvdr
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
stopvdr
echo "."
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
stopvdr
sleep 4
startvdr
echo "."
;;
status)
echo -n "Getting status of $DESC: $NAME"
get_status
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
Alles anzeigen