it should be very nice to see ionice setting in /etc/conf.d/samba http://linux.die.net/man/1/ionice
Please give an example what you actually want.
I've put my ionice level manualy into the /etc/init.d/samba script. I guess it's would be great to have something like "IONICE_CLASS" (default=none) and "IONICE_PRORITY" (default=none) in /etc/conf.d/samba my /etc/init.d/samba (only thing that is different is "ionice -c 3" in front of "${cmd_exec} > /dev/null"): ###################################################### #!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /var/cvsroot/gentoo-x86/net-fs/samba-server/files/3.3/samba.initd,v 1.1 2009/06/26 20:24:11 patrick Exp $ opts="reload" depend() { after slapd need net use cupsd } DAEMONNAME="${SVCNAME##samba.}" [ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME} signal_do() { local signal="$1" [ -z "${signal}" ] && return 0 local result=0 last_result=0 daemon= cmd_exec= for daemon in ${daemon_list} ; do eval cmd_exec=\$${daemon}_${signal} if [ -n "${cmd_exec}" ]; then ebegin "${my_service_name} -> ${signal}: ${daemon}" #echo ${cmd} '->' ${!cmd} ionice -c 3 ${cmd_exec} > /dev/null last_result=$? eend ${last_result} fi result=$(( ${result} + ${last_result} )) done return ${result} } start() { ${my_service_PRE} signal_do start && return 0 eerror "Error: starting services (see system logs)" signal_do stop return 1 } stop() { ${my_service_PRE} if signal_do stop ; then ${my_service_POST} return 0 fi } reload() { ${my_service_PRE} signal_do reload } ###################################################### my LAN is 1Gbps. I have a lot of big files on my samba shares. if someone start copying at ~100MB/s, my desktop will almost hang until the end of the transfer. this way, requests for my samba server are served only when my disk is idle. it's just an example. this example, obviously, will not satisfy everybody's needs, but that's the reason to put option to prioritize or not samba disk accesses based on custom decision.
Thanks alot for the description, assigning to maintainers
In general I don't see the need for this. For almost all users samba is supposed to work at full speed.
ok, then set some reasonable defaults, but let us change that if we need to. samba is not run on servers only any more. a lot of desktop users use it, too.
Openrc supports setting ionice per service: # Or the ionice level. The format is class[:data] , just like the # --ionice start-stop-daemon parameter. #SSD_IONICELEVEL="2:2" This bug can be closed.
(In reply to Marcin Mirosław from comment #6) > Openrc supports setting ionice per service: > # Or the ionice level. The format is class[:data] , just like the > # --ionice start-stop-daemon parameter. > #SSD_IONICELEVEL="2:2" > > This bug can be closed. Unfortunately this doesn't seem to work: ministore ~ # pgrep samba | while read f ; do ionice -p $f; done none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 4 none: prio 0 none: prio 4 none: prio 4 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 4 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 4 none: prio 4 none: prio 0 none: prio 4 none: prio 4 none: prio 4 none: prio 4 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 4 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 0 none: prio 4 none: prio 0 ministore ~ # grep SSD /etc/conf.d/samba SSD_IONICELEVEL="1:0"