|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Apr 2003
Città: Italia, Cesena
Messaggi: 269
|
Ubuntu 10.04: cambiare priorità a mldonkey con nice
Ciao,
ho un serverino con mldonkey installato: parte automaticamente ma vorrei cambiare la priorità col comando "nice". Non riesco però a capire dov'è in init il comando che lo fa partire: sapreste darmi una mano? grazie
__________________
ciao Michele |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
se parli di mldonkey-server
/etc/init.d/mldonkey-server http://packages.ubuntu.com/lucid/i38...erver/filelist |
|
|
|
|
|
#3 | |
|
Member
Iscritto dal: Apr 2003
Città: Italia, Cesena
Messaggi: 269
|
Quote:
Quello che ho dentro /etc/init.d/mldonkey-server è riportato sotto per intero. C'è un punto in cui richiama nice (rosso grassetto) ma non capisco come dargli il valore di niceness Codice:
#!/bin/sh # # Original file : # Written by Miquel van Smoorenburg <[email protected]>. # Modified for Debian GNU/Linux # by Ian Murdock <[email protected]>. # # Version: @(#)skeleton 1.9.1 08-Apr-2002 [email protected] # # # This file has been rewritten by Sylvain Le Gall <[email protected]> # and Samuel Mimram <[email protected]> for the mldonkey package. # ### BEGIN INIT INFO # Provides: mldonkey-server # Required-Start: $network # Required-Stop: $network # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Server for the mldonkey peer-to-peer downloader. # Description: Server for the mldonkey peer-to-peer downloader. ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=mlnet EXEC=/usr/bin/$NAME DESC="MLDonkey" CONFIG=/etc/default/mldonkey-server PIDDIR=/var/run/mldonkey PIDFILE=$PIDDIR/$NAME.pid LOGFILE=/var/log/mldonkey/mldonkey-server.log SERVERLOG=/var/log/mldonkey/mlnet.log test -e $CONFIG || exit 0 set -e Warn () { echo "$*" >&2 } Error () { code=$1 shift echo "." Warn "$DESC: $NAME [ERROR] $@" exit $code } StartErrorCheck () { if [ -f "$SERVERLOG" ] && tail -n 2 "$SERVERLOG" | grep -qi 'aborting' ; then Warn "$DESC: $NAME [ERROR] server start error" tail --verbose $SERVERLOG exit 1 fi } . $CONFIG # Look for the default locale if [ -f "/etc/default/locale" ]; then . /etc/default/locale export LANG fi # /var/run might be on tempfs, see #354701. if [ ! -d /var/run/mldonkey ]; then mkdir -m 755 /var/run/mldonkey fi if [ ! -d /var/log/mldonkey ]; then mkdir -m 755 /var/log/mldonkey fi if [ -n "$MLDONKEY_USER" ] && [ -n "$MLDONKEY_GROUP" ]; then chown $MLDONKEY_USER:$MLDONKEY_GROUP /var/run/mldonkey chown $MLDONKEY_USER:$MLDONKEY_GROUP /var/log/mldonkey fi WRAPPER_OPTIONS="--iosched idle" # Set configuration value, from CONFIG if [ -n "$MLDONKEY_USER" ] && [ -n "$MLDONKEY_GROUP" ]; then WRAPPER_OPTIONS="$WRAPPER_OPTIONS --chuid $MLDONKEY_USER:$MLDONKEY_GROUP" fi if [ -n "$MLDONKEY_DIR" ]; then WRAPPER_OPTIONS="$WRAPPER_OPTIONS --chdir $MLDONKEY_DIR" fi if [ -n "$MLDONKEY_GROUP" ]; then WRAPPER_OPTIONS="$WRAPPER_OPTIONS --group $MLDONKEY_GROUP" fi if [ -n "$MLDONKEY_UMASK" ]; then WRAPPER_OPTIONS="$WRAPPER_OPTIONS --umask $MLDONKEY_UMASK" fi if [ -n "$MLDONKEY_NICENESS" ]; then WRAPPER_OPTIONS="$WRAPPER_OPTIONS --nicelevel $MLDONKEY_NICENESS" fi case "$1" in start|force-start) echo -n "Starting $DESC: $NAME" if [ "x$LAUNCH_AT_STARTUP" != "xtrue" ] && [ "x$1" = "xstart" ]; then Error 0 "configuration file prevent $NAME to be started (use force-start)." fi if [ -z "$MLDONKEY_DIR" ] || [ ! -d "$MLDONKEY_DIR" ]; then if [ -z "$MLDONKEY_DIR" ]; then MLDONKEY_DIR="(unset)" fi Error 1 "$MLDONKEY_DIR is not a valid directory." fi if [ ! -f "$MLDONKEY_DIR/downloads.ini" ]; then Error 1 "$MLDONKEY_DIR/downloads.ini is not a valid file." fi USER=`/usr/bin/stat --format="%U" "$MLDONKEY_DIR/downloads.ini"` WRAPPER_OPTIONS="$WRAPPER_OPTIONS --user $USER" start-stop-daemon --start $WRAPPER_OPTIONS \ --pidfile $PIDFILE --background --exec $EXEC \ -- -log_file $SERVERLOG -pid $PIDDIR 2>&1 StartErrorCheck echo "." ;; stop) echo -n "Stopping $DESC: $NAME" start-stop-daemon --stop --oknodo --pidfile $PIDFILE --retry 30 echo "." ;; force-reload|restart) $0 stop $0 start ;; *) Error 1 "Usage: $0 {start|stop|restart|force-reload|force-start}" ;; esac exit 0
__________________
ciao Michele |
|
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Dec 2008
Messaggi: 341
|
Ad occhio, ti direi di controllare il file puntato dalla variabile $CONFIG, il cui contenuto viene incluso ad un certo punto dello script.
__________________
My PC: Q6600 @ 3.2 Ghz - Asus P5K - 2 Gb DDR2 OCZ - Geforce 8800GTS 512 - Samsung 400GB Sata
|
|
|
|
|
|
#5 | |
|
Member
Iscritto dal: Apr 2003
Città: Italia, Cesena
Messaggi: 269
|
Quote:
__________________
ciao Michele |
|
|
|
|
|
|
#6 |
|
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
hai valorizzato la variabile:
MLDONKEY_NICENESS ? |
|
|
|
|
|
#7 |
|
Member
Iscritto dal: Apr 2003
Città: Italia, Cesena
Messaggi: 269
|
No...non ho idea di come si faccia: non me la cavo tanto bene con Linux!
__________________
ciao Michele |
|
|
|
|
|
#8 |
|
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
proverei:
a aggiungere alla cima dello script: MLDONKEY_NICENESS=<valore di nice> |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 21:04.



















