Ja neviem ja tam mám toto:Palo M. napísal:Mrkol som na ubuntacky balik a vyzera velmi podobne ako Debianovsky.matob napísal:Ja neviem našiel som to tam kde si vravel : etc/init.d/boinc-client
no neviem jedina uzitocna informacia ma napada ze po instalacii z repozitara, som si boinc nastavil
ako startup proces v sessions.
V /etc/init.d/boinc-client je toho omnoho viac, ako ty pises (a prave to v mojom subore vobec nie je), to ma trochu zmiatlo, ale uz som sa zorientoval. Inak je to tak famozne urobene, ze tento skript konkretne netreba vobec menit, ale je k nemu konfigurak /etc/default/boinc-client, ktory jediny staci editovat (napriklad sa da zmenit cesta na binarku, ak mas niekde nakopirovanu novsiu verziu, ako je ta z distribucie).
Ked si pozries ten /etc/default/boinc-client, malo by tam byt (ak si nieco neupravil):Nastavenie displeja urobis tak, ze na koniec tohto /etc/default/boinc-client pripises:Kód: Vybrať všetko
# This file is /etc/default/boinc-client, it is a configuration file for the # /etc/init.d/boinc-client init script. # Set this to 1 to enable and to 0 to disable the init script. ENABLED="1" # Set this to 1 to enable advanced scheduling of the BOINC client and all its # sub-processes (reduces the impact of BOINC on the system's performance). SCHEDULE="1" # The BOINC core client will be started with the permissions of this user. BOINC_USER="boinc" # This is the data directory of the BOINC core client. BOINC_DIR="/var/lib/boinc-client" # This is the location of the BOINC core client, that the init script uses. # If you do not want to use the client program provided by the boinc-client # package, you can specify here an alternative client program. #BOINC_CLIENT="/usr/local/bin/boinc_4.25" BOINC_CLIENT="/usr/bin/boinc_client" # Here you can specify additional options to pass to the BOINC core client. # Type 'boinc --help' or 'man boinc' for a full summary of allowed options. #BOINC_OPTS="--allow_remote_gui_rpc" BOINC_OPTS=""
Musis to samozrejme editovat ako administrator (napriklad pomocou sudo).Kód: Vybrať všetko
# Set display for graphical applications: DISPLAY=:0 export DISPLAY
Po restarte boincu by mal displej platit. Kontrolna otazka: Ako restartujes boinc?
Kód: Vybrať všetko
#! /bin/sh
### BEGIN INIT INFO
# Provides: boinc_client
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: BOINC core client
# Description: core client for the BOINC distributed computing
# infrastructure
### END INIT INFO
# Debian init.d script for the BOINC core client
# Copyright © 2005, 2006, 2007, 2008
# Debian BOINC Maintainers <[email protected]>
#
# This file is licensed under the terms of the GNU General Public License,
# Version 2 or any later version published by the Free Software Foundation.
set -e
. /lib/lsb/init-functions
# Default values for the variables that are also set in the defaults file.
ENABLED=0
SCHEDULE=0
BOINC_USER=boinc
BOINC_DIR=/var/lib/boinc-client
BOINC_CLIENT=/usr/bin/boinc_client
# Source defaults file. Edit that file to configure this script.
if [ -e /etc/default/boinc-client ]; then
. /etc/default/boinc-client
fi
# Quit quietly, if $ENABLED is 0.
test "$ENABLED" != "0" || exit 0
if [ "$BOINC_CLIENT" = "/usr/bin/boinc_client" ]; then
test -x "$BOINC_CLIENT" || exit 0
elif [ ! -x "$BOINC_CLIENT" ]; then
log_failure_msg "BOINC client '$BOINC_CLIENT' does not exist or is not" \
"executable."
exit 5
fi
if [ ! -d "$BOINC_DIR" ]; then
log_failure_msg "BOINC data directory '$BOINC_DIR' does not exist."
exit 6
fi
if [ -z "$BOINC_USER" ]; then
log_failure_msg "BOINC_USER variable is empty. Set it to a user to run" \
"the BOINC core client."
exit 6
fi
PIDFILE=/var/run/boinc_client.pid
DESC="BOINC core client"
NAME=`basename $BOINC_CLIENT`
BOINC_OPTS="--check_all_logins --redirectio --dir $BOINC_DIR $BOINC_OPTS"
is_running()
{
retval=1
if [ -r $PIDFILE ]; then
pid=`cat $PIDFILE`
if [ -e /proc/$pid ]; then
procname=`/bin/ps h -p $pid`
[ -n "$procname" ] && retval=0
fi
fi
return $retval
}
start()
{
log_begin_msg "Starting $DESC: $NAME"
if is_running; then
log_progress_msg "already running"
else
start-stop-daemon --start --quiet --background --pidfile $PIDFILE \
--make-pidfile --user $BOINC_USER --chuid $BOINC_USER \
--chdir $BOINC_DIR --exec $BOINC_CLIENT -- $BOINC_OPTS
fi
log_end_msg 0
if [ "$SCHEDULE" = "1" ]; then
schedule
fi
}
stop()
{
log_begin_msg "Stopping $DESC: $NAME"
if ! is_running; then
log_progress_msg "not running"
else
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
--user $BOINC_USER --exec $BOINC_CLIENT
fi
rm -f "$BOINC_DIR/lockfile"
rm -f $PIDFILE
log_end_msg 0
}
schedule()
{
log_begin_msg "Setting up scheduling for $DESC and children:"
if ! is_running; then
log_progress_msg "$NAME not running"
else
if [ ! -x "`which ionice 2>/dev/null`" ]; then
log_progress_msg "ionice not found,"
else
if ionice -c 3 -p $pid 2>/dev/null; then
log_progress_msg "idle,"
else
log_progress_msg "ionice failed,"
fi
fi
if [ ! -x "`which schedtool 2>/dev/null`" ]; then
log_progress_msg "schedtool not found"
else
children=`ps --ppid $pid -o pid= | tr '\n' ' '`
(schedtool -n 19 -D $pid $children >/dev/null \
&& log_progress_msg "idleprio") || \
(schedtool -n 19 -B $pid $children >/dev/null \
&& log_progress_msg "batch") || \
(schedtool -n 19 -N $pid $children >/dev/null \
&& log_progress_msg "normal")
fi
fi
log_end_msg 0
}
status()
{
STATUS="Status of $DESC:"
if is_running; then
log_success_msg "$STATUS running."
if [ -x "`which schedtool 2>/dev/null`" ]; then
log_success_msg "Scheduling of $DESC:"
schedtool $pid
children=`ps --ppid $pid -o pid= | tr '\n' ' '`
if [ -n "$children" ]; then
log_success_msg "Scheduling of $DESC's children:"
schedtool $children
fi
fi
# Display $BOINC_USER's cpu_share:
uid=`id -u $BOINC_USER`
cpu_share_file="/sys/kernel/uids/$uid/cpu_share"
if [ -f "$cpu_share_file" ]; then
log_success_msg "cpu_share: `cat "$cpu_share_file"`"
fi
else
log_success_msg "$STATUS stopped."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|force-reload)
stop
sleep 1
start
;;
status)
status
;;
schedule)
schedule
;;
*)
log_success_msg "Usage: $0 {start|stop|restart|force-reload|status|schedule}" >&2
exit 1
;;
esac
exit 0
