Thursday, June 13, 2013

Changing nice level for transmission-daemon

Raspberry Pi has rather limited CPU power, so I wanted to reduce the priority of the transmission-daemon.
To do that I found that we can modify /etc/init.d/transmission-daemon script to add the --nicelevel option as below:

start_daemon () {
    if [ $ENABLE_DAEMON != 1 ]; then
        log_progress_msg "(disabled)"
                log_end_msg 255 || true
    else    
        start-stop-daemon --start \
        --nicelevel 5 \
        --chuid $USER \
                $START_STOP_OPTIONS \
        --exec $DAEMON -- $OPTIONS || log_end_msg $?
                log_end_msg 0
    fi
}