https://wiki.archlinux.org/api.php?action=feedcontributions&user=Time&feedformat=atomArchWiki - User contributions [en]2024-03-29T13:15:43ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Polipo&diff=87564Polipo2009-12-13T03:51:57Z<p>Time: typo</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using an [[AUR helper]] like [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
or install the newer development version instead:<br />
$ yaourt -S polipo-git<br />
<br />
==Improving Polipo==<br />
{{note|the git version already has these improvements, except for the designated Polipo user modification.}}<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
/usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? != 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? != 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
if ! ck_daemon $DAEMON; then<br />
kill -USR1 $PID >/dev/null 2>&1<br />
sleep 1<br />
/usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1 || stat_fail<br />
kill -USR2 $PID >/dev/null 2>&1<br />
stat_done<br />
else<br />
/usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1 || stat_fail<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
</nowiki><br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Yaourt_(Espa%C3%B1ol)&diff=87558Yaourt (Español)2009-12-13T01:15:14Z<p>Time: rm about arch and guideline cats, add to CÓMOs</p>
<hr />
<div>[[Category:Administración de paquetes (Español)]]<br />
[[Category:Desarrollo de paquetes (Español)]]<br />
[[Category:CÓMOs (Español)]]<br />
{{i18n_links_start}}<br />
<br />
{{i18n_entry|English|Yaourt}}<br />
{{i18n_entry|Italiano|Yaourt (Italiano)}}<br />
{{i18n_entry|简体中文|Yaourt(简体中文)}}<br />
{{i18n_entry|Español|Yaourt_(Español)}}<br />
<br />
{{i18n_links_end}}<br />
<br />
Una herramienta mas para el repositorio del usuario,('''Y'''et '''A'''n'''O'''ther '''U'''ser '''R'''epository '''T'''ool, por sus siglas en ingles). Yaourt es una herramienta hecha por la comunidad para pacman, que agrega acceso sin complicaciones a [[AUR]], descargando y automatizando la compilación e instalación de mas de 8000 PKGBUILDs disponibles en [[AUR]], ademas de miles de binarios disponibles. Yaourt usa la misma sintaxis que pacman, lo cual le ahorrará el trabajo de aprender un nuevo método de mantenimiento del sistema, pero también agrega nuevas opciones. Yaourt expande el poder y la simpleza de pacman añadiendo varias opciones muy utiles entre una consola agradable, la consola colorizada, busqueda interactiva, entre muchas mas. Usted realmente le gustara esto. <br />
<br />
===Instalación de PKGBUILD===<br />
<br />
La forma tradicional de instalar Yaourt es mediante el AUR actual. Instalando yaourt de esta manera,usted tendrá la oportunidad de aprender cómo trabaja el repositorio AUR (y PKGBUILD).<br />
<br />
Abra un navegador web y diríjase a la[http://aur.archlinux.org/packages.php?ID=5863 pagina de yaourt en AUR]<br />
<br />
Debajo de los detalles del paquete se encuentra el archivo comprimido llamado [http://aur.archlinux.org/packages/yaourt/yaourt.tar.gz tarball]<br />
<br />
Descomprima el tarball<br />
<br />
tar zxvf yaourt.tar.gz<br />
<br />
Navegue hacia el nuevo directorio creado al descomprimir<br />
<br />
cd yaourt<br />
<br />
En este punto; '''Asegúrese que haya revisado los componentes de los archivos de instalacion del PKGBUILD y yaourt!''' Esto no debería preocuparle mucho, no son muy complicados. Sólo revíselos, si usted ve algo sospechoso, pregunte acerca de esto en el irc o en el foro, con gusto le ayudaremos.<br />
<br />
more yaourt.install<br />
more PKGBUILD<br />
<br />
Si todo se ve bien, entonces estaremos listos para construir los paquetes. <br />
<br />
makepkg PKGBUILD<br />
<br />
Después de que se haya completado el preceso,usted se dará cuenta de que hay nuevos archivos y directorios.El archivo que nos interesa es el que tiene extensión *.pkg.tar.gz (en este caso con nombre de yaourt-0.9.2-i686.pkg.tar.gz)<br />
<br />
Ahora es tiempo de usar pacman para instalar yaourt. ''Asegúrese de cambiar el nombre del paquete por el nombre actual de SU paquete, no copie y pegue esta linea''<br />
<br />
pacman -U yaourt-0.9.2-i686.pkg.tar.gz<br />
<br />
Felicidades! lo hizo! Recuerde, este es el mismo proceso para casi todos los AUR PKGBUILDs.<br />
<br />
Revise la pagina del manual de [http://archlinux.fr/yaourt-en# yaourt] para mas información.<br />
<br />
===Instalación Fácil===<br />
<br />
La forma mas facil de instalar Yaourt es agregando el repositorio de yaourt en su /etc/pacman.conf:<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/i686<br />
para i686 o:<br />
[archlinuxfr]<br />
Server = http://repo.archlinux.fr/x86_64<br />
para x86-64.<br />
<br />
Actualice e instale:<br />
pacman -Sy yaourt<br />
<br />
Si usted desea, puede crear sus propios comandos de alias en ~/.bashrc, para hacerlo escriba: <br />
nano ~/.bashrc<br />
<br />
alias p="pacman"<br />
alias y="yaourt" <br />
Guarde y listo.</div>Timehttps://wiki.archlinux.org/index.php?title=Getting_Started&diff=87548Getting Started2009-12-13T00:55:10Z<p>Time: add link to spanish ver</p>
<hr />
<div>[[Category:Getting and installing Arch (English)]]<br />
[[Category:General (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|Getting_Started}}<br />
{{i18n_entry|Français|Pour_Commencer_(Français)}}<br />
{{i18n_entry|Spanish|Empezando (Español)}}<br />
{{i18n_entry|Русский|С_Чего_Начать}}<br />
{{i18n_entry|한국어|Getting Started (한국어)}}<br />
{{i18n_entry|日本語|Getting Started (日本語)}}<br />
{{i18n_links_end}}<br />
The following links are useful for those getting started with Arch Linux. Many of them will explain the philosophy of Arch and compare/contrast Arch with other distributions. They are not meant to convince the reader to choose Arch -- that decision is left to the reader alone.<br />
<br />
[[Arch Linux]]<br />
:This article attempts to give a brief overview of Arch Linux. It briefly describes some of the tools of an installed Arch Linux system.<br />
<br />
[[Arch Compared to Other Distributions]]<br />
:This page summarizes some of the similarities and differences between Arch and other distributions.<br />
<br />
[[FAQ]]<br />
:Self-explanatory. A list of common and frequently asked questions.<br />
<br />
[[The Arch Way]]<br />
:This page tries to describe the principles and philosophy of Arch Linux.<br />
<br />
[[Beginners' Guide]]<br />
:This documentation will guide you through the whole process of installing and configuring Arch Linux.<br />
<br />
[[Official Arch Linux Install Guide]]<br />
:A more general installation guide; it assumes the user is more experienced in UNIX/Linux methodology. The official location for this guide is [http://www.archlinux.org/static/docs/arch-install-guide.html here].<br />
<br />
[[Table of Contents (English)|Table of Contents]]<br />
:A listing of ArchWiki categories. See also: [[:Category:Pages sorted by topic (English)|Pages sorted by topic]] and [[:Category:Pages sorted by type (English)|Pages sorted by type]].<br />
<br />
[[ArchWiki Tutorial]]<br />
:This is a short tutorial on editing and contributing to the Arch Linux wiki.</div>Timehttps://wiki.archlinux.org/index.php?title=Category:Espa%C3%B1ol&diff=87547Category:Español2009-12-13T00:39:34Z<p>Time: update</p>
<hr />
<div>'''Bienvenido a la ArchWiki.''' Esta es la sección en Español.<br />
<br />
*[[Tabla de Contenidos (Español)|Tabla de Contenidos]]<br />
*[[:Category:Páginas ordenadas por tema (Español)|Páginas ordenadas por tema]]<br />
*[[:Category:Páginas ordenadas por tipo (Español)|Páginas ordenadas por tipo]]<br />
<br />
Perdido? Vea [[Empezando (Español)]].</div>Timehttps://wiki.archlinux.org/index.php?title=Category:Espa%C3%B1ol&diff=87546Category:Español2009-12-13T00:33:09Z<p>Time: /* Páginas ordenadas por tipo */ rm old categories</p>
<hr />
<div>__NOTOC__<br />
Bienvenido a la ArchWiki. Esta es la sección en Español.<br />
<br />
==[[:Category:Páginas ordenadas por tema (Español)|Páginas ordenadas por tema]]==<br />
Secciones en está categoría:<br />
<br />
[[:Category:Acerca de Arch (Español)|Acerca de Arch]] | [[:Category:Obteniendo e instalando Arch (Español)|Obteniendo e instalando Arch]] | [[:Category:Administración del sistema (Español)|Administración del sistema]] | [[:Category:Guía para usuarios de escritorio (Español)|Guía para usuarios de escritorio]] | [[:Category:Recuperación del sistema (Español)|Recuperación del sistema]] | [[:Category:Desarrollo de Arch (Español)|Desarrollo de Arch]] | [[:Category:Sistemas Live Arch (Español)|Sistemas Live Arch]] | [[:Category:Herramientas para ArchWiki (Español)|Herramientas para ArchWiki]].<br />
<br />
==[[:Category:Páginas ordenadas por tipo (Español)|Páginas ordenadas por tipo]]==<br />
Secciones en está categoría:<br />
<br />
[[:Category:FAQs (Español)|FAQs]] | [[:Category:General (Español)|General]] | [[:Category:CÓMOs (Español)|CÓMOs]] | [[:Category:Guías (Español)|Guías]]<br />
<br />
==[[Tabla de Contenidos (Español)|Tabla de Contenidos]]==<br />
==Inicio Rápido==<br />
*[[Arch Linux (Español)|¿Qué es Arch Linux?]]<br />
*[[Configurando Xorg (Español)|¿Cómo instalar y configurar Xorg?]]</div>Timehttps://wiki.archlinux.org/index.php?title=Category:Espa%C3%B1ol&diff=87543Category:Español2009-12-13T00:28:04Z<p>Time: prepare for update to match the new updated cats</p>
<hr />
<div>__NOTOC__<br />
Bienvenido a la ArchWiki. Esta es la sección en Español.<br />
<br />
==[[:Category:Páginas ordenadas por tema (Español)|Páginas ordenadas por tema]]==<br />
Secciones en está categoría:<br />
<br />
[[:Category:Acerca de Arch (Español)|Acerca de Arch]] | [[:Category:Obteniendo e instalando Arch (Español)|Obteniendo e instalando Arch]] | [[:Category:Administración del sistema (Español)|Administración del sistema]] | [[:Category:Guía para usuarios de escritorio (Español)|Guía para usuarios de escritorio]] | [[:Category:Recuperación del sistema (Español)|Recuperación del sistema]] | [[:Category:Desarrollo de Arch (Español)|Desarrollo de Arch]] | [[:Category:Sistemas Live Arch (Español)|Sistemas Live Arch]] | [[:Category:Herramientas para ArchWiki (Español)|Herramientas para ArchWiki]].<br />
<br />
==[[:Category:Páginas ordenadas por tipo (Español)|Páginas ordenadas por tipo]]==<br />
Secciones en está categoría:<br />
<br />
[[:Category:FAQs (Español)|FAQs]] | [[:Category:General (Español)|General]] | [[:Category:CÓMOs (Español)|CÓMOs]] | [[:Category:Tutoriales (Español)|Tutoriales]] | [[:Category:Guías (Español)|Guías]] | [[:Category:Libros (Español)|Libros]]<br />
<br />
==[[Tabla de Contenidos (Español)|Tabla de Contenidos]]==<br />
==Inicio Rápido==<br />
*[[Arch Linux (Español)|¿Qué es Arch Linux?]]<br />
*[[Configurando Xorg (Español)|¿Cómo instalar y configurar Xorg?]]</div>Timehttps://wiki.archlinux.org/index.php?title=Open_Sound_System_(Espa%C3%B1ol)&diff=87542Open Sound System (Español)2009-12-13T00:24:16Z<p>Time: add trans tmpl</p>
<hr />
<div>[[Category:Sonido (Español)]]<br />
[[Category:Audio/Video (Español)]]<br />
[[Category:CÓMOs (Español)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|OSS}}<br />
{{i18n_entry|Español|OSS}}<br />
{{i18n_entry|简体中文|OSS (简体中文)}}<br />
{{i18n_entry|Français|OSS (Français)}}<br />
{{i18n_entry|Türkçe|OSS (Türkçe)}}<br />
{{i18n_links_end}}<br />
{{translateme}}<br />
El [http://es.wikipedia.org/wiki/Open_Sound_System Open Sound System] es una arquitectura de sonido alternativa para systemas compatibles con UNIX y POSIX. OSS versión 3 era el sistema original de sonido para Linux y estába incluido en el kernel hasta que fue suplantado por [[ALSA]] en 2002, el año en que OSS versión 4 se convirtió en producto propietario. OSSv4 se convirtió en software libre de nuevo en 2007 cuando [http://www.opensound.com/ 4Front Technologies] libero el código bajo la licencia GPL.<br />
<br />
Este artículo muestra como instalar y configurar OSS en su ordenador.<br />
<br />
== Comparación con ALSA ==<br />
OSS tiene algunos aventajas y desaventajas comparado con ALSA (Arquitectura de sonido de Linux avanzada). <br />
<br />
===Aventajas de OSS (usuarios) ===<br />
*Incluye un mixer de sonido transparente como el dmix de ALSA, pero en espacio kernel, lo que significa que muchas aplicaciones pueden acceder el audio aparato en el mismo momento y con mayor rendimiento que ALSA.<br />
*Control sobre el nivel del volumen de cada aplicación<br />
*Algunos aparatos viejos tienen mejor suporte, como Creative X-Fi.<br />
*El tiempo de respuesta inicial en las aplicaciones en la mayoría de los casos es mejor.<br />
*Mejor suporte para las aplicaciones que utilizan OSS API. Muchas aplicaciones todavia usan este API, y no necesitan emulación como con ALSA.<br />
<br />
=== Aventajas de OSS (Productores) ===<br />
* El API es más limpio, más fácil de usar y también mejor [http://manuals.opensound.com/developer documentado].<br />
* Suporte para controlador en espacio del usuario.<br />
* Accesibilidad; OSS también funciona con BSDs y Solaris.<br />
* Portabilidad; OSS es [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf más fácil] de portar para otros sistemas operativos.<br />
<br />
=== Aventajas de ALSA ===<br />
*Mejor suporte para aparatos de audio USB. Con OSS la producción de sonido experimental, introducción de sonido no está suportada.<br />
*Suporte para aparatos de audio Bluetooth.<br />
*Suporte para AC'97 y HDAudio dial-up soft-modems como Si3055.<br />
*Mejor suporte para aparatos MIDI. Con OSS tendrá que usar software sintetizador como Timidity o Fluidsynth.<br />
*Suporte para suspender. OSS y loss programas asociados tendrán que cerrarse todos antes de suspender.<br />
*Mejor suporte para detección de clavijera. En algunas tarjetas madres HD, usuarios tendrán que apagar el altavoz al introducir los audifonos. <br />
<br />
== Instalacion ==<br />
Instala OSS con [[pacman]]:<br />
# pacman -S oss<br />
<br />
Este instalará los archivos de OSS, e iniciara el programa de instalación de OSS que va a incapacitar temporalmente los modulos de ALSA, despues instalara los modulos de OSS para el kernel. Pero, como ALSA es activado durante el inicio del sistema, tendrá que incapacitarlo para que no impida a OSS en el arranque. Eso se hace al editar {{Filename|rc.conf}} añadiendo:<br />
MODULES=(!soundcore ...<br />
<br />
Ahora añade el module de OSS:<br />
MODULES=(!soundcore ... oss)<br />
<br />
Si su usuario no toma parte en el grupo de audio, añádelo:<br />
# gpasswd -a usuario audio<br />
<br />
Ponga OSS en marcha:<br />
# /etc/rc.d/oss start<br />
<br />
En caso de que OSS no puede detectar su aparado de sonido, corra:<br />
# ossdetect -v<br />
<br />
Después use {{Codeline|soundoff && soundon}} para reactivarlo.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundoff is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement:<br />
<br />
{{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change section OSSMixerDevice to OSSMixerDevice==/dev/ossmix in your config (located in /home/yourusername/.moc).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (he got support for new vmix).<br />
For issue with interface change OSSMixerChannel===to OSSMixerChannel===Any channel and after start mocp press w (change to sofware mixex) that will help and you can change the volume power.<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the [http://aur.archlinux.org/packages.php?ID=28110 xulrunner-oss] package.<br />
<br />
1. Stop firefox.<br />
2. Remove the xulrunner package without dependency check: sudo pacman -Rd xulrunner<br />
3. Install xulrunner-oss package from AUR using yaourt or [http://wiki.archlinux.org/index.php/ABS ABS].<br />
4. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: mplayer -ao oss /some/file/to/play.mkv If you don't want to brother typing it over and over again add "ao=oss" to your config file. (/home/$USER/.mplayer/config)<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- '-oss'}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#The_mixer|The mixer]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Codeline|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? Form [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/bash<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [http://wiki.archlinux.org/index.php/Suspend_to_RAM s2ram] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
if [ [ $EUID -ne 0 ] ]; then<br />
## Checking if you are a root or not<br />
echo "This script must be run as root" 1>&2<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt<br />
<br />
if [ $? -gt 0 ]; then<br />
echo "OSS restart failed check /tmp/oss.txt for advice"<br />
fi<br />
<br />
exit 0<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>PID=`pidof operapluginwrapper`;kill -9 $PID</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Timehttps://wiki.archlinux.org/index.php?title=Open_Sound_System_(Espa%C3%B1ol)&diff=87541Open Sound System (Español)2009-12-13T00:23:38Z<p>Time: add to spanish categories</p>
<hr />
<div>[[Category:Sonido (Español)]]<br />
[[Category:Audio/Video (Español)]]<br />
[[Category:CÓMOs (Español)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|OSS}}<br />
{{i18n_entry|Español|OSS}}<br />
{{i18n_entry|简体中文|OSS (简体中文)}}<br />
{{i18n_entry|Français|OSS (Français)}}<br />
{{i18n_entry|Türkçe|OSS (Türkçe)}}<br />
{{i18n_links_end}}<br />
El [http://es.wikipedia.org/wiki/Open_Sound_System Open Sound System] es una arquitectura de sonido alternativa para systemas compatibles con UNIX y POSIX. OSS versión 3 era el sistema original de sonido para Linux y estába incluido en el kernel hasta que fue suplantado por [[ALSA]] en 2002, el año en que OSS versión 4 se convirtió en producto propietario. OSSv4 se convirtió en software libre de nuevo en 2007 cuando [http://www.opensound.com/ 4Front Technologies] libero el código bajo la licencia GPL.<br />
<br />
Este artículo muestra como instalar y configurar OSS en su ordenador.<br />
<br />
== Comparación con ALSA ==<br />
OSS tiene algunos aventajas y desaventajas comparado con ALSA (Arquitectura de sonido de Linux avanzada). <br />
<br />
===Aventajas de OSS (usuarios) ===<br />
*Incluye un mixer de sonido transparente como el dmix de ALSA, pero en espacio kernel, lo que significa que muchas aplicaciones pueden acceder el audio aparato en el mismo momento y con mayor rendimiento que ALSA.<br />
*Control sobre el nivel del volumen de cada aplicación<br />
*Algunos aparatos viejos tienen mejor suporte, como Creative X-Fi.<br />
*El tiempo de respuesta inicial en las aplicaciones en la mayoría de los casos es mejor.<br />
*Mejor suporte para las aplicaciones que utilizan OSS API. Muchas aplicaciones todavia usan este API, y no necesitan emulación como con ALSA.<br />
<br />
=== Aventajas de OSS (Productores) ===<br />
* El API es más limpio, más fácil de usar y también mejor [http://manuals.opensound.com/developer documentado].<br />
* Suporte para controlador en espacio del usuario.<br />
* Accesibilidad; OSS también funciona con BSDs y Solaris.<br />
* Portabilidad; OSS es [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf más fácil] de portar para otros sistemas operativos.<br />
<br />
=== Aventajas de ALSA ===<br />
*Mejor suporte para aparatos de audio USB. Con OSS la producción de sonido experimental, introducción de sonido no está suportada.<br />
*Suporte para aparatos de audio Bluetooth.<br />
*Suporte para AC'97 y HDAudio dial-up soft-modems como Si3055.<br />
*Mejor suporte para aparatos MIDI. Con OSS tendrá que usar software sintetizador como Timidity o Fluidsynth.<br />
*Suporte para suspender. OSS y loss programas asociados tendrán que cerrarse todos antes de suspender.<br />
*Mejor suporte para detección de clavijera. En algunas tarjetas madres HD, usuarios tendrán que apagar el altavoz al introducir los audifonos. <br />
<br />
== Instalacion ==<br />
Instala OSS con [[pacman]]:<br />
# pacman -S oss<br />
<br />
Este instalará los archivos de OSS, e iniciara el programa de instalación de OSS que va a incapacitar temporalmente los modulos de ALSA, despues instalara los modulos de OSS para el kernel. Pero, como ALSA es activado durante el inicio del sistema, tendrá que incapacitarlo para que no impida a OSS en el arranque. Eso se hace al editar {{Filename|rc.conf}} añadiendo:<br />
MODULES=(!soundcore ...<br />
<br />
Ahora añade el module de OSS:<br />
MODULES=(!soundcore ... oss)<br />
<br />
Si su usuario no toma parte en el grupo de audio, añádelo:<br />
# gpasswd -a usuario audio<br />
<br />
Ponga OSS en marcha:<br />
# /etc/rc.d/oss start<br />
<br />
En caso de que OSS no puede detectar su aparado de sonido, corra:<br />
# ossdetect -v<br />
<br />
Después use {{Codeline|soundoff && soundon}} para reactivarlo.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundoff is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement:<br />
<br />
{{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change section OSSMixerDevice to OSSMixerDevice==/dev/ossmix in your config (located in /home/yourusername/.moc).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (he got support for new vmix).<br />
For issue with interface change OSSMixerChannel===to OSSMixerChannel===Any channel and after start mocp press w (change to sofware mixex) that will help and you can change the volume power.<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the [http://aur.archlinux.org/packages.php?ID=28110 xulrunner-oss] package.<br />
<br />
1. Stop firefox.<br />
2. Remove the xulrunner package without dependency check: sudo pacman -Rd xulrunner<br />
3. Install xulrunner-oss package from AUR using yaourt or [http://wiki.archlinux.org/index.php/ABS ABS].<br />
4. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: mplayer -ao oss /some/file/to/play.mkv If you don't want to brother typing it over and over again add "ao=oss" to your config file. (/home/$USER/.mplayer/config)<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- '-oss'}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#The_mixer|The mixer]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Codeline|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? Form [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/bash<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [http://wiki.archlinux.org/index.php/Suspend_to_RAM s2ram] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
if [ [ $EUID -ne 0 ] ]; then<br />
## Checking if you are a root or not<br />
echo "This script must be run as root" 1>&2<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt<br />
<br />
if [ $? -gt 0 ]; then<br />
echo "OSS restart failed check /tmp/oss.txt for advice"<br />
fi<br />
<br />
exit 0<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>PID=`pidof operapluginwrapper`;kill -9 $PID</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Timehttps://wiki.archlinux.org/index.php?title=Open_Sound_System&diff=87540Open Sound System2009-12-13T00:20:13Z<p>Time: add link to spanish ver</p>
<hr />
<div>[[Category:Sound (English)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|OSS}}<br />
{{i18n_entry|简体中文|OSS (简体中文)}}<br />
{{i18n_entry|Français|OSS (Français)}}<br />
{{i18n_entry|Español|Open Sound System (Español)}}<br />
{{i18n_entry|Türkçe|OSS (Türkçe)}}<br />
{{i18n_links_end}}<br />
This article will show you how to install and configure the '''O'''pen '''S'''ound '''S'''ystem (OSS) on you computer.<br />
<br />
== About ==<br />
<br />
The [http://en.wikipedia.org/wiki/Open_Sound_System Open Sound System] is an alternative sound architecture for Unix-like and POSIX-compatible systems. OSS version 3 was the original sound system for Linux and is in the kernel but was superceded by ALSA in 2002 when OSS version 4 became proprietary software. OSSv4 became free software again in 2007 when [http://www.opensound.com/ 4Front Technologies] released it's source code and provided it under the GPL license.<br />
<br />
== Comparisions with ALSA ==<br />
<br />
Some advantages and disadvantages compared to using the Advanced Linux Sound Architecture.<br />
<br />
=== OSS Advantages (users) ===<br />
<br />
* Includes a transparent software mixer (vmix in kernel space). Having a transparent software mixer means that multiple applications can access the sound device at the same time.<br />
* Control for each application sound volume.<br />
* Some legacy cards are supported better (e.g. Creative X-Fi).<br />
* Initial response time in sound applications is usually better.<br />
* Better support for applications that use the OSS API. Many applications still use this API, and doe not require an emulation layer like ALSA uses.<br />
<br />
=== OSS Advantages (developers) ===<br />
<br />
* Cleaner and easier to use API, and better API [http://manuals.opensound.com/developer documentation].<br />
* Support for drivers in userspace.<br />
* Accesibility. OSS runs on BSDs and Solaris.<br />
* Portability. OSS is [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf easier] to port to other operating systems.<br />
<br />
=== ALSA Advantages ===<br />
<br />
* Better support for USB audio devices. With OSS output is experimental, input is not implemented.<br />
* Support for Bluetooth audio devices.<br />
* Support for AC'97 and HDAudio dial-up soft-modems such as Si3055.<br />
* Better support for MIDI devices. With OSS you'll have to use a software synthesizer such as Timidity or Fluidsynth.<br />
* Support for suspend. OSS and associated programs will need to be closed first.<br />
* Better support for jack detection. On some HD motherboards users will need to turn down the speaker volume when plugging in their earphones. <br />
<br />
== Install ==<br />
<br />
Install OSS by running:<br />
<br />
# pacman -S oss<br />
<br />
This will install the OSS files and run the OSS install script that will temporarily disable the ALSA modules, and install the OSS kernel modules. Since ALSA is enabled by default in the boot scripts, you need to disable it for it not to conflict with OSS when booting. You can do this by editing {{Filename|rc.conf}} and adding:<br />
<br />
MODULES=(!soundcore ...<br />
<br />
Then add the OSS module:<br />
<br />
MODULES=(!soundcore ... oss)<br />
<br />
If your user is not part of the audio group, add your user by:<br />
<br />
# gpasswd -a username audio<br />
<br />
Then start OSS by:<br />
<br />
# /etc/rc.d/oss start<br />
<br />
In the case OSS is not able to detect your card when starting it, run:<br />
<br />
# ossdetect -v<br />
<br />
Then {{Codeline|soundoff && soundon}} to reactivate it.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundoff is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement:<br />
<br />
{{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change section OSSMixerDevice to OSSMixerDevice==/dev/ossmix in your config (located in /home/yourusername/.moc).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (he got support for new vmix).<br />
For issue with interface change OSSMixerChannel===to OSSMixerChannel===Any channel and after start mocp press w (change to sofware mixex) that will help and you can change the volume power.<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the [http://aur.archlinux.org/packages.php?ID=28110 xulrunner-oss] package.<br />
<br />
1. Stop firefox.<br />
2. Remove the xulrunner package without dependency check: sudo pacman -Rd xulrunner<br />
3. Install xulrunner-oss package from AUR using yaourt or [http://wiki.archlinux.org/index.php/ABS ABS].<br />
4. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: mplayer -ao oss /some/file/to/play.mkv If you don't want to brother typing it over and over again add "ao=oss" to your config file. (/home/$USER/.mplayer/config)<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- '-oss'}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#The_mixer|The mixer]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Codeline|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? Form [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/bash<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [http://wiki.archlinux.org/index.php/Suspend_to_RAM s2ram] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
if [ [ $EUID -ne 0 ] ]; then<br />
## Checking if you are a root or not<br />
echo "This script must be run as root" 1>&2<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt<br />
<br />
if [ $? -gt 0 ]; then<br />
echo "OSS restart failed check /tmp/oss.txt for advice"<br />
fi<br />
<br />
exit 0<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>PID=`pidof operapluginwrapper`;kill -9 $PID</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Timehttps://wiki.archlinux.org/index.php?title=Open_Sound_System_(Espa%C3%B1ol)&diff=87539Open Sound System (Español)2009-12-13T00:19:15Z<p>Time: inacurate</p>
<hr />
<div>[[Category:Sonido (Español)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (Español)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|OSS}}<br />
{{i18n_entry|Español|OSS}}<br />
{{i18n_entry|简体中文|OSS (简体中文)}}<br />
{{i18n_entry|Français|OSS (Français)}}<br />
{{i18n_entry|Türkçe|OSS (Türkçe)}}<br />
{{i18n_links_end}}<br />
El [http://es.wikipedia.org/wiki/Open_Sound_System Open Sound System] es una arquitectura de sonido alternativa para systemas compatibles con UNIX y POSIX. OSS versión 3 era el sistema original de sonido para Linux y estába incluido en el kernel hasta que fue suplantado por [[ALSA]] en 2002, el año en que OSS versión 4 se convirtió en producto propietario. OSSv4 se convirtió en software libre de nuevo en 2007 cuando [http://www.opensound.com/ 4Front Technologies] libero el código bajo la licencia GPL.<br />
<br />
Este artículo muestra como instalar y configurar OSS en su ordenador.<br />
<br />
== Comparación con ALSA ==<br />
OSS tiene algunos aventajas y desaventajas comparado con ALSA (Arquitectura de sonido de Linux avanzada). <br />
<br />
===Aventajas de OSS (usuarios) ===<br />
*Incluye un mixer de sonido transparente como el dmix de ALSA, pero en espacio kernel, lo que significa que muchas aplicaciones pueden acceder el audio aparato en el mismo momento y con mayor rendimiento que ALSA.<br />
*Control sobre el nivel del volumen de cada aplicación<br />
*Algunos aparatos viejos tienen mejor suporte, como Creative X-Fi.<br />
*El tiempo de respuesta inicial en las aplicaciones en la mayoría de los casos es mejor.<br />
*Mejor suporte para las aplicaciones que utilizan OSS API. Muchas aplicaciones todavia usan este API, y no necesitan emulación como con ALSA.<br />
<br />
=== Aventajas de OSS (Productores) ===<br />
* El API es más limpio, más fácil de usar y también mejor [http://manuals.opensound.com/developer documentado].<br />
* Suporte para controlador en espacio del usuario.<br />
* Accesibilidad; OSS también funciona con BSDs y Solaris.<br />
* Portabilidad; OSS es [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf más fácil] de portar para otros sistemas operativos.<br />
<br />
=== Aventajas de ALSA ===<br />
*Mejor suporte para aparatos de audio USB. Con OSS la producción de sonido experimental, introducción de sonido no está suportada.<br />
*Suporte para aparatos de audio Bluetooth.<br />
*Suporte para AC'97 y HDAudio dial-up soft-modems como Si3055.<br />
*Mejor suporte para aparatos MIDI. Con OSS tendrá que usar software sintetizador como Timidity o Fluidsynth.<br />
*Suporte para suspender. OSS y loss programas asociados tendrán que cerrarse todos antes de suspender.<br />
*Mejor suporte para detección de clavijera. En algunas tarjetas madres HD, usuarios tendrán que apagar el altavoz al introducir los audifonos. <br />
<br />
== Instalacion ==<br />
Instala OSS con [[pacman]]:<br />
# pacman -S oss<br />
<br />
Este instalará los archivos de OSS, e iniciara el programa de instalación de OSS que va a incapacitar temporalmente los modulos de ALSA, despues instalara los modulos de OSS para el kernel. Pero, como ALSA es activado durante el inicio del sistema, tendrá que incapacitarlo para que no impida a OSS en el arranque. Eso se hace al editar {{Filename|rc.conf}} añadiendo:<br />
MODULES=(!soundcore ...<br />
<br />
Ahora añade el module de OSS:<br />
MODULES=(!soundcore ... oss)<br />
<br />
Si su usuario no toma parte en el grupo de audio, añádelo:<br />
# gpasswd -a usuario audio<br />
<br />
Ponga OSS en marcha:<br />
# /etc/rc.d/oss start<br />
<br />
En caso de que OSS no puede detectar su aparado de sonido, corra:<br />
# ossdetect -v<br />
<br />
Después use {{Codeline|soundoff && soundon}} para reactivarlo.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundoff is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement:<br />
<br />
{{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change section OSSMixerDevice to OSSMixerDevice==/dev/ossmix in your config (located in /home/yourusername/.moc).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (he got support for new vmix).<br />
For issue with interface change OSSMixerChannel===to OSSMixerChannel===Any channel and after start mocp press w (change to sofware mixex) that will help and you can change the volume power.<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the [http://aur.archlinux.org/packages.php?ID=28110 xulrunner-oss] package.<br />
<br />
1. Stop firefox.<br />
2. Remove the xulrunner package without dependency check: sudo pacman -Rd xulrunner<br />
3. Install xulrunner-oss package from AUR using yaourt or [http://wiki.archlinux.org/index.php/ABS ABS].<br />
4. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: mplayer -ao oss /some/file/to/play.mkv If you don't want to brother typing it over and over again add "ao=oss" to your config file. (/home/$USER/.mplayer/config)<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- '-oss'}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#The_mixer|The mixer]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Codeline|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? Form [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/bash<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [http://wiki.archlinux.org/index.php/Suspend_to_RAM s2ram] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
if [ [ $EUID -ne 0 ] ]; then<br />
## Checking if you are a root or not<br />
echo "This script must be run as root" 1>&2<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt<br />
<br />
if [ $? -gt 0 ]; then<br />
echo "OSS restart failed check /tmp/oss.txt for advice"<br />
fi<br />
<br />
exit 0<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>PID=`pidof operapluginwrapper`;kill -9 $PID</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Timehttps://wiki.archlinux.org/index.php?title=Open_Sound_System_(Espa%C3%B1ol)&diff=87538Open Sound System (Español)2009-12-13T00:18:06Z<p>Time: spangrish</p>
<hr />
<div>[[Category:Sonido (Español)]]<br />
[[Category:Audio/Video (English)]]<br />
[[Category:HOWTOs (Español)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|OSS}}<br />
{{i18n_entry|Español|OSS}}<br />
{{i18n_entry|简体中文|OSS (简体中文)}}<br />
{{i18n_entry|Français|OSS (Français)}}<br />
{{i18n_entry|Türkçe|OSS (Türkçe)}}<br />
{{i18n_links_end}}<br />
El [http://es.wikipedia.org/wiki/Open_Sound_System Open Sound System] es una arquitectura de sonido alternativa para systemas compatibles con UNIX y POSIX. OSS versión 3 era el sistema original de sonido para Linux y está incluido en el kernel, pero fue suplantado por [[ALSA]] en 2002, el año en que OSS versión 4 se convirtió en producto propietario. OSSv4 se convirtió en software libre de nuevo en 2007 cuando [http://www.opensound.com/ 4Front Technologies] libero el código bajo la licencia GPL.<br />
<br />
Este artículo muestra como instalar y configurar OSS en su ordenador.<br />
<br />
== Comparación con ALSA ==<br />
OSS tiene algunos aventajas y desaventajas comparado con ALSA (Arquitectura de sonido de Linux avanzada). <br />
<br />
===Aventajas de OSS (usuarios) ===<br />
*Incluye un mixer de sonido transparente como el dmix de ALSA, pero en espacio kernel, lo que significa que muchas aplicaciones pueden acceder el audio aparato en el mismo momento y con mayor rendimiento que ALSA.<br />
*Control sobre el nivel del volumen de cada aplicación<br />
*Algunos aparatos viejos tienen mejor suporte, como Creative X-Fi.<br />
*El tiempo de respuesta inicial en las aplicaciones en la mayoría de los casos es mejor.<br />
*Mejor suporte para las aplicaciones que utilizan OSS API. Muchas aplicaciones todavia usan este API, y no necesitan emulación como con ALSA.<br />
<br />
=== Aventajas de OSS (Productores) ===<br />
* El API es más limpio, más fácil de usar y también mejor [http://manuals.opensound.com/developer documentado].<br />
* Suporte para controlador en espacio del usuario.<br />
* Accesibilidad; OSS también funciona con BSDs y Solaris.<br />
* Portabilidad; OSS es [http://revolf.free.fr/Alchimie-7/Alchimie7_OSS_Haiku.en.pdf más fácil] de portar para otros sistemas operativos.<br />
<br />
=== Aventajas de ALSA ===<br />
*Mejor suporte para aparatos de audio USB. Con OSS la producción de sonido experimental, introducción de sonido no está suportada.<br />
*Suporte para aparatos de audio Bluetooth.<br />
*Suporte para AC'97 y HDAudio dial-up soft-modems como Si3055.<br />
*Mejor suporte para aparatos MIDI. Con OSS tendrá que usar software sintetizador como Timidity o Fluidsynth.<br />
*Suporte para suspender. OSS y loss programas asociados tendrán que cerrarse todos antes de suspender.<br />
*Mejor suporte para detección de clavijera. En algunas tarjetas madres HD, usuarios tendrán que apagar el altavoz al introducir los audifonos. <br />
<br />
== Instalacion ==<br />
Instala OSS con [[pacman]]:<br />
# pacman -S oss<br />
<br />
Este instalará los archivos de OSS, e iniciara el programa de instalación de OSS que va a incapacitar temporalmente los modulos de ALSA, despues instalara los modulos de OSS para el kernel. Pero, como ALSA es activado durante el inicio del sistema, tendrá que incapacitarlo para que no impida a OSS en el arranque. Eso se hace al editar {{Filename|rc.conf}} añadiendo:<br />
MODULES=(!soundcore ...<br />
<br />
Ahora añade el module de OSS:<br />
MODULES=(!soundcore ... oss)<br />
<br />
Si su usuario no toma parte en el grupo de audio, añádelo:<br />
# gpasswd -a usuario audio<br />
<br />
Ponga OSS en marcha:<br />
# /etc/rc.d/oss start<br />
<br />
En caso de que OSS no puede detectar su aparado de sonido, corra:<br />
# ossdetect -v<br />
<br />
Después use {{Codeline|soundoff && soundon}} para reactivarlo.<br />
<br />
== Testing ==<br />
<br />
Beware the default volume is very loud, avoid using earphones and physically lower the volume of your speakers (if possible) before running the test.<br />
<br />
'''Test OSS by running:'''<br />
<br />
$ osstest<br />
<br />
You should be able to hear music during the test process. If there is no audio, try to adjust the volume or refer to the troubleshooting section.<br />
<br />
<br />
'''See which devices are detected by running:'''<br />
<br />
$ ossinfo<br />
<br />
You should be able to see your devices listed under Device objects or Audio Devices. If the device that you want to use is not at the top on Audio devices or Device objects sections, /usr/lib/oss/etc/installed_drivers needs to be edited. The driver for the device that needs to be used should be at the very top. A soundoff, soundoff is probably required. If this does not work, comment all drivers listed that are not your preferred device.<br />
<br />
== Volume Control ==<br />
<br />
To control the volume of various devices, mixers levels will need to be set. The command line mixer is called {{Codeline|ossmix}}. It's very like the BSD audio mixer (mixerctl). The graphical mixer is called {{Codeline|ossxmix}} and will require {{Package Official|gtk2}} to be installed.<br />
<br />
The basic <tt>ossxmix</tt> controls:<br />
<br />
<pre><br />
/ High Definition Audio ALC262 \ --------------------------------> 1<br />
/________________________________\________________________________<br />
| \<br />
| [x] vmix0-enable [vmix0-rate: 48.000kHz] vmix0-channels |--> 2<br />
| [ Stereo [v] ] |<br />
| |<br />
| __codec1______________________________________________________ |<br />
| | _jack______________________________________________________ ||--> 3<br />
| | | _int-speaker_________________ _green_________________ |||<br />
| | | | | | | |||<br />
| | | | _mode_____ | | | | _mode_____ | | | |||<br />
| | | | [ mix [v] ] o o [x] [ ]mute | | [ mix [v] ] o o [x] | |||<br />
| | | | | | | | | | | |||<br />
| | | |_____________________________| |_______________________| |||<br />
| | |___________________________________________________________|||<br />
| |______________________________________________________________||<br />
| ___vmix0______________________________________________________ |<br />
| | __mocp___ O O _firefox_ O O __pcm7___ O O | |--> 4<br />
| | | | O O | | x x | | O O | |<br />
| | | | | | x O | | | | x x | | | | O O | |<br />
| | | o o [x] | x x | o o [x] | x x | o o [x] | O O | |<br />
| | | | | | x x | | | | x x | | | | O O | |<br />
| | |_________| x x |_________| x x |_________| O O | |<br />
| |_____________________________________________________________| |<br />
|_________________________________________________________________|<br />
</pre><br />
<br />
# One tab for each sound card<br />
# The vmix (virtual mixer) special configurations appear at the top. These include sampling rate and mixer priority.<br />
# These are your sound card jack configurations (input and output). Every mixer control that is shown here is provided by your sound card.<br />
# Application vmix mixer controls and sound meters. If the application isn't actively playing a sound it will be labeled pcm08, pcm09..., when the application is playing the application name will be shown.<br />
<br />
=== Color Definitions ===<br />
<br />
For high definition (HD) audio, {{Codeline|ossxmix}} will color jack configurations by their pre-defined jack colors:<br />
<br />
{| style="border: 1px solid #CCCCCC; background-color: #dddddf"<br />
! Color<br />
! Type<br />
! Connector<br />
|- style=color:black;background:lightgreen<br />
|green<br />
| front channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:black <br />
|black<br />
| rear channels (stereo output)<br />
| 3.5mm TRS<br />
|- style=color:white;background:gray<br />
|grey<br />
| side channels (stereo output)<br />
|3.5mm TRS<br />
|- style=color:black;background:gold<br />
|gold<br />
| center and subwoofer (dual output)<br />
|3.5mm TRS<br />
|- style=color:black;background:lightblue<br />
|blue<br />
| line level (stereo input)<br />
|3.5mm TRS<br />
|- style=color:black;background:pink <br />
|pink<br />
| microphone (mono input)<br />
|3.5mm TS<br />
|}<br />
<br />
=== Saving Mixer Levels ===<br />
<br />
Mixer levels are saved when you shut off your computer. If you want to save the mixer level immediately, as root:<br />
<br />
# savemixer<br />
<br />
{{Codeline|savemixer}} can be used to write mixer levels to a file with the {{Codeline|-f}} switch and restore by the {{Codeline|-L}} switch.<br />
<br />
=== Other Mixers ===<br />
<br />
Other mixers that have support for OSS:<br />
<br />
* GNOME - Gnome volume control<br />
* KDE - Kmix - OSS support is being developed.<br />
<br />
==Configuring Applications for OSS==<br />
<br />
===Skype===<br />
<br />
The <tt>skype</tt> package only includes support for ALSA. To get an OSS-capable Skype, install the <tt>skype-oss</tt> package:<br />
<br />
# pacman -S skype-oss<br />
<br />
If you are using x86_64, you can get the [http://aur.archlinux.org/packages.php?ID=18312 bin32-skype-oss] package from AUR.<br />
<br />
===Wine===<br />
<br />
* Run <tt>winecfg</tt>.<br />
<br />
$ winecfg<br />
<br />
* Go to the <tt>Audio</tt> tab.<br />
<br />
* Select <tt>OSS Driver</tt>.<br />
<br />
===Gajim===<br />
By default Gajim uses {{Codeline|aplay -q}} to play a sound. To change this go in Advanced Settings and search for the {{Codeline|soundplayer}} variable. The ossplay program included in the oss package is a good replacement:<br />
<br />
{{Codeline|ossplay -qq}}<br />
<br />
===MOC===<br />
<br />
To use MOC with OSS v4.1 you must change section OSSMixerDevice to OSSMixerDevice==/dev/ossmix in your config (located in /home/yourusername/.moc).<br />
And now MOC should work with OSS v4.1.<br />
Or you can compile moc-svn package from AUR (he got support for new vmix).<br />
For issue with interface change OSSMixerChannel===to OSSMixerChannel===Any channel and after start mocp press w (change to sofware mixex) that will help and you can change the volume power.<br />
<br />
===Applications that use Gstreamer===<br />
<br />
Remove pulseaudio and gstreamer*-pulse programs and libraries.<br />
<br />
To change the gstreamer setting to output the sound to OSS instead of the default ALSA, run:<br />
<br />
gstreamer-properties<br />
<br />
Change the '''Default Output''' plugin to custom and the change the pipeline to:<br />
<br />
oss4sink<br />
<br />
For the input:<br />
<br />
oss4src<br />
<br />
{{Note|It's not certain that the input will sound better with oss4src compared to osssrc, so change this only if it improves your input sound. < confirmation on this please >}}<br />
<br />
If you are using phonon with the gstreamer backend you will need to set the environmental variable. To add to your current user:<br />
<br />
export PHONON_GST_AUDIOSINK=oss4sink<br />
<br />
Add this to your {{Filename|~/.bashrc}} to be loaded on login.<br />
<br />
===Firefox >=3.5===<br />
<br />
Firefox 3.5 introduces the <video> and <audio> tag support and can play ogg media out of the box. However, it currently can't be compiled with ALSA and OSS support at the same time. So you need to install the [http://aur.archlinux.org/packages.php?ID=28110 xulrunner-oss] package.<br />
<br />
1. Stop firefox.<br />
2. Remove the xulrunner package without dependency check: sudo pacman -Rd xulrunner<br />
3. Install xulrunner-oss package from AUR using yaourt or [http://wiki.archlinux.org/index.php/ABS ABS].<br />
4. Start firefox.<br />
<br />
===Mplayer===<br />
<br />
If you are using gui (smplayer etc.) you will find the oss output at the audio settings. Using on cli you should specify the sound output: mplayer -ao oss /some/file/to/play.mkv If you don't want to brother typing it over and over again add "ao=oss" to your config file. (/home/$USER/.mplayer/config)<br />
<br />
===Other applications===<br />
<br />
* If you can't get sound from an application not listed here, try looking at the [http://www.4front-tech.com/wiki/index.php/Configuring_Applications_for_OSSv4 Configuring Applications for OSSv4] page.<br />
* Search OSS specific packages by using {{Codeline|pacman -Ss -- '-oss'}} and [http://aur.archlinux.org/packages.php?K=-oss&start=0&PP=100| in AUR].<br />
<br />
==Troubleshooting==<br />
<br />
===Troubleshooting HDAudio devices===<br />
<br />
====Understanding why problems arise====<br />
<br />
If you have a HDAudio sound device, it's very likely that you will have to adjust some mixer settings before your sound works.<br />
<br />
HDAudio devices are very powerful in the sense that they can contain a lot of small circuits (called ''widgets'') that can be adjusted by software at any time. These controls are exposed to the mixer, and they can be used, for example, to turn the earphone jack into a sound input jack instead of a sound output jack.<br />
<br />
However, there is a side effect, mainly because the HDAudio standard is more flexible than it perhaps should be, and because the vendors often only care to get their ''official drivers'' working.<br />
<br />
Then, when using HDAudio devices, you often find disorganized mixer controls, that doesn't work at all by default, and you are forced to try every mixer control combination, until it works.<br />
<br />
====How to solve====<br />
<br />
Open <tt>ossxmix</tt> and try to change every mixer control in the ''middle area'', that contains the sound card specific controls, as explained in the previous "[[OSS#The_mixer|The mixer]]" section.<br />
<br />
You'll probably want to setup a program to record/play continously in the background (e.g. {{Codeline|ossrecord - | ossplay -}} for recording or {{Codeline|osstest -lV}} for playing), while changing mixer settings in ossxmix in the foreground.<br />
<br />
* Raise every volume control slider.<br />
* In each option box, try to change the selected option, trying all the possible combinations.<br />
* If you get noise, try to lower and/or mute some volume controls, until you find the source of the noise.<br />
<br />
Please note again that you do '''not''' need to change any controls in the ''top area'' nor in the ''bottom area'', as they are virtual <tt>vmix</tt>-related mixer controls.<br />
<br />
* Editing {{Codeline|/usr/lib/oss/conf/oss_hdaudio.conf}} uncommenting and changing ''hdaudio_noskip=0'' to a value from 0-7 can give you more jack options in ossxmix<br />
I had to edit mine to ''hdaudio_noskip=7'' for my sub/rear speaker to work on my laptop, restart oss for the changes to take effect {{Codeline|/etc/rc.d/oss restart}}<br />
<br />
===MMS sound cracking in totem===<br />
If your stream sounds with cracks or strange noise in totem like it did with me then you could try to play it with another backend like ffmpeg (mplayer). That "fixed" the issue for me. This will not fix the issue that somehow pops up in gstreamer when playing MMS streams but it will give you the option to play it with good sound quality. Playing it in mplayer is simple:<br />
# mplayer mmsh://yourstreamurl<br />
<br />
===Microphone playing through output channels===<br />
<br />
OSS by default plays back the microphone through the speakers. To disable this in ossxmix find the misc section. Check off every "input-mix-mute" to disable this.<br />
<br />
===Troubleshooting other issues===<br />
<br />
* If you get distorted sound, try lowering some volume control sliders.<br />
<br />
* If you need to change the default sound card, look at [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output here].<br />
<br />
* If you have another issues, try searching or asking for help at the [http://www.4front-tech.com/forum 4front forums].<br />
<br />
==Tips and tricks==<br />
<br />
===Using multimedia keys with OSS===<br />
An easy way to mute/unmute and increase/decrease the volume is to use the [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#ossvol {{Codeline|ossvol}} script] available in [[AUR]].<br />
<br />
Once you installed it try to toggle the sound:<br />
$ ossvol -t<br />
<br />
Type {{Codeline|ossvol -h}} for the other commands.<br />
<br />
If you don't know how to assign commands to your multimedia keys, see [[Extra Keyboard Keys]].<br />
<br />
==={{Codeline|ossvol}} troubleshooting===<br />
If you get an error like:<br />
Bad mixer control name(987) 'vol'<br />
you need to edit the script ({{Filename|/usr/bin/ossvol}}) and change the value of the {{Codeline|CHANNEL}} variable which is at the beginning of the script. For example mine is {{Codeline|CHANNEL<nowiki>=</nowiki>"vmix0-outvol"}}.<br />
<br />
*'''Note''' if you are using xbindkeys for your multimedia keys adding this<br />
"ossmix vmix0-outvol -- +1"<br />
raise volume<br />
"ossmix vmix0-outvol -- -1"<br />
lower volume<br />
<br />
to the raise/lower volume section of your .xbindkeysrc file is an easy way to adjust the volume<br />
<br />
===Changing the Sample Rate===<br />
<br />
Changing the output sample rate is not obvious at first. Sample rates can only be changed by the superuser and vmix must be unused by any programs when a change is requested. Before you follow any of these steps, ensure you are going through a receiver/amplifier and using quality speakers and not simply computer speakers. If you are only using computer speakers, don't bother changing anything here as you won't notice a difference.<br />
<br />
By default the sample rate is 48000hz. There are several conditions in which you may want to change this. This all depends on your usage patterns. You want the sample rate you are using to match the media you use the most. If your computer has to change the sampling rate of the media to suit the hardware it is likely, though not guaranteed that you will have a loss in audio quality. This is most noticable in downsampling (ie. 96000hz &rarr; 48000hz). There is an article about this issue in [http://www.stereophile.com/news/121707lucky/ "Stereophile"] which was [http://lists.apple.com/archives/coreaudio-api/2008/Jan/msg00272.html discussed] on Apple's "CoreAudio API" mailing list if you wish to learn more about this issue. <br />
<br />
Some example sample rates:<br />
<br />
* 44100hz - Sample rate of standard [http://en.wikipedia.org/wiki/Red_Book_%28audio_CD_standard%29 Red Book] audio cds.<br />
* 88000hz - Sample rate of [http://en.wikipedia.org/wiki/Super_Audio_CD SACD] high definition audio discs/downloads. It is rare that your motherboard will support this sample rate.<br />
* 96000hz - Sample rate of most high definition audio downloads. If your motherboard is an [http://en.wikipedia.org/wiki/AC%2797 AC'97] motherboard, this is likely to be your highest bitrate.<br />
* 192000hz - Sample rate of BluRay, and some (very few) high definition downloads. Support for external audio reciever equipment is limited to high end audio. Not all motherboards support this. An example of a motherboard chipset that would support this includes [http://en.wikipedia.org/wiki/Intel_High_Definition_Audio Intel HDA audio]. <br />
<br />
To check what your sample rate is currently set to:<br />
<br />
# Run <code>"ossmix | grep rate"</code>. <br />
<br />
You are likely to see <code>"vmix0-rate <decimal value> (currently 48000) (Read-only)"</code>.<br />
<br />
If you do not see a "vmix0-rate" (or "vmix1-rate", etc.) being outputted, than it probably means that vmix is disabled. In that case, OSS will use the rate requested by the program which uses the device, so this section doesn't apply. Exception: envy24(ht) cards have a setting envy24.rate which has a similiar function (see "oss_envy24" manpage). You can follow these steps, but at step 2, change with ossmix the value of "envy24.rate" as well.<br />
<br />
Steps to affect the change:<br />
<br />
# First, make sure your card is able to use the new rate. Run "ossinfo -v2" and see if the wanted rate is in the "Native sample rates" output.<br />
# As root, run <code>"/usr/lib/oss/scripts/killprocs.sh"</code>. Be aware, this will close any program that currently has an open sound channel (examples being media players, Firefox as of 3.5 if you have xulrunner-oss installed, and the gnome volume control).<br />
# After all programs occupying vmix are terminated, run as root: <code>"vmixctl rate /dev/dsp 96000"</code> replacing the rate with your desired sample rate.<br />
# Run <code>"ossmix | grep rate"</code> and check for <code>"vmix0-rate <decimal value> (currently 96000) (Read-only)"</code> to see if you were successful.<br />
<br />
===Changing the Default Sound Output===<br />
<br />
When running osstest, the first test passes for the first channel, but not for the stereo or right channel, it sounds distorted/hisses. If this is what your sound is like, then it's set to the wrong output.<br />
<br />
*** Scanning sound adapter #-1 ***<br />
/dev/oss/oss_hdaudio0/pcm0 (audio engine 0): HD Audio play front<br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
The left sounded good, the right and stereo were the distorted ones.<br />
<br />
Let the test continue until you get a working output:<br />
/dev/oss/oss_hdaudio0/spdout0 (audio engine 5): HD Audio play spdif-out <br />
- Performing audio playback test... <br />
<left> OK <right> OK <stereo> OK <measured srate 47991.00 Hz (-0.02%)> <br />
<br />
If this passed the test on all left, right and stereo, proceed to next step.<br />
<br />
So from here:<br />
[http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Changing_the_default_sound_output Changing_the_default_sound_output]<br />
you get the command to change the default output; change according to what works for you<br />
sudo ln -sf /dev/oss/oss_hdaudio0/spdout0 /dev/dsp_multich<br />
With 5.1 surround, chose dsp_multichannel; with 2 channel, dsp should work.<br />
<br />
===Creative Sound Blaster X-Fi Surround 5.1 SB1090 USB===<br />
<br />
This information is completely from [http://www.4front-tech.com/forum/viewtopic.php?f=3&t=3423 4front-tech.com] ; courtesy of kristian and Maxa. Thanks!!<br />
<br />
It's surprising to learn that the external card does not work just because of a missing true return value in the function write_control_value(...) in ossusb_audio.c.<br />
<br />
To fix this, a recompile of oss is nessasary, for now.<br />
<br />
1. Grab the latest oss from the Arch Repo<br />
http://repos.archlinux.org/wsvn/community/oss/repos/community-x86_64/<br />
<br />
2. Extract it<br />
<br />
3. cd to the folder, I renamed the folder to oss<br />
<br />
4. run makepkg --nobuild<br />
<br />
5. cd to src/kernel/drv/oss_usb/ ; '''edit the ossusb_audio.c''' ; '''add a Return 1''' ; should look like so and '''SAVE'''<br />
static int<br />
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,<br />
int ctl, int l, unsigned int v)<br />
{<br />
return 1;<br />
<br />
6. do a makepkg --noextract<br />
<br />
Now you must install the package with pacman -U ; remove oss first if already installed <nowiki>(pacman -Rd oss)</nowiki><br />
<br />
===A simple systray applet===<br />
Want a applet to control volume like in GNOME? Form [http://bbs.archlinux.org/viewtopic.php?id=77440 here] I got a usable [http://pastebin.furver.se/0xflchkfz/ one]. <br />
<br />
Download [http://pastebin.furver.se/0xflchkfz/0xflchkfz.txt this] script and rename whatever you want, e.g.: ossvolctl. run the following command:<br />
$chmod +x ossvolctl<br />
#cp ossvolctl /usr/bin/ossvolctl<br />
or<br />
#install -Dm755 ossvolctl /usr/bin/ossvolctl<br />
<br />
===Start ossxmix docked to systray on startup===<br />
<br />
'''KDE 4'''<br />
<br />
Create an application launcher file named <code>ossxmix.desktop</code> in you local application launchers directory (<code>~/.local/share/applications/</code> then enter:<br />
<br />
<pre>[Desktop Entry]<br />
Name=Open Sound System Mixer<br />
GenericName=Audio Mixer<br />
Exec=ossxmix -b<br />
Icon=audio-card<br />
Categories=Application;GTK;AudioVideo;Player;<br />
Terminal=false<br />
Type=Application<br />
Encoding=UTF-8</pre><br />
<br />
To add it to autostart when loading the desktop environment:<br />
<br />
System Settings > Advanced tab > Autostart. Then click add program and choose it from the 'Multimedia' list.<br />
<br />
'''Gnome''' <br />
<br />
*As Root create a file /usr/local/bin/ossxmix_bg with the following content:<br />
<br />
<pre><br />
#!/bin/bash<br />
exec /usr/bin/ossxmix -b<br />
</pre><br />
<br />
Goto System > Preferences > Start Up Applications<br />
<br />
*Click Add, Type OSSMIX in Name field and <code>/usr/local/bin/ossxmix_bg</code> in Command field then click Add button.<br />
<br />
*Login and Logout to see the changes.<br />
<br />
===Record sound output from a program===<br />
<br />
* [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Recording_sound_output_of_a_program Recording sound output of a program].<br />
<br />
===Suspend and Hibernation===<br />
<br />
OSS does not automatically support suspend meaning that OSS must be manually stopped prior to suspending or hibernating.<br />
<br />
OSS provides <tt>soundon</tt> and <tt>soundoff</tt> to enable and disable OSS, although any processes that use sound must be terminated first.<br />
<br />
The following script is a rather basic method of automatically unloading OSS prior to suspending and reloading afterwards.<br />
<br />
#!/bin/sh<br />
. "${PM_FUNCTIONS}"<br />
<br />
suspend_osssound()<br />
{<br />
/usr/lib/oss/scripts/killprocs.sh<br />
/usr/sbin/soundoff<br />
}<br />
<br />
resume_osssound()<br />
{<br />
/usr/sbin/soundon<br />
}<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
suspend_osssound<br />
;;<br />
thaw|resume)<br />
resume_osssound<br />
;;<br />
*) exit $NA<br />
;;<br />
esac<br />
<br />
Save the contents of the script (as root) into {{Filename|/etc/pm/sleep.d/50ossound}} and make it executable. {{Filename| chmod a+x /etc/pm/sleep.d/50ossound}}<br />
<br />
{{Note|This script is rather basic and will terminate any application directly accessing OSS, save your work prior to suspending/hibernating.}}<br />
<br />
OSS does not support suspending but we don't care or better [http://wiki.archlinux.org/index.php/Suspend_to_RAM s2ram] works fine without stopping OSS.<br />
Just create a nice suspend script to /sbin/suspend and make it executable.<br />
<br />
<pre><br />
#!/bin/bash<br />
<br />
if [ [ $EUID -ne 0 ] ]; then<br />
## Checking if you are a root or not<br />
echo "This script must be run as root" 1>&2<br />
exit 1<br />
fi<br />
<br />
s2ram -f<br />
<br />
sleep 2<br />
<br />
/etc/rc.d/oss restart 2>/tmp/oss.txt<br />
<br />
if [ $? -gt 0 ]; then<br />
echo "OSS restart failed check /tmp/oss.txt for advice"<br />
fi<br />
<br />
exit 0<br />
</pre><br />
<br />
That's all your apps are fine and suspend works. \o/<br />
<br />
{{Note | If you are using Opera you must kill operapluginwrapper before suspend. To do this add '''<nowiki>PID=`pidof operapluginwrapper`;kill -9 $PID</nowiki>''' before s2ram -f. }}<br />
<br />
===ALSA emulation===<br />
You can instruct <tt>alsa-lib</tt> to use OSS as its audio output system. This works as a sort of ALSA emulation.<br />
<br />
Note, however, that this method may introduce additional latency in your sound output, and that the emulation is not complete and doesn't work with all applications. It doesn't work, for example, with programs that try to detect devices using ALSA.<br />
<br />
So, as most applications support OSS directly, use this method only as a last resort.<br />
<br />
In the future, more complete methods may be available for emulating ALSA, such as <tt>libsalsa</tt> and <tt>cuckoo</tt>.<br />
<br />
====Instructions====<br />
<br />
* Install the <tt>alsa-plugins</tt> package.<br />
<br />
# pacman -S alsa-plugins<br />
<br />
* Edit {{Filename|/etc/asound.conf}} as follows.<br />
<br />
pcm.oss {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
pcm.!default {<br />
type oss<br />
device /dev/dsp<br />
}<br />
<br />
ctl.oss {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
ctl.!default {<br />
type oss<br />
device /dev/mixer<br />
}<br />
<br />
{{Note | If you don't want to use OSS anymore, don't forget to revert changes that you do here in {{Filename|/etc/asound.conf}}.}}<br />
<br />
==Experimental packages==<br />
<br />
===Mercurial repository version===<br />
<br />
There is a [http://aur.archlinux.org/packages.php?ID=21126 oss-mercurial package] in AUR. This package compiles and installs the latest OSS development version direcly from the Mercurial repository.<br />
<br />
You can try this package if you want to contribute code to OSS or if only a very recent change in OSS code introduced support to your sound device.<br />
<br />
If you want oss to take care of your flash sound you will need to install libflashsupport:<br />
<br />
# pacman -S libflashsupport</div>Timehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=87537Mirrors2009-12-12T23:58:32Z<p>Time: missing tmpl</p>
<hr />
<div>[[Category: About Arch (English)]]<br />
[[Category:Package management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:Mirrors}}<br />
{{i18n_entry|简体中文|:Arch镜像 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
== Enabling your favorite mirror ==<br />
<br />
The default pacman configuration ({{Filename|/etc/pacman.conf}}) for ''core'' looks like this:<br />
<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
If you want to use the HostEurope mirror as your default mirror, just add it before the <tt>Include</tt> line:<br />
<br />
[core]<br />
Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/i686</nowiki><br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
{{Note| The release of pacman 3.1 introduced the {{Filename|/etc/pacman.d/mirrorlist}} with the variable $repo, no need to maintain separate list for each repository.}}<br />
<br />
Pacman will now try to connect to this mirror first. You can do the same for ''testing'', ''extra'', and ''community'''.<br />
<br />
{{Warning| Use the same mirror for all repositories. Otherwise packages may get installed that are incompatible to each other (like kernel26 from ''core'' and another (older) kernel module from ''extra'').}}<br />
<br />
== Mirror list ==<br />
<br />
This is a list of all known Arch Linux mirrors, that's more up to date than the [http://www.archlinux.org/download/ official download page] or the [http://repos.archlinux.org/viewvc.cgi/pacman-mirrorlist/trunk/ files in {{Filename|/etc/pacman.d/}}. If you know of a mirror that is not listed, please add it. Mirrors which are no longer updated or have been unavailable for a long time can be deleted.<br />
<br />
==Mirror status==<br />
<br />
You can check the status of the Arch mirrors and how up to date they are, by visiting: http://users.archlinux.de/~gerbra/mirrorcheck.html and/or http://www.archlinux.de/?page=MirrorStatus<br />
<br />
Or<br />
<br />
Check just how up-to-date your chosen mirror is by:<br />
# pick a server and browse to "extra/os/"<br />
# load http://www.archlinux.org/ in another tab or window<br />
# compare the last-modified date of the "i686" directory on the mirror to the "Extra" date on the homepage, in the "Package Repositories" box to the right.<br />
<br />
{{Note| Many sites also provide http service, but keep in mind that pacman relies on ftp to determine if a repository got updated. With http it fetches the repository database each time you run 'pacman -Sy', even if it didn't change since the last run.}}<br />
<br />
== Sort your mirrors by their speed ==<br />
Don't forget to take full advantage of using the fastest mirror for ''you'' which you can determine via the included python script, {{filename|/usr/bin/rankmirrors}}. First, use pacman to install python if you haven't already done so:<br />
# pacman -S python <br />
'''cd''' to the /etc/pacman.d/ directory:<br />
# cd /etc/pacman.d<br />
Backup your existing {{Filename|/etc/pacman.d/mirrorlist}}:<br />
# cp mirrorlist mirrorlist.backup<br />
<br />
Edit{{filename| mirrorlist.backup}} and uncomment mirrors you want to test with rankmirrors:<br />
# nano mirrorlist.backup<br />
<br />
Run the following {{codeline|sed}} line to uncomment every mirror:<br />
# sed '/^#\S/ s|#||' -i mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{codeline|-n 6}} means only output the 6 fastest mirrors: <br />
# rankmirrors -n 6 mirrorlist.backup > mirrorlist<br />
<br />
'''Force pacman to refresh the package lists'''<br />
<br />
After creating/editing your {{Filename|/etc/pacman.d/mirrorlist}}, (manually or by using /usr/bin/rankmirrors) issue the following command:<br />
# pacman -Syy<br />
{{Tip| Passing two --refresh or -y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syy ''whenever a mirror is changed'', is good practice and will avoid possible headaches.}}<br />
<br />
===Combining Sort your mirrors by their speed with Mirror status===<br />
It is not a good idea to just use the fastest mirror(s), since the fastest mirror(s) might be out of date. The preferred way would be, to use [[Mirrors#Sort your mirrors by their speed]]. Then sorting those 6 fastest mirrors, by their [[Mirror#Mirror status]]. <br />
<br />
Simply visit either one or both [[Mirrors#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirror(s) to the top of {{Filename|/etc/pacman.d/mirrorlist}} and if the mirror(s) are way out of date simply don't use those; repeat the process leaving out the outdated mirror(s). So you end up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors. <br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if you don't have mirror issues, too keep {{Filename|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
== Official mirrors ==<br />
'''Attention: Do not add new mirrors to the list below. If you want your mirror to be added to official list - file a feature request. In the meantime add it to the "Unofficial mirrors" list at the end of this page.'''<br />
<br />
=== Australia ===<br />
*ftp://mirror.pacific.net.au/linux/archlinux/ <sub>[http://mirror.pacific.net.au/linux/archlinux/ http]</sub> <sub>[rsync://mirror.pacific.net.au/linux/archlinux/]</sub><br />
*ftp://mirror.aarnet.edu.au/pub/archlinux/ <sub>[http://mirror.aarnet.edu.au/pub/archlinux/ http]</sub> <sub>[rsync://mirror.aarnet.au/pub/archlinux/]</sub><br />
*ftp://ftp.iinet.net.au/pub/archlinux/ <sub>[http://ftp.iinet.net.au/pub/archlinux/ http]</sub> <sub>[rsync://ftp.iinet.net.au/archlinux/]</sub><br />
*http://mirror.internode.on.net/pub/archlinux/ <sub>[rsync://mirror.internode.on.net/pub/archlinux/]</sub><br />
<br />
=== Austria ===<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/ <sub>[http://gd.tuwien.ac.at/opsys/linux/archlinux/ http]</sub><br />
<br />
=== Belgium ===<br />
*ftp://ftp.belnet.be/mirror/archlinux.org/ <sub>[http://ftp.belnet.be/mirror/archlinux.org/ http]</sub><br />
*ftp://archlinux.mirror.kangaroot.net/pub/archlinux/ <sub>[http://archlinux.mirror.kangaroot.net/ http]</sub> <sub>[rsync://archlinux.mirror.kangaroot.net::archlinux]</sub><br />
=== Brazil ===<br />
*ftp://archlinux.c3sl.ufpr.br/archlinux/ <sub>[http://archlinux.c3sl.ufpr.br/ http]</sub> <sub>[rsync://archlinux.c3sl.ufpr.br/archlinux rsync]</sub><br />
*ftp://ftp.las.ic.unicamp.br/pub/archlinux <sub>[http://www.las.ic.unicamp.br/pub/archlinux http]</sub> <sub>[rsync://rsync.las.ic.unicamp.br/pub/archlinux rsync]</sub><br />
*http://pet.inf.ufsc.br/mirrors/archlinux/<br />
<br />
=== Canada ===<br />
*http://mirror.twilightlair.net/arch/ <sub>[rsync://mirror.twilightlair.net/arch/ rsync]</sub><br />
*ftp://mirror.csclub.uwaterloo.ca/archlinux/ <sub>[http://mirror.csclub.uwaterloo.ca/archlinux/ http]</sub> <sub>[rsync://mirror.csclub.uwaterloo.ca/archlinux/ rsync]</sub><br />
*ftp://mirrors.portafixe.com/archlinux/ <sub>[http://mirrors.portafixe.com/archlinux/ http]</sub><br />
<br />
=== Czech Republic ===<br />
*ftp://ftp.sh.cvut.cz/MIRRORS/arch/ <sub>[http://ftp.sh.cvut.cz/MIRRORS/arch/ http]</sub><br />
<br />
=== Denmark ===<br />
*ftp://ftp.klid.dk/archlinux/<br />
<br />
=== Estonia ===<br />
*ftp://ftp.estpak.ee/pub/archlinux/ <sub>[http://ftp.estpak.ee/pub/archlinux/ http]</sub><br />
<br />
=== France ===<br />
*ftp://mir1.archlinuxfr.org/archlinux <sub>[http://mir1.archlinuxfr.org/archlinux http]</sub> <sub>[rsync://mir1.archlinuxfr.org/archlinux rsync]</sub><br />
*ftp://mir2.archlinuxfr.org/archlinux <sub>[http://mir2.archlinuxfr.org/archlinux http]</sub> <sub>[rsync://mir2.archlinuxfr.org/archlinux rsync]</sub><br />
*ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ <sub>[http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ http]</sub> <sub>[rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ rsync]</sub><br />
*http://mir.archlinux.fr/<br />
*ftp://ftp.free.fr/mirrors/ftp.archlinux.org/<br />
*ftp://ftp.rez-gif.supelec.fr/Linux/archlinux/<br />
<br />
=== Germany ===<br />
*ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/ <sub>[http://ftp.hosteurope.de/mirror/ftp.archlinux.org/ http]</sub><br />
*ftp://ftp5.gwdg.de/pub/linux/archlinux/ <sub>[http://ftp5.gwdg.de/pub/linux/archlinux/ http]</sub> <sub>[rsync://ftp5.gwdg.de/pub/linux/archlinux/ rsync]</sub><br />
*ftp://ftp.uni-bayreuth.de/pub/linux/archlinux <sub>[http://ftp.uni-bayreuth.de/linux/archlinux http]</sub> <sub>[rsync://rsync.uni-bayreuth.de/archlinux/ rsync]</sub><br />
*ftp://ftp.archlinuxppc.org/i686/<br />
*ftp://ftp.tu-chemnitz.de/pub/linux/archlinux/ <sub>[http://ftp.tu-chemnitz.de/pub/linux/archlinux/ http]</sub><br />
*ftp://ftp.uni-kl.de/pub/linux/archlinux/ <sub>[http://ftp.uni-kl.de/pub/linux/archlinux/ http]</sub> <sub>[rsync: ftp.uni-kl.de::pub/linux/archlinux/ rsync]</sub><br />
*http://mirrors.igprolin-online.org/pub/archlinux<br />
*ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/ <sub>[http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/ http]</sub> <sub>[rsync://ftp-stud.hs-esslingen.de/archlinux/ rsync]</sub><br />
<br />
*ftp://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/<br />
*http://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/<br />
<br />
=== Great Britain ===<br />
*http://www.mirrorservice.org/sites/ftp.archlinux.org/<br />
*ftp://mirrors.uk2.net/pub/archlinux/ <sub>[http://archlinux.mirrors.uk2.net/ http]</sub><br />
*http://mirror.lividpenguin.com/pub/archlinux/ <sub>[ftp://mirror.lividpenguin.com/pub/archlinux/ ftp]</sub><br />
<br />
=== Greece ===<br />
*ftp://ftp.ntua.gr/pub/linux/archlinux/ <sub>[http://ftp.ntua.gr/pub/linux/archlinux/ http]</sub><br />
<br />
=== Hungary ===<br />
*ftp://ftp.mfa.kfki.hu/pub/mirrors/ftp.archlinux.org/<br />
<br />
=== Ireland ===<br />
*ftp://ftp.heanet.ie/mirrors/ftp.archlinux.org/ <sub>[http://ftp.heanet.ie/mirrors/ftp.archlinux.org/ http]</sub><br />
<br />
=== Indonesia ===<br />
*ftp://archlinux.cbn.net.id/pub/archlinux/ <sub>[http://archlinux.cbn.net.id/ http]</sub><br />
<br />
=== Israel ===<br />
*http://mirror.isoc.org.il/pub/archlinux/<br />
<br />
=== Italy ===<br />
*ftp://mi.mirror.garr.it/mirrors/archlinux/ <sub>[http://mi.mirror.garr.it/mirrors/archlinux/ http]</sub><br />
<br />
=== Japan ===<br />
*http://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/ <sub>[ftp://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/ ftp]</sub><br />
<br />
=== Latvia ===<br />
* http://archlinux.goodsoft.lv/<br />
<br />
=== Lithuania ===<br />
*ftp://atviras.lt/archmirror/ <sub>[http://atviras.lt/archmirror/ http]</sub><br />
<br />
=== Netherlands ===<br />
*ftp://ftp.nluug.nl/pub/metalab/distributions/archlinux/ <sub>[http://ftp.nluug.nl/pub/metalab/distributions/archlinux/ http]</sub><br />
*ftp://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/ <sub>[http://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/ http]</sub><br />
<br />
=== Norway ===<br />
*http://mirror.archlinux.no/ <sub>[ftp://mirror.archlinux.no/ ftp]</sub>(rsync available)<br />
<br />
=== Poland ===<br />
*ftp://mirror.icis.pcz.pl/archlinux/<br />
*ftp://ftp.piotrkosoft.net/pub/mirrors/ftp.archlinux.org/ [http://piotrkosoft.net/pub/mirrors/ftp.archlinux.org/ http]<br />
*http://unix.net.pl/archlinux.org/<br />
<br />
=== Portugal ===<br />
*ftp://cesium.di.uminho.pt/pub/archlinux/ <sub>[http://cesium.di.uminho.pt/pub/archlinux/ http]</sub><br />
*ftp://darkstar.ist.utl.pt/pub/archlinux/ <sub>[http://darkstar.ist.utl.pt/archlinux/ http]</sub><br />
*ftp://ftp.nux.ipb.pt/pub/dists/archlinux/ <sub>[http://ftp.nux.ipb.pt/pub/dists/archlinux/ http]</sub><br />
<br />
=== Romania ===<br />
*ftp://ftp.iasi.roedu.net/mirrors/archlinux.org/ <sub>[http://ftp.iasi.roedu.net/mirrors/archlinux.org/ http]</sub><br />
*http://mirror.archlinux.ro/archlinux <sub>[http://mirror.archlinux.ro/archlinux http] </sub><br />
<br />
=== Russia ===<br />
*ftp://mirror.yandex.ru/archlinux/ <sub>[http://mirror.yandex.ru/archlinux/ http]</sub> (rsync available)<br />
*http://archlinux.freeside.ru/ - outdated (last updated at 26 March 2009)<br />
<br />
=== Sweden ===<br />
*ftp://ftp.ds.hj.se/pub/os/linux/archlinux/ <sub>[http://ftp.ds.hj.se/pub/os/linux/archlinux/ http]</sub><br />
*ftp://ftp.gigabit.nu/ <sub>[http://ftp.gigabit.nu/ http]</sub><br />
<br />
=== Switzerland ===<br />
*ftp://archlinux.puzzle.ch/ <sub>[http://archlinux.puzzle.ch/ http]</sub><br />
<br />
=== Taiwan ===<br />
* ftp://cle.linux.org.tw/pub/ArchLinux/ (no ''testing'', no new isos)<br />
<br />
=== Turkey ===<br />
*ftp://ftp.linux.org.tr/archlinux/ <sub>[http://ftp.linux.org.tr/archlinux/ http]</sub><br />
*http://server.elsistech.com/archlinux/<br />
<br />
=== Ukraine ===<br />
*ftp://archlinux.hell.org.ua/archlinux/ <sub>[http://archlinux.hell.org.ua/archlinux http]</sub>(rsync available)<br />
*ftp://ftp.linux.kiev.ua/pub/Linux/ArchLinux/ <sub>[http://ftp.linux.kiev.ua/pub/Linux/ArchLinux/ http]</sub><br />
<br />
=== United States ===<br />
*ftp://ftp.archlinux.org/<br />
*ftp://locke.suu.edu/linux/dist/archlinux/<br />
*http://archlinux.unixheads.org/<br />
*ftp://ftp.gtlib.gatech.edu/pub/linux/distributions/archlinux/ [http://www.gtlib.gatech.edu/pub/linux/distributions/archlinux/ http]<br />
*ftp://mirror.cs.vt.edu/pub/ArchLinux/ <sub>[http://mirror.cs.vt.edu/pub/ArchLinux/ http]</sub> (rsync available)<br />
*ftp://mirrors.easynews.com/linux/archlinux/ <sub>[http://mirrors.easynews.com/linux/archlinux/ http]</sub><br />
*ftp://ibiblio.org/pub/linux/distributions/archlinux/ <sub>[http://distro.ibiblio.org/pub/linux/distributions/archlinux/ http]</sub><br />
*http://archlinux.umflint.edu/<br />
*http://mirror.neotuli.net/<br />
*ftp://mirror.rit.edu/archlinux/ <sub>[http://mirror.rit.edu/archlinux/ http]</sub> <sub>[rsync://mirror.rit.edu/archlinux/ rsync]</sub><br />
* http://schlunix.org/archlinux/<br />
* http://mirror.umoss.org/archlinux/ <sub>[rsync://mirror.umoss.org/archlinux/ rsync]</sub><br />
* http://mirror.archlinux.com.ve/<br />
* http://mirrors.gigenet.com/archlinux/<br />
<br />
=== Venezuela ===<br />
* http://mirror2.archlinux.com.ve/<br />
<br />
=== Vietnam ===<br />
*ftp://ftp.indochinalinux.com/archlinux/ (frequent DNS problems, IP is 202.78.230.5)<br />
<br />
== Unofficial mirrors ==<br />
'''These mirrors are not listed in {{Filename|/etc/pacman.d/mirrorlist}}.'''<br />
<br />
=== Global ===<br />
* http://prdownloads.sourceforge.net/archlinux/ ( Doesn't have recent ISO releases. Use it only if for some reason you want to use an older ISO. )<br />
<br />
=== Australia ===<br />
*http://mirror.optus.com.au/pub/archlinux/ <sub>[http://mirror.optus.com.au/pub/archlinux/ http]</sub> <sub>[rsync://mirror.optus.com.au/pub/archlinux/]</sub><br />
<br />
=== Bulgaria ===<br />
* http://archlinux.igor.onlinedirect.bg/ <sub>[http://archlinux.igor.onlinedirect.bg http]</sub><br />
* ftp://archlinux.igor.onlinedirect.bg/linux/archlinux/ <sub>[http://archlinux.igor.onlinedirect.bg http]</sub><br />
<br />
=== China ===<br />
* http://mirrors.lcuc.org.cn/archlinux/<br />
* http://mirror.lupaworld.com/archlinux/<br />
* http://public.gooth.cn/archlinux/ (only include i686)<br />
* http://mirrors.163.com/archlinux/<br />
* http://mirror.bjtu.edu.cn/archlinux/<br />
* http://mirrors.sohu.com/archlinux/<br />
<br />
=== Germany ===<br />
* http://arch.uplinkzero.com/<br />
* ftp://ftp.uni-erlangen.de/mirrors/archlinux/ <sub>[http://ftp.uni-erlangen.de/mirrors/archlinux/ http]</sub><br />
<br />
=== Great Britain ===<br />
* ftp://mirror.lividpenguin.com/pub/archlinux/ <sub>[http://mirror.lividpenguin.com/pub/archlinux/ http]</sub><br />
<br />
=== Lithuania ===<br />
* ftp://atviras.lt/archmirror/ <sub>[http://atviras.lt/archmirror/ http]</sub><br />
<br />
=== Malaysia ===<br />
* http://oss.mmu.edu.my/pub/distro/arch (ISOs only)<br />
* http://mirror.oscc.org.my/archlinux/<br />
<br />
=== New Caledonia ===<br />
* ftp://archlinux.nautile.nc/archlinux/ <sub>[http://archlinux.nautile.nc/archlinux/ http]</sub> <sub>[rsync://archlinux.nautile.nc/archlinux/ rsync]</sub> (no ISO image)<br />
<br />
=== New Zealand ===<br />
* http://mirror.ihug.co.nz/archlinux/<br />
<br />
=== Norway ===<br />
* http://power.klette.us/mirror/<br />
<br />
=== Poland ===<br />
* ftp://ftp.icm.edu.pl/pub/Linux/sunsite/distributions/archlinux/ [http://ftp.icm.edu.pl/pub/Linux/sunsite/distributions/archlinux/ http] - up-to-date, but no Core repository<br />
<br />
=== South Africa ===<br />
<br />
* http://archlinux.mirror.ac.za/ TENET Mirror<br />
* ftp://archlinux.mirror.ac.za/<br />
* http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ Stellenbosch University<br />
* ftp://ftp.sun.ac.za/pub/mirrors/archlinux/<br />
* http://ftp.leg.uct.ac.za/pub/linux/arch/ University of Cape Town<br />
* ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
<br />
=== Spain ===<br />
*ftp://ftp.udc.es/mirror/archlinux/ <sub>[http://ftp.udc.es/mirror/archlinux/ http]</sub> <sub>[rsync://ftp.udc.es/mirror/archlinux/ rsync]</sub><br />
<br />
=== United States ===<br />
* http://archlinux.linuxfreedom.com Contains all the ISO images<br />
* ftp://mirrors.acm.jhu.edu/arch/ <sub>[http://mirrors.acm.jhu.edu/arch http]</sub> <sub>[rsync://mirrors.acm.jhu.edu/arch rsync]</sub><br />
* ftp://ftp.osuosl.org/pub/archlinux/ <sub>[http://ftp.osuosl.org/pub/archlinux/ http]</sub> (i686 only - ''current'' and ''extra'') - outdated<br />
<br />
== IPv6-ready mirrors ==<br />
*http://power.klette.us/mirror/ (Norway)<br />
*http://arch.iskrembilen.com/ (Norway, rsync available)<br />
*niue.belnet.be (Belgium)<br />
*ftp.estpak.ee (Estonia)<br />
*patroklos.noc.ntua.gr (Greece)<br />
*ftp.heanet.ie (Ireland)<br />
*ftp.nluug.nl (Netherlands)<br />
*ftp.surfnet.nl (Netherlands)<br />
*ftp.sixnix.net/ftp6.sixnix.net (Finland) - dead</div>Timehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=87536Mirrors2009-12-12T23:55:16Z<p>Time: clar</p>
<hr />
<div>[[Category: About Arch (English)]]<br />
[[Category:Package management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:Mirrors}}<br />
{{i18n_entry|简体中文|:Arch镜像 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
== Enabling your favorite mirror ==<br />
<br />
The default pacman configuration ({{Filename|/etc/pacman.conf}}) for ''core'' looks like this:<br />
<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
If you want to use the HostEurope mirror as your default mirror, just add it before the <tt>Include</tt> line:<br />
<br />
[core]<br />
Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/i686</nowiki><br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
{{Note| The release of pacman 3.1 introduced the {{Filename|/etc/pacman.d/mirrorlist}} with the variable $repo, no need to maintain separate list for each repository.}}<br />
<br />
Pacman will now try to connect to this mirror first. You can do the same for ''testing'', ''extra'', and ''community'''.<br />
<br />
{{Warning| Use the same mirror for all repositories. Otherwise packages may get installed that are incompatible to each other (like kernel26 from ''core'' and another (older) kernel module from ''extra'').}}<br />
<br />
== Mirror list ==<br />
<br />
This is a list of all known Arch Linux mirrors, that's more up to date than the [http://www.archlinux.org/download/ official download page] or the [http://repos.archlinux.org/viewvc.cgi/pacman-mirrorlist/trunk/ files in {{Filename|/etc/pacman.d/}}. If you know of a mirror that is not listed, please add it. Mirrors which are no longer updated or have been unavailable for a long time can be deleted.<br />
<br />
==Mirror status==<br />
<br />
You can check the status of the Arch mirrors and how up to date they are, by visiting: http://users.archlinux.de/~gerbra/mirrorcheck.html and/or http://www.archlinux.de/?page=MirrorStatus<br />
<br />
Or<br />
<br />
Check just how up-to-date your chosen mirror is by:<br />
# pick a server and browse to "extra/os/"<br />
# load http://www.archlinux.org/ in another tab or window<br />
# compare the last-modified date of the "i686" directory on the mirror to the "Extra" date on the homepage, in the "Package Repositories" box to the right.<br />
<br />
{{Note| Many sites also provide http service, but keep in mind that pacman relies on ftp to determine if a repository got updated. With http it fetches the repository database each time you run 'pacman -Sy', even if it didn't change since the last run.}}<br />
<br />
== Sort your mirrors by their speed ==<br />
Don't forget to take full advantage of using the fastest mirror for ''you'' which you can determine via the included python script /usr/bin/rankmirrors. First, use pacman to install python if you haven't already done so:<br />
# pacman -S python <br />
'''cd''' to the /etc/pacman.d/ directory:<br />
# cd /etc/pacman.d<br />
Backup your existing {{Filename|/etc/pacman.d/mirrorlist}}:<br />
# cp mirrorlist mirrorlist.backup<br />
<br />
Edit mirrorlist.backup and uncomment mirrors you want to test with rankmirrors.<br />
# nano mirrorlist.backup<br />
<br />
Run the following sed line to uncomment every mirror:<br />
# sed '/^#\S/ s|#||' -i mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{codeline|-n 6}} means only output the 6 fastest mirrors: <br />
# rankmirrors -n 6 mirrorlist.backup > mirrorlist<br />
<br />
'''Force pacman to refresh the package lists'''<br />
<br />
After creating/editing your {{Filename|/etc/pacman.d/mirrorlist}}, (manually or by using /usr/bin/rankmirrors) issue the following command:<br />
# pacman -Syy<br />
{{Tip| Passing two --refresh or -y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syy ''whenever a mirror is changed'', is good practice and will avoid possible headaches.}}<br />
<br />
===Combining Sort your mirrors by their speed with Mirror status===<br />
It is not a good idea to just use the fastest mirror(s), since the fastest mirror(s) might be out of date. The preferred way would be, to use [[Mirrors#Sort your mirrors by their speed]]. Then sorting those 6 fastest mirrors, by their [[Mirror#Mirror status]]. <br />
<br />
Simply visit either one or both [[Mirrors#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirror(s) to the top of {{Filename|/etc/pacman.d/mirrorlist}} and if the mirror(s) are way out of date simply don't use those; repeat the process leaving out the outdated mirror(s). So you end up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors. <br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if you don't have mirror issues, too keep {{Filename|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
== Official mirrors ==<br />
'''Attention: Do not add new mirrors to the list below. If you want your mirror to be added to official list - file a feature request. In the meantime add it to the "Unofficial mirrors" list at the end of this page.'''<br />
<br />
=== Australia ===<br />
*ftp://mirror.pacific.net.au/linux/archlinux/ <sub>[http://mirror.pacific.net.au/linux/archlinux/ http]</sub> <sub>[rsync://mirror.pacific.net.au/linux/archlinux/]</sub><br />
*ftp://mirror.aarnet.edu.au/pub/archlinux/ <sub>[http://mirror.aarnet.edu.au/pub/archlinux/ http]</sub> <sub>[rsync://mirror.aarnet.au/pub/archlinux/]</sub><br />
*ftp://ftp.iinet.net.au/pub/archlinux/ <sub>[http://ftp.iinet.net.au/pub/archlinux/ http]</sub> <sub>[rsync://ftp.iinet.net.au/archlinux/]</sub><br />
*http://mirror.internode.on.net/pub/archlinux/ <sub>[rsync://mirror.internode.on.net/pub/archlinux/]</sub><br />
<br />
=== Austria ===<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/ <sub>[http://gd.tuwien.ac.at/opsys/linux/archlinux/ http]</sub><br />
<br />
=== Belgium ===<br />
*ftp://ftp.belnet.be/mirror/archlinux.org/ <sub>[http://ftp.belnet.be/mirror/archlinux.org/ http]</sub><br />
*ftp://archlinux.mirror.kangaroot.net/pub/archlinux/ <sub>[http://archlinux.mirror.kangaroot.net/ http]</sub> <sub>[rsync://archlinux.mirror.kangaroot.net::archlinux]</sub><br />
=== Brazil ===<br />
*ftp://archlinux.c3sl.ufpr.br/archlinux/ <sub>[http://archlinux.c3sl.ufpr.br/ http]</sub> <sub>[rsync://archlinux.c3sl.ufpr.br/archlinux rsync]</sub><br />
*ftp://ftp.las.ic.unicamp.br/pub/archlinux <sub>[http://www.las.ic.unicamp.br/pub/archlinux http]</sub> <sub>[rsync://rsync.las.ic.unicamp.br/pub/archlinux rsync]</sub><br />
*http://pet.inf.ufsc.br/mirrors/archlinux/<br />
<br />
=== Canada ===<br />
*http://mirror.twilightlair.net/arch/ <sub>[rsync://mirror.twilightlair.net/arch/ rsync]</sub><br />
*ftp://mirror.csclub.uwaterloo.ca/archlinux/ <sub>[http://mirror.csclub.uwaterloo.ca/archlinux/ http]</sub> <sub>[rsync://mirror.csclub.uwaterloo.ca/archlinux/ rsync]</sub><br />
*ftp://mirrors.portafixe.com/archlinux/ <sub>[http://mirrors.portafixe.com/archlinux/ http]</sub><br />
<br />
=== Czech Republic ===<br />
*ftp://ftp.sh.cvut.cz/MIRRORS/arch/ <sub>[http://ftp.sh.cvut.cz/MIRRORS/arch/ http]</sub><br />
<br />
=== Denmark ===<br />
*ftp://ftp.klid.dk/archlinux/<br />
<br />
=== Estonia ===<br />
*ftp://ftp.estpak.ee/pub/archlinux/ <sub>[http://ftp.estpak.ee/pub/archlinux/ http]</sub><br />
<br />
=== France ===<br />
*ftp://mir1.archlinuxfr.org/archlinux <sub>[http://mir1.archlinuxfr.org/archlinux http]</sub> <sub>[rsync://mir1.archlinuxfr.org/archlinux rsync]</sub><br />
*ftp://mir2.archlinuxfr.org/archlinux <sub>[http://mir2.archlinuxfr.org/archlinux http]</sub> <sub>[rsync://mir2.archlinuxfr.org/archlinux rsync]</sub><br />
*ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ <sub>[http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ http]</sub> <sub>[rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ rsync]</sub><br />
*http://mir.archlinux.fr/<br />
*ftp://ftp.free.fr/mirrors/ftp.archlinux.org/<br />
*ftp://ftp.rez-gif.supelec.fr/Linux/archlinux/<br />
<br />
=== Germany ===<br />
*ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/ <sub>[http://ftp.hosteurope.de/mirror/ftp.archlinux.org/ http]</sub><br />
*ftp://ftp5.gwdg.de/pub/linux/archlinux/ <sub>[http://ftp5.gwdg.de/pub/linux/archlinux/ http]</sub> <sub>[rsync://ftp5.gwdg.de/pub/linux/archlinux/ rsync]</sub><br />
*ftp://ftp.uni-bayreuth.de/pub/linux/archlinux <sub>[http://ftp.uni-bayreuth.de/linux/archlinux http]</sub> <sub>[rsync://rsync.uni-bayreuth.de/archlinux/ rsync]</sub><br />
*ftp://ftp.archlinuxppc.org/i686/<br />
*ftp://ftp.tu-chemnitz.de/pub/linux/archlinux/ <sub>[http://ftp.tu-chemnitz.de/pub/linux/archlinux/ http]</sub><br />
*ftp://ftp.uni-kl.de/pub/linux/archlinux/ <sub>[http://ftp.uni-kl.de/pub/linux/archlinux/ http]</sub> <sub>[rsync: ftp.uni-kl.de::pub/linux/archlinux/ rsync]</sub><br />
*http://mirrors.igprolin-online.org/pub/archlinux<br />
*ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/ <sub>[http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/ http]</sub> <sub>[rsync://ftp-stud.hs-esslingen.de/archlinux/ rsync]</sub><br />
<br />
*ftp://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/<br />
*http://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/<br />
<br />
=== Great Britain ===<br />
*http://www.mirrorservice.org/sites/ftp.archlinux.org/<br />
*ftp://mirrors.uk2.net/pub/archlinux/ <sub>[http://archlinux.mirrors.uk2.net/ http]</sub><br />
*http://mirror.lividpenguin.com/pub/archlinux/ <sub>[ftp://mirror.lividpenguin.com/pub/archlinux/ ftp]</sub><br />
<br />
=== Greece ===<br />
*ftp://ftp.ntua.gr/pub/linux/archlinux/ <sub>[http://ftp.ntua.gr/pub/linux/archlinux/ http]</sub><br />
<br />
=== Hungary ===<br />
*ftp://ftp.mfa.kfki.hu/pub/mirrors/ftp.archlinux.org/<br />
<br />
=== Ireland ===<br />
*ftp://ftp.heanet.ie/mirrors/ftp.archlinux.org/ <sub>[http://ftp.heanet.ie/mirrors/ftp.archlinux.org/ http]</sub><br />
<br />
=== Indonesia ===<br />
*ftp://archlinux.cbn.net.id/pub/archlinux/ <sub>[http://archlinux.cbn.net.id/ http]</sub><br />
<br />
=== Israel ===<br />
*http://mirror.isoc.org.il/pub/archlinux/<br />
<br />
=== Italy ===<br />
*ftp://mi.mirror.garr.it/mirrors/archlinux/ <sub>[http://mi.mirror.garr.it/mirrors/archlinux/ http]</sub><br />
<br />
=== Japan ===<br />
*http://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/ <sub>[ftp://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/ ftp]</sub><br />
<br />
=== Latvia ===<br />
* http://archlinux.goodsoft.lv/<br />
<br />
=== Lithuania ===<br />
*ftp://atviras.lt/archmirror/ <sub>[http://atviras.lt/archmirror/ http]</sub><br />
<br />
=== Netherlands ===<br />
*ftp://ftp.nluug.nl/pub/metalab/distributions/archlinux/ <sub>[http://ftp.nluug.nl/pub/metalab/distributions/archlinux/ http]</sub><br />
*ftp://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/ <sub>[http://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/ http]</sub><br />
<br />
=== Norway ===<br />
*http://mirror.archlinux.no/ <sub>[ftp://mirror.archlinux.no/ ftp]</sub>(rsync available)<br />
<br />
=== Poland ===<br />
*ftp://mirror.icis.pcz.pl/archlinux/<br />
*ftp://ftp.piotrkosoft.net/pub/mirrors/ftp.archlinux.org/ [http://piotrkosoft.net/pub/mirrors/ftp.archlinux.org/ http]<br />
*http://unix.net.pl/archlinux.org/<br />
<br />
=== Portugal ===<br />
*ftp://cesium.di.uminho.pt/pub/archlinux/ <sub>[http://cesium.di.uminho.pt/pub/archlinux/ http]</sub><br />
*ftp://darkstar.ist.utl.pt/pub/archlinux/ <sub>[http://darkstar.ist.utl.pt/archlinux/ http]</sub><br />
*ftp://ftp.nux.ipb.pt/pub/dists/archlinux/ <sub>[http://ftp.nux.ipb.pt/pub/dists/archlinux/ http]</sub><br />
<br />
=== Romania ===<br />
*ftp://ftp.iasi.roedu.net/mirrors/archlinux.org/ <sub>[http://ftp.iasi.roedu.net/mirrors/archlinux.org/ http]</sub><br />
*http://mirror.archlinux.ro/archlinux <sub>[http://mirror.archlinux.ro/archlinux http] </sub><br />
<br />
=== Russia ===<br />
*ftp://mirror.yandex.ru/archlinux/ <sub>[http://mirror.yandex.ru/archlinux/ http]</sub> (rsync available)<br />
*http://archlinux.freeside.ru/ - outdated (last updated at 26 March 2009)<br />
<br />
=== Sweden ===<br />
*ftp://ftp.ds.hj.se/pub/os/linux/archlinux/ <sub>[http://ftp.ds.hj.se/pub/os/linux/archlinux/ http]</sub><br />
*ftp://ftp.gigabit.nu/ <sub>[http://ftp.gigabit.nu/ http]</sub><br />
<br />
=== Switzerland ===<br />
*ftp://archlinux.puzzle.ch/ <sub>[http://archlinux.puzzle.ch/ http]</sub><br />
<br />
=== Taiwan ===<br />
* ftp://cle.linux.org.tw/pub/ArchLinux/ (no ''testing'', no new isos)<br />
<br />
=== Turkey ===<br />
*ftp://ftp.linux.org.tr/archlinux/ <sub>[http://ftp.linux.org.tr/archlinux/ http]</sub><br />
*http://server.elsistech.com/archlinux/<br />
<br />
=== Ukraine ===<br />
*ftp://archlinux.hell.org.ua/archlinux/ <sub>[http://archlinux.hell.org.ua/archlinux http]</sub>(rsync available)<br />
*ftp://ftp.linux.kiev.ua/pub/Linux/ArchLinux/ <sub>[http://ftp.linux.kiev.ua/pub/Linux/ArchLinux/ http]</sub><br />
<br />
=== United States ===<br />
*ftp://ftp.archlinux.org/<br />
*ftp://locke.suu.edu/linux/dist/archlinux/<br />
*http://archlinux.unixheads.org/<br />
*ftp://ftp.gtlib.gatech.edu/pub/linux/distributions/archlinux/ [http://www.gtlib.gatech.edu/pub/linux/distributions/archlinux/ http]<br />
*ftp://mirror.cs.vt.edu/pub/ArchLinux/ <sub>[http://mirror.cs.vt.edu/pub/ArchLinux/ http]</sub> (rsync available)<br />
*ftp://mirrors.easynews.com/linux/archlinux/ <sub>[http://mirrors.easynews.com/linux/archlinux/ http]</sub><br />
*ftp://ibiblio.org/pub/linux/distributions/archlinux/ <sub>[http://distro.ibiblio.org/pub/linux/distributions/archlinux/ http]</sub><br />
*http://archlinux.umflint.edu/<br />
*http://mirror.neotuli.net/<br />
*ftp://mirror.rit.edu/archlinux/ <sub>[http://mirror.rit.edu/archlinux/ http]</sub> <sub>[rsync://mirror.rit.edu/archlinux/ rsync]</sub><br />
* http://schlunix.org/archlinux/<br />
* http://mirror.umoss.org/archlinux/ <sub>[rsync://mirror.umoss.org/archlinux/ rsync]</sub><br />
* http://mirror.archlinux.com.ve/<br />
* http://mirrors.gigenet.com/archlinux/<br />
<br />
=== Venezuela ===<br />
* http://mirror2.archlinux.com.ve/<br />
<br />
=== Vietnam ===<br />
*ftp://ftp.indochinalinux.com/archlinux/ (frequent DNS problems, IP is 202.78.230.5)<br />
<br />
== Unofficial mirrors ==<br />
'''These mirrors are not listed in {{Filename|/etc/pacman.d/mirrorlist}}.'''<br />
<br />
=== Global ===<br />
* http://prdownloads.sourceforge.net/archlinux/ ( Doesn't have recent ISO releases. Use it only if for some reason you want to use an older ISO. )<br />
<br />
=== Australia ===<br />
*http://mirror.optus.com.au/pub/archlinux/ <sub>[http://mirror.optus.com.au/pub/archlinux/ http]</sub> <sub>[rsync://mirror.optus.com.au/pub/archlinux/]</sub><br />
<br />
=== Bulgaria ===<br />
* http://archlinux.igor.onlinedirect.bg/ <sub>[http://archlinux.igor.onlinedirect.bg http]</sub><br />
* ftp://archlinux.igor.onlinedirect.bg/linux/archlinux/ <sub>[http://archlinux.igor.onlinedirect.bg http]</sub><br />
<br />
=== China ===<br />
* http://mirrors.lcuc.org.cn/archlinux/<br />
* http://mirror.lupaworld.com/archlinux/<br />
* http://public.gooth.cn/archlinux/ (only include i686)<br />
* http://mirrors.163.com/archlinux/<br />
* http://mirror.bjtu.edu.cn/archlinux/<br />
* http://mirrors.sohu.com/archlinux/<br />
<br />
=== Germany ===<br />
* http://arch.uplinkzero.com/<br />
* ftp://ftp.uni-erlangen.de/mirrors/archlinux/ <sub>[http://ftp.uni-erlangen.de/mirrors/archlinux/ http]</sub><br />
<br />
=== Great Britain ===<br />
* ftp://mirror.lividpenguin.com/pub/archlinux/ <sub>[http://mirror.lividpenguin.com/pub/archlinux/ http]</sub><br />
<br />
=== Lithuania ===<br />
* ftp://atviras.lt/archmirror/ <sub>[http://atviras.lt/archmirror/ http]</sub><br />
<br />
=== Malaysia ===<br />
* http://oss.mmu.edu.my/pub/distro/arch (ISOs only)<br />
* http://mirror.oscc.org.my/archlinux/<br />
<br />
=== New Caledonia ===<br />
* ftp://archlinux.nautile.nc/archlinux/ <sub>[http://archlinux.nautile.nc/archlinux/ http]</sub> <sub>[rsync://archlinux.nautile.nc/archlinux/ rsync]</sub> (no ISO image)<br />
<br />
=== New Zealand ===<br />
* http://mirror.ihug.co.nz/archlinux/<br />
<br />
=== Norway ===<br />
* http://power.klette.us/mirror/<br />
<br />
=== Poland ===<br />
* ftp://ftp.icm.edu.pl/pub/Linux/sunsite/distributions/archlinux/ [http://ftp.icm.edu.pl/pub/Linux/sunsite/distributions/archlinux/ http] - up-to-date, but no Core repository<br />
<br />
=== South Africa ===<br />
<br />
* http://archlinux.mirror.ac.za/ TENET Mirror<br />
* ftp://archlinux.mirror.ac.za/<br />
* http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ Stellenbosch University<br />
* ftp://ftp.sun.ac.za/pub/mirrors/archlinux/<br />
* http://ftp.leg.uct.ac.za/pub/linux/arch/ University of Cape Town<br />
* ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
<br />
=== Spain ===<br />
*ftp://ftp.udc.es/mirror/archlinux/ <sub>[http://ftp.udc.es/mirror/archlinux/ http]</sub> <sub>[rsync://ftp.udc.es/mirror/archlinux/ rsync]</sub><br />
<br />
=== United States ===<br />
* http://archlinux.linuxfreedom.com Contains all the ISO images<br />
* ftp://mirrors.acm.jhu.edu/arch/ <sub>[http://mirrors.acm.jhu.edu/arch http]</sub> <sub>[rsync://mirrors.acm.jhu.edu/arch rsync]</sub><br />
* ftp://ftp.osuosl.org/pub/archlinux/ <sub>[http://ftp.osuosl.org/pub/archlinux/ http]</sub> (i686 only - ''current'' and ''extra'') - outdated<br />
<br />
== IPv6-ready mirrors ==<br />
*http://power.klette.us/mirror/ (Norway)<br />
*http://arch.iskrembilen.com/ (Norway, rsync available)<br />
*niue.belnet.be (Belgium)<br />
*ftp.estpak.ee (Estonia)<br />
*patroklos.noc.ntua.gr (Greece)<br />
*ftp.heanet.ie (Ireland)<br />
*ftp.nluug.nl (Netherlands)<br />
*ftp.surfnet.nl (Netherlands)<br />
*ftp.sixnix.net/ftp6.sixnix.net (Finland) - dead</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87535Polipo2009-12-12T23:48:58Z<p>Time: fix code</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using an [[AUR helper]] like [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
or install the newer development version instead:<br />
$ yaourt -S polipo-git<br />
<br />
==Improving Polipo==<br />
{{note|the git version already has these improvements, except for the designated Polipo user modification.}}<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? != 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? != 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
if ! ck_daemon $DAEMON && [[ $RESTART != 1 ]]; then<br />
$0 stop; sleep 1; RESTART=1 $0 purge<br />
else<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? != 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
[[ $RESTART = 1 ]] && { sleep 1; "$0" start; }<br />
fi<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
</nowiki><br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87532Polipo2009-12-12T22:21:16Z<p>Time: less sloc</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using an [[AUR helper]] like [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
or install the newer development version instead:<br />
$ yaourt -S polipo-git<br />
<br />
==Improving Polipo==<br />
{{note|the git version already has these improvements, except for the designated Polipo user modification.}}<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
if ! ck_daemon $DAEMON && [[ $RESTART -ne 1 ]]; then<br />
$0 stop; sleep 1; RESTART=1 $0 purge<br />
else<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
if [[ -n $RESTART ]]; then<br />
sleep 1; $0 start<br />
fi<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
</nowiki><br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Mirrors&diff=87531Mirrors2009-12-12T21:01:44Z<p>Time: 1 sloc</p>
<hr />
<div>[[Category: About Arch (English)]]<br />
[[Category:Package management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n_links_start}}<br />
{{i18n_entry|English|:Mirrors}}<br />
{{i18n_entry|简体中文|:Arch镜像 (简体中文)}}<br />
{{i18n_links_end}}<br />
<br />
== Enabling your favorite mirror ==<br />
<br />
The default pacman configuration ({{Filename|/etc/pacman.conf}}) for ''core'' looks like this:<br />
<br />
[core]<br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
If you want to use the HostEurope mirror as your default mirror, just add it before the <tt>Include</tt> line:<br />
<br />
[core]<br />
Server = <nowiki>ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/core/os/i686</nowiki><br />
Include = /etc/pacman.d/mirrorlist<br />
<br />
{{Note| The release of pacman 3.1 introduced the {{Filename|/etc/pacman.d/mirrorlist}} with the variable $repo, no need to maintain separate list for each repository.}}<br />
<br />
Pacman will now try to connect to this mirror first. You can do the same for ''testing'', ''extra'', and ''community'''.<br />
<br />
{{Warning| Use the same mirror for all repositories. Otherwise packages may get installed that are incompatible to each other (like kernel26 from ''core'' and another (older) kernel module from ''extra'').}}<br />
<br />
== Mirror list ==<br />
<br />
This is a list of all known Arch Linux mirrors, that's more up to date than the [http://www.archlinux.org/download/ official download page] or the [http://repos.archlinux.org/viewvc.cgi/pacman-mirrorlist/trunk/ files in {{Filename|/etc/pacman.d/}}. If you know of a mirror that is not listed, please add it. Mirrors which are no longer updated or have been unavailable for a long time can be deleted.<br />
<br />
==Mirror status==<br />
<br />
You can check the status of the Arch mirrors and how up to date they are, by visiting: http://users.archlinux.de/~gerbra/mirrorcheck.html and/or http://www.archlinux.de/?page=MirrorStatus<br />
<br />
Or<br />
<br />
Check just how up-to-date your chosen mirror is by:<br />
# pick a server and browse to "extra/os/"<br />
# load http://www.archlinux.org/ in another tab or window<br />
# compare the last-modified date of the "i686" directory on the mirror to the "Extra" date on the homepage, in the "Package Repositories" box to the right.<br />
<br />
{{Note| Many sites also provide http service, but keep in mind that pacman relies on ftp to determine if a repository got updated. With http it fetches the repository database each time you run 'pacman -Sy', even if it didn't change since the last run.}}<br />
<br />
== Sort your mirrors by their speed ==<br />
Don't forget to take full advantage of using the fastest mirror for ''you'' which you can determine via the included python script /usr/bin/rankmirrors. First, use pacman to install python if you haven't already done so:<br />
# pacman -S python <br />
'''cd''' to the /etc/pacman.d/ directory:<br />
# cd /etc/pacman.d<br />
Backup your existing {{Filename|/etc/pacman.d/mirrorlist}}:<br />
# cp mirrorlist mirrorlist.backup<br />
<br />
Edit mirrorlist.backup and uncomment mirrors you want to test with rankmirrors.<br />
# nano mirrorlist.backup<br />
<br />
Run the following sed line to uncomment every mirror:<br />
# sed '/^#\S/ s|#||' -i mirrorlist.backup<br />
<br />
Finally, rank the mirrors. Operand {{codeline|-n 6}} means only process 6 mirrors: <br />
# rankmirrors -n 6 mirrorlist.backup > mirrorlist<br />
<br />
'''Force pacman to refresh the package lists'''<br />
<br />
After creating/editing your {{Filename|/etc/pacman.d/mirrorlist}}, (manually or by using /usr/bin/rankmirrors) issue the following command:<br />
# pacman -Syy<br />
{{Tip| Passing two --refresh or -y flags forces pacman to refresh all package lists even if they are considered to be up to date. Issuing pacman -Syy ''whenever a mirror is changed'', is good practice and will avoid possible headaches.}}<br />
<br />
===Combining Sort your mirrors by their speed with Mirror status===<br />
It is not a good idea to just use the fastest mirror(s), since the fastest mirror(s) might be out of date. The preferred way would be, to use [[Mirrors#Sort your mirrors by their speed]]. Then sorting those 6 fastest mirrors, by their [[Mirror#Mirror status]]. <br />
<br />
Simply visit either one or both [[Mirrors#Mirror status]] links and sort them by the ones that are more up to date. Move the more up to date mirror(s) to the top of {{Filename|/etc/pacman.d/mirrorlist}} and if the mirror(s) are way out of date simply don't use those; repeat the process leaving out the outdated mirror(s). So you end up with a total of 6 mirrors that are sorted by speed and status, leaving out outdated mirrors. <br />
<br />
When having mirror issues the above should be repeated. Or repeat once in a while even if you don't have mirror issues, too keep {{Filename|/etc/pacman.d/mirrorlist}} up to date.<br />
<br />
== Official mirrors ==<br />
'''Attention: Do not add new mirrors to the list below. If you want your mirror to be added to official list - file a feature request. In the meantime add it to the "Unofficial mirrors" list at the end of this page.'''<br />
<br />
=== Australia ===<br />
*ftp://mirror.pacific.net.au/linux/archlinux/ <sub>[http://mirror.pacific.net.au/linux/archlinux/ http]</sub> <sub>[rsync://mirror.pacific.net.au/linux/archlinux/]</sub><br />
*ftp://mirror.aarnet.edu.au/pub/archlinux/ <sub>[http://mirror.aarnet.edu.au/pub/archlinux/ http]</sub> <sub>[rsync://mirror.aarnet.au/pub/archlinux/]</sub><br />
*ftp://ftp.iinet.net.au/pub/archlinux/ <sub>[http://ftp.iinet.net.au/pub/archlinux/ http]</sub> <sub>[rsync://ftp.iinet.net.au/archlinux/]</sub><br />
*http://mirror.internode.on.net/pub/archlinux/ <sub>[rsync://mirror.internode.on.net/pub/archlinux/]</sub><br />
<br />
=== Austria ===<br />
*ftp://gd.tuwien.ac.at/opsys/linux/archlinux/ <sub>[http://gd.tuwien.ac.at/opsys/linux/archlinux/ http]</sub><br />
<br />
=== Belgium ===<br />
*ftp://ftp.belnet.be/mirror/archlinux.org/ <sub>[http://ftp.belnet.be/mirror/archlinux.org/ http]</sub><br />
*ftp://archlinux.mirror.kangaroot.net/pub/archlinux/ <sub>[http://archlinux.mirror.kangaroot.net/ http]</sub> <sub>[rsync://archlinux.mirror.kangaroot.net::archlinux]</sub><br />
=== Brazil ===<br />
*ftp://archlinux.c3sl.ufpr.br/archlinux/ <sub>[http://archlinux.c3sl.ufpr.br/ http]</sub> <sub>[rsync://archlinux.c3sl.ufpr.br/archlinux rsync]</sub><br />
*ftp://ftp.las.ic.unicamp.br/pub/archlinux <sub>[http://www.las.ic.unicamp.br/pub/archlinux http]</sub> <sub>[rsync://rsync.las.ic.unicamp.br/pub/archlinux rsync]</sub><br />
*http://pet.inf.ufsc.br/mirrors/archlinux/<br />
<br />
=== Canada ===<br />
*http://mirror.twilightlair.net/arch/ <sub>[rsync://mirror.twilightlair.net/arch/ rsync]</sub><br />
*ftp://mirror.csclub.uwaterloo.ca/archlinux/ <sub>[http://mirror.csclub.uwaterloo.ca/archlinux/ http]</sub> <sub>[rsync://mirror.csclub.uwaterloo.ca/archlinux/ rsync]</sub><br />
*ftp://mirrors.portafixe.com/archlinux/ <sub>[http://mirrors.portafixe.com/archlinux/ http]</sub><br />
<br />
=== Czech Republic ===<br />
*ftp://ftp.sh.cvut.cz/MIRRORS/arch/ <sub>[http://ftp.sh.cvut.cz/MIRRORS/arch/ http]</sub><br />
<br />
=== Denmark ===<br />
*ftp://ftp.klid.dk/archlinux/<br />
<br />
=== Estonia ===<br />
*ftp://ftp.estpak.ee/pub/archlinux/ <sub>[http://ftp.estpak.ee/pub/archlinux/ http]</sub><br />
<br />
=== France ===<br />
*ftp://mir1.archlinuxfr.org/archlinux <sub>[http://mir1.archlinuxfr.org/archlinux http]</sub> <sub>[rsync://mir1.archlinuxfr.org/archlinux rsync]</sub><br />
*ftp://mir2.archlinuxfr.org/archlinux <sub>[http://mir2.archlinuxfr.org/archlinux http]</sub> <sub>[rsync://mir2.archlinuxfr.org/archlinux rsync]</sub><br />
*ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ <sub>[http://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ http]</sub> <sub>[rsync://distrib-coffee.ipsl.jussieu.fr/pub/linux/archlinux/ rsync]</sub><br />
*http://mir.archlinux.fr/<br />
*ftp://ftp.free.fr/mirrors/ftp.archlinux.org/<br />
*ftp://ftp.rez-gif.supelec.fr/Linux/archlinux/<br />
<br />
=== Germany ===<br />
*ftp://ftp.hosteurope.de/mirror/ftp.archlinux.org/ <sub>[http://ftp.hosteurope.de/mirror/ftp.archlinux.org/ http]</sub><br />
*ftp://ftp5.gwdg.de/pub/linux/archlinux/ <sub>[http://ftp5.gwdg.de/pub/linux/archlinux/ http]</sub> <sub>[rsync://ftp5.gwdg.de/pub/linux/archlinux/ rsync]</sub><br />
*ftp://ftp.uni-bayreuth.de/pub/linux/archlinux <sub>[http://ftp.uni-bayreuth.de/linux/archlinux http]</sub> <sub>[rsync://rsync.uni-bayreuth.de/archlinux/ rsync]</sub><br />
*ftp://ftp.archlinuxppc.org/i686/<br />
*ftp://ftp.tu-chemnitz.de/pub/linux/archlinux/ <sub>[http://ftp.tu-chemnitz.de/pub/linux/archlinux/ http]</sub><br />
*ftp://ftp.uni-kl.de/pub/linux/archlinux/ <sub>[http://ftp.uni-kl.de/pub/linux/archlinux/ http]</sub> <sub>[rsync: ftp.uni-kl.de::pub/linux/archlinux/ rsync]</sub><br />
*http://mirrors.igprolin-online.org/pub/archlinux<br />
*ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/ <sub>[http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/ http]</sub> <sub>[rsync://ftp-stud.hs-esslingen.de/archlinux/ rsync]</sub><br />
<br />
*ftp://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/<br />
*http://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/<br />
<br />
=== Great Britain ===<br />
*http://www.mirrorservice.org/sites/ftp.archlinux.org/<br />
*ftp://mirrors.uk2.net/pub/archlinux/ <sub>[http://archlinux.mirrors.uk2.net/ http]</sub><br />
*http://mirror.lividpenguin.com/pub/archlinux/ <sub>[ftp://mirror.lividpenguin.com/pub/archlinux/ ftp]</sub><br />
<br />
=== Greece ===<br />
*ftp://ftp.ntua.gr/pub/linux/archlinux/ <sub>[http://ftp.ntua.gr/pub/linux/archlinux/ http]</sub><br />
<br />
=== Hungary ===<br />
*ftp://ftp.mfa.kfki.hu/pub/mirrors/ftp.archlinux.org/<br />
<br />
=== Ireland ===<br />
*ftp://ftp.heanet.ie/mirrors/ftp.archlinux.org/ <sub>[http://ftp.heanet.ie/mirrors/ftp.archlinux.org/ http]</sub><br />
<br />
=== Indonesia ===<br />
*ftp://archlinux.cbn.net.id/pub/archlinux/ <sub>[http://archlinux.cbn.net.id/ http]</sub><br />
<br />
=== Israel ===<br />
*http://mirror.isoc.org.il/pub/archlinux/<br />
<br />
=== Italy ===<br />
*ftp://mi.mirror.garr.it/mirrors/archlinux/ <sub>[http://mi.mirror.garr.it/mirrors/archlinux/ http]</sub><br />
<br />
=== Japan ===<br />
*http://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/ <sub>[ftp://ftp.yz.yamagata-u.ac.jp/pub/linux/archlinux/ ftp]</sub><br />
<br />
=== Latvia ===<br />
* http://archlinux.goodsoft.lv/<br />
<br />
=== Lithuania ===<br />
*ftp://atviras.lt/archmirror/ <sub>[http://atviras.lt/archmirror/ http]</sub><br />
<br />
=== Netherlands ===<br />
*ftp://ftp.nluug.nl/pub/metalab/distributions/archlinux/ <sub>[http://ftp.nluug.nl/pub/metalab/distributions/archlinux/ http]</sub><br />
*ftp://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/ <sub>[http://ftp.surfnet.nl/pub/os/Linux/distr/archlinux/ http]</sub><br />
<br />
=== Norway ===<br />
*http://mirror.archlinux.no/ <sub>[ftp://mirror.archlinux.no/ ftp]</sub>(rsync available)<br />
<br />
=== Poland ===<br />
*ftp://mirror.icis.pcz.pl/archlinux/<br />
*ftp://ftp.piotrkosoft.net/pub/mirrors/ftp.archlinux.org/ [http://piotrkosoft.net/pub/mirrors/ftp.archlinux.org/ http]<br />
*http://unix.net.pl/archlinux.org/<br />
<br />
=== Portugal ===<br />
*ftp://cesium.di.uminho.pt/pub/archlinux/ <sub>[http://cesium.di.uminho.pt/pub/archlinux/ http]</sub><br />
*ftp://darkstar.ist.utl.pt/pub/archlinux/ <sub>[http://darkstar.ist.utl.pt/archlinux/ http]</sub><br />
*ftp://ftp.nux.ipb.pt/pub/dists/archlinux/ <sub>[http://ftp.nux.ipb.pt/pub/dists/archlinux/ http]</sub><br />
<br />
=== Romania ===<br />
*ftp://ftp.iasi.roedu.net/mirrors/archlinux.org/ <sub>[http://ftp.iasi.roedu.net/mirrors/archlinux.org/ http]</sub><br />
*http://mirror.archlinux.ro/archlinux <sub>[http://mirror.archlinux.ro/archlinux http] </sub><br />
<br />
=== Russia ===<br />
*ftp://mirror.yandex.ru/archlinux/ <sub>[http://mirror.yandex.ru/archlinux/ http]</sub> (rsync available)<br />
*http://archlinux.freeside.ru/ - outdated (last updated at 26 March 2009)<br />
<br />
=== Sweden ===<br />
*ftp://ftp.ds.hj.se/pub/os/linux/archlinux/ <sub>[http://ftp.ds.hj.se/pub/os/linux/archlinux/ http]</sub><br />
*ftp://ftp.gigabit.nu/ <sub>[http://ftp.gigabit.nu/ http]</sub><br />
<br />
=== Switzerland ===<br />
*ftp://archlinux.puzzle.ch/ <sub>[http://archlinux.puzzle.ch/ http]</sub><br />
<br />
=== Taiwan ===<br />
* ftp://cle.linux.org.tw/pub/ArchLinux/ (no ''testing'', no new isos)<br />
<br />
=== Turkey ===<br />
*ftp://ftp.linux.org.tr/archlinux/ <sub>[http://ftp.linux.org.tr/archlinux/ http]</sub><br />
*http://server.elsistech.com/archlinux/<br />
<br />
=== Ukraine ===<br />
*ftp://archlinux.hell.org.ua/archlinux/ <sub>[http://archlinux.hell.org.ua/archlinux http]</sub>(rsync available)<br />
*ftp://ftp.linux.kiev.ua/pub/Linux/ArchLinux/ <sub>[http://ftp.linux.kiev.ua/pub/Linux/ArchLinux/ http]</sub><br />
<br />
=== United States ===<br />
*ftp://ftp.archlinux.org/<br />
*ftp://locke.suu.edu/linux/dist/archlinux/<br />
*http://archlinux.unixheads.org/<br />
*ftp://ftp.gtlib.gatech.edu/pub/linux/distributions/archlinux/ [http://www.gtlib.gatech.edu/pub/linux/distributions/archlinux/ http]<br />
*ftp://mirror.cs.vt.edu/pub/ArchLinux/ <sub>[http://mirror.cs.vt.edu/pub/ArchLinux/ http]</sub> (rsync available)<br />
*ftp://mirrors.easynews.com/linux/archlinux/ <sub>[http://mirrors.easynews.com/linux/archlinux/ http]</sub><br />
*ftp://ibiblio.org/pub/linux/distributions/archlinux/ <sub>[http://distro.ibiblio.org/pub/linux/distributions/archlinux/ http]</sub><br />
*http://archlinux.umflint.edu/<br />
*http://mirror.neotuli.net/<br />
*ftp://mirror.rit.edu/archlinux/ <sub>[http://mirror.rit.edu/archlinux/ http]</sub> <sub>[rsync://mirror.rit.edu/archlinux/ rsync]</sub><br />
* http://schlunix.org/archlinux/<br />
* http://mirror.umoss.org/archlinux/ <sub>[rsync://mirror.umoss.org/archlinux/ rsync]</sub><br />
* http://mirror.archlinux.com.ve/<br />
* http://mirrors.gigenet.com/archlinux/<br />
<br />
=== Venezuela ===<br />
* http://mirror2.archlinux.com.ve/<br />
<br />
=== Vietnam ===<br />
*ftp://ftp.indochinalinux.com/archlinux/ (frequent DNS problems, IP is 202.78.230.5)<br />
<br />
== Unofficial mirrors ==<br />
'''These mirrors are not listed in {{Filename|/etc/pacman.d/mirrorlist}}.'''<br />
<br />
=== Global ===<br />
* http://prdownloads.sourceforge.net/archlinux/ ( Doesn't have recent ISO releases. Use it only if for some reason you want to use an older ISO. )<br />
<br />
=== Australia ===<br />
*http://mirror.optus.com.au/pub/archlinux/ <sub>[http://mirror.optus.com.au/pub/archlinux/ http]</sub> <sub>[rsync://mirror.optus.com.au/pub/archlinux/]</sub><br />
<br />
=== Bulgaria ===<br />
* http://archlinux.igor.onlinedirect.bg/ <sub>[http://archlinux.igor.onlinedirect.bg http]</sub><br />
* ftp://archlinux.igor.onlinedirect.bg/linux/archlinux/ <sub>[http://archlinux.igor.onlinedirect.bg http]</sub><br />
<br />
=== China ===<br />
* http://mirrors.lcuc.org.cn/archlinux/<br />
* http://mirror.lupaworld.com/archlinux/<br />
* http://public.gooth.cn/archlinux/ (only include i686)<br />
* http://mirrors.163.com/archlinux/<br />
* http://mirror.bjtu.edu.cn/archlinux/<br />
* http://mirrors.sohu.com/archlinux/<br />
<br />
=== Germany ===<br />
* http://arch.uplinkzero.com/<br />
* ftp://ftp.uni-erlangen.de/mirrors/archlinux/ <sub>[http://ftp.uni-erlangen.de/mirrors/archlinux/ http]</sub><br />
<br />
=== Great Britain ===<br />
* ftp://mirror.lividpenguin.com/pub/archlinux/ <sub>[http://mirror.lividpenguin.com/pub/archlinux/ http]</sub><br />
<br />
=== Lithuania ===<br />
* ftp://atviras.lt/archmirror/ <sub>[http://atviras.lt/archmirror/ http]</sub><br />
<br />
=== Malaysia ===<br />
* http://oss.mmu.edu.my/pub/distro/arch (ISOs only)<br />
* http://mirror.oscc.org.my/archlinux/<br />
<br />
=== New Caledonia ===<br />
* ftp://archlinux.nautile.nc/archlinux/ <sub>[http://archlinux.nautile.nc/archlinux/ http]</sub> <sub>[rsync://archlinux.nautile.nc/archlinux/ rsync]</sub> (no ISO image)<br />
<br />
=== New Zealand ===<br />
* http://mirror.ihug.co.nz/archlinux/<br />
<br />
=== Norway ===<br />
* http://power.klette.us/mirror/<br />
<br />
=== Poland ===<br />
* ftp://ftp.icm.edu.pl/pub/Linux/sunsite/distributions/archlinux/ [http://ftp.icm.edu.pl/pub/Linux/sunsite/distributions/archlinux/ http] - up-to-date, but no Core repository<br />
<br />
=== South Africa ===<br />
<br />
* http://archlinux.mirror.ac.za/ TENET Mirror<br />
* ftp://archlinux.mirror.ac.za/<br />
* http://ftp.sun.ac.za/ftp/pub/mirrors/archlinux/ Stellenbosch University<br />
* ftp://ftp.sun.ac.za/pub/mirrors/archlinux/<br />
* http://ftp.leg.uct.ac.za/pub/linux/arch/ University of Cape Town<br />
* ftp://ftp.leg.uct.ac.za/pub/linux/arch/<br />
<br />
=== Spain ===<br />
*ftp://ftp.udc.es/mirror/archlinux/ <sub>[http://ftp.udc.es/mirror/archlinux/ http]</sub> <sub>[rsync://ftp.udc.es/mirror/archlinux/ rsync]</sub><br />
<br />
=== United States ===<br />
* http://archlinux.linuxfreedom.com Contains all the ISO images<br />
* ftp://mirrors.acm.jhu.edu/arch/ <sub>[http://mirrors.acm.jhu.edu/arch http]</sub> <sub>[rsync://mirrors.acm.jhu.edu/arch rsync]</sub><br />
* ftp://ftp.osuosl.org/pub/archlinux/ <sub>[http://ftp.osuosl.org/pub/archlinux/ http]</sub> (i686 only - ''current'' and ''extra'') - outdated<br />
<br />
== IPv6-ready mirrors ==<br />
*http://power.klette.us/mirror/ (Norway)<br />
*http://arch.iskrembilen.com/ (Norway, rsync available)<br />
*niue.belnet.be (Belgium)<br />
*ftp.estpak.ee (Estonia)<br />
*patroklos.noc.ntua.gr (Greece)<br />
*ftp.heanet.ie (Ireland)<br />
*ftp.nluug.nl (Netherlands)<br />
*ftp.surfnet.nl (Netherlands)<br />
*ftp.sixnix.net/ftp6.sixnix.net (Finland) - dead</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87520Polipo2009-12-12T20:03:12Z<p>Time: /* Improving Polipo */ fix tmp</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using an [[AUR helper]] like [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
or install the newer development version instead:<br />
$ yaourt -S polipo-git<br />
<br />
==Improving Polipo==<br />
{{note|the git version already has these improvements, except for the designated Polipo user modification.}}<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
if ! ck_daemon $DAEMON; then<br />
$0 stop<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
$0 start<br />
else<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
</nowiki><br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87519Polipo2009-12-12T20:02:55Z<p>Time: /* Improving Polipo */ note about git ver</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using an [[AUR helper]] like [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
or install the newer development version instead:<br />
$ yaourt -S polipo-git<br />
<br />
==Improving Polipo==<br />
{{note: the git version already has these improvements, except for the designated Polipo user modification.}}<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
if ! ck_daemon $DAEMON; then<br />
$0 stop<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
$0 start<br />
else<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
</nowiki><br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87493Polipo2009-12-12T12:31:38Z<p>Time: /* Installation */ link to git version</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using an [[AUR helper]] like [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
or install the newer development version instead:<br />
$ yaourt -S polipo-git<br />
<br />
==Improving Polipo==<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
if ! ck_daemon $DAEMON; then<br />
$0 stop<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
$0 start<br />
else<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
</nowiki><br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=AUR_helper&diff=87492AUR helper2009-12-12T12:30:39Z<p>Time: fix redir</p>
<hr />
<div>#REDIRECT[[AUR Helpers]]</div>Timehttps://wiki.archlinux.org/index.php?title=AUR_helper&diff=87491AUR helper2009-12-12T12:30:17Z<p>Time: commonly used in phrasing</p>
<hr />
<div>#[[REDIRECT|AUR Helpers]]</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87490Polipo2009-12-12T12:24:59Z<p>Time: fix code</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
Other [[AUR Helpers]] besides yaourt might be preferred.<br />
<br />
==Improving Polipo==<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
<nowiki><br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
if ! ck_daemon $DAEMON; then<br />
$0 stop<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
$0 start<br />
else<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
</nowiki><br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87489Polipo2009-12-12T12:24:14Z<p>Time: update daemon script</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
Other [[AUR Helpers]] besides yaourt might be preferred.<br />
<br />
==Improving Polipo==<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper [[daemon]] behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, replace the daemon script with the following:<br />
{{file|name=/etc/rc.d/polipo|content=<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
DAEMON=polipo<br />
ARGS="daemonise=true pidFile=/var/run/$DAEMON/$DAEMON.pid"<br />
PID=$(pidof -o %PPID /usr/bin/$DAEMON)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting $DAEMON"<br />
if ck_daemon $DAEMON; then<br />
[[ ! -d /var/run/$DAEMON ]] && install -d $DAEMON /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
add_daemon polipo<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping $DAEMON"<br />
if ! ck_daemon $DAEMON; then<br />
kill $PID >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
rm_daemon $DAEMON<br />
stat_done<br />
fi<br />
else<br />
stat_fail<br />
fi<br />
;;<br />
purge)<br />
if ! ck_daemon $DAEMON; then<br />
$0 stop<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
$0 start<br />
else<br />
stat_busy "Purging $DAEMON"<br />
[[ ! -d /var/run/$DAEMON ]] && install -d /var/run/$DAEMON<br />
polipo /usr/bin/$DAEMON -x $ARGS >/dev/null 2>&1<br />
if [[ $? -ne 0 ]]; then<br />
stat_fail<br />
else<br />
stat_done<br />
fi<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
}}<br />
<br />
And save the cron file in {{filename|/etc/cron.weekly/polipo}}:<br />
#!/bin/sh<br />
/etc/rc.d/polipo purge >/dev/null 2>&1<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Talk:System_backup&diff=87488Talk:System backup2009-12-12T12:14:35Z<p>Time: /* Suggestions */ sign</p>
<hr />
<div>== Suggestions ==<br />
<br />
Page title does not use [[ArchWiki_Tutorial_(English)#Adding_a_new_page|naming guidelines]]. Also, a forward slash between two words defines an either/or option (e.g. Backup for full/partial configurations) which I don't think is meant to be the case here.<br />
--[[User:Gen2ly|Gen2ly]] 06:16, 12 December 2009 (EST)<br />
<br />
:The slash was supposed to be a subpage. It looks like that's disabled in this wiki for article namespace (as it is in Wikipedia) so I'll just change it. [[User:Time|Time]] 07:05, 12 December 2009 (EST)<br />
<br />
:''Full System Backup with rsync''? If not, go ahead and change it. [[User:Time|Time]] 07:14, 12 December 2009 (EST)<br />
<br />
== Comments ==<br />
<br />
Thanks! Neat method for a sync-type backup! The only question I have is what happens if you {{Codeline|dd}} the boot sector (first 512 bytes) instead of running GRUB? --[[User:VitaminJ|VitaminJ]] 22:18, 11 November 2009 (EST)<br />
<br />
---- <br />
<br />
I don't know if it works with <code>dd</code>, since the partitioning scheme can be different on the two harddrives.<br />
<br />
* I vote for merging this with [[rsync]].<br />
* I second the vote.<br />
<br />
[[User:Wooptoo|Wooptoo]] 07:14, 2 December 2009 (EST)<br />
--[[User:Keiichi|Keiichi]] 20:59, 2 December 2009 (EST)<br />
----</div>Timehttps://wiki.archlinux.org/index.php?title=Talk:System_backup&diff=87487Talk:System backup2009-12-12T12:13:53Z<p>Time: /* Suggestions */ what should the title be</p>
<hr />
<div>== Suggestions ==<br />
<br />
Page title does not use [[ArchWiki_Tutorial_(English)#Adding_a_new_page|naming guidelines]]. Also, a forward slash between two words defines an either/or option (e.g. Backup for full/partial configurations) which I don't think is meant to be the case here.<br />
--[[User:Gen2ly|Gen2ly]] 06:16, 12 December 2009 (EST)<br />
<br />
:The slash was supposed to be a subpage. It looks like that's disabled in this wiki for article namespace (as it is in Wikipedia) so I'll just change it. [[User:Time|Time]] 07:05, 12 December 2009 (EST)<br />
<br />
:''Full System Backup with rsync''? If not, go ahead and change it.<br />
<br />
== Comments ==<br />
<br />
Thanks! Neat method for a sync-type backup! The only question I have is what happens if you {{Codeline|dd}} the boot sector (first 512 bytes) instead of running GRUB? --[[User:VitaminJ|VitaminJ]] 22:18, 11 November 2009 (EST)<br />
<br />
---- <br />
<br />
I don't know if it works with <code>dd</code>, since the partitioning scheme can be different on the two harddrives.<br />
<br />
* I vote for merging this with [[rsync]].<br />
* I second the vote.<br />
<br />
[[User:Wooptoo|Wooptoo]] 07:14, 2 December 2009 (EST)<br />
--[[User:Keiichi|Keiichi]] 20:59, 2 December 2009 (EST)<br />
----</div>Timehttps://wiki.archlinux.org/index.php?title=Talk:System_backup&diff=87486Talk:System backup2009-12-12T12:05:48Z<p>Time: /* Suggestions */ no subpages</p>
<hr />
<div>== Suggestions ==<br />
<br />
Page title does not use [[ArchWiki_Tutorial_(English)#Adding_a_new_page|naming guidelines]]. Also, a forward slash between two words defines an either/or option (e.g. Backup for full/partial configurations) which I don't think is meant to be the case here.<br />
--[[User:Gen2ly|Gen2ly]] 06:16, 12 December 2009 (EST)<br />
<br />
:The slash was supposed to be a subpage. It looks like that's disabled in this wiki for article namespace (as it is in Wikipedia) so I'll just change it. [[User:Time|Time]] 07:05, 12 December 2009 (EST)<br />
<br />
== Comments ==<br />
<br />
Thanks! Neat method for a sync-type backup! The only question I have is what happens if you {{Codeline|dd}} the boot sector (first 512 bytes) instead of running GRUB? --[[User:VitaminJ|VitaminJ]] 22:18, 11 November 2009 (EST)<br />
<br />
---- <br />
<br />
I don't know if it works with <code>dd</code>, since the partitioning scheme can be different on the two harddrives.<br />
<br />
* I vote for merging this with [[rsync]].<br />
* I second the vote.<br />
<br />
[[User:Wooptoo|Wooptoo]] 07:14, 2 December 2009 (EST)<br />
--[[User:Keiichi|Keiichi]] 20:59, 2 December 2009 (EST)<br />
----</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87466System backup2009-12-12T03:31:19Z<p>Time: /* Backup script */ repeated word</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs, followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
The script is very simple; it rsyncs in archive mode, ensuring that symbolic links, devices, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination, and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87465System backup2009-12-12T03:24:29Z<p>Time: runon sentence</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs, followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
The script is very simple; it rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination, and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=Rsync&diff=87464Rsync2009-12-12T03:21:23Z<p>Time: update link</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:System recovery (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[http://samba.anu.edu.au/rsync/ rsync] is an open source utility that provides fast incremental file transfer.<br />
<br />
==Installation==<br />
Install the {{package Official|rsync}} package using [[pacman]]:<br />
# pacman -S rsync<br />
<br />
==Usage==<br />
For more examples, search the [http://bbs.archlinux.org/viewforum.php?id=27 Community Contributions] and [http://bbs.archlinux.org/viewforum.php?id=33 General Programming] forums.<br />
<br />
===As a cp alternative===<br />
rsync can readily be used as an advanced cp alternative, specially useful for copying larger files:<br />
$ rsync -P src dest<br />
<br />
The {{Codeline|-P}} option is the same as {{Codeline|--partial --progress}}, which keeps partially transferred files and shows a progress bar during transfer.<br />
<br />
===As a backup utility===<br />
The rsync protocol can easily be used for backups, only transferring files that have changed since the last backup. This section describes a very simple scheduled backup script using rsync, typically used for copying to removable media. For a more thorough example, see [[rsync/Full system backup]].<br />
<br />
====Automated backup====<br />
For the sake of this example, the script is created in the {{Filename|/etc/cron.daily}} directory, and will be run on a daily basis if a cron [[daemon]] is installed and properly configured. Configuring and using [[cron]] is outside the scope of this article.<br />
<br />
First, create a script containing the appropriate command options:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a --delete /folder/to/backup /location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-a}} : indicates that files should be archived, meaning that all of their attributes are preserved<br />
; {{Codeline|--delete}} : means files deleted on the source are to be deleted on the backup aswell<br />
<br />
Here, {{Filename|/folder/to/backup}} should to be changed to what needs to be backed-up ({{Filename|/home}}, for example) and {{Filename|/location/to/backup}} is where the backup should be saved ({{Filename|/media/disk}}, for instance).<br />
<br />
Finally, the script must be executable:<br />
# chmod +x /etc/cron.daily/rsync.backup<br />
<br />
====Automated backup with SSH====<br />
If backing-up to a remote host using [[SSH]], use this script instead:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a -r --delete -e ssh /folder/to/backup remoteuser@remotehost:/location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-e ssh}} : tells rsync to use SSH<br />
; {{Codeline|remoteuser}} : is the user on the host {{Codeline|remotehost}}</div>Timehttps://wiki.archlinux.org/index.php?title=Talk:System_backup&diff=87462Talk:System backup2009-12-12T03:20:35Z<p>Time: moved Talk:Full system backup with rsync to Talk:Rsync/Full system backup:&#32;organization</p>
<hr />
<div>Thanks! Neat method for a sync-type backup! The only question I have is what happens if you {{Codeline|dd}} the boot sector (first 512 bytes) instead of running GRUB? --[[User:VitaminJ|VitaminJ]] 22:18, 11 November 2009 (EST)<br />
<br />
---- <br />
<br />
I don't know if it works with <code>dd</code>, since the partitioning scheme can be different on the two harddrives.<br />
<br />
* I vote for merging this with [[rsync]].<br />
* I second the vote.<br />
<br />
[[User:Wooptoo|Wooptoo]] 07:14, 2 December 2009 (EST)<br />
--[[User:Keiichi|Keiichi]] 20:59, 2 December 2009 (EST)<br />
----</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87460System backup2009-12-12T03:20:35Z<p>Time: moved Full system backup with rsync to Rsync/Full system backup:&#32;organization</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
The script is very simple; it rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination, and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87456Polipo2009-12-12T02:47:59Z<p>Time: gr: ';' before however</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind; however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
Other [[AUR Helpers]] besides yaourt might be preferred.<br />
<br />
==Improving Polipo==<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper daemon behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, first patch {{filename|/etc/rc.d/polipo}}:<br />
<pre><br />
--- polipo.orig/polipo 2008-01-08 14:16:06.000000000 -0430<br />
+++ polipo/polipo 2009-12-08 22:03:11.081727858 -0430<br />
@@ -3,19 +3,35 @@<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
+PID=$(pidof -o %PPID /usr/bin/polipo)<br />
+POLIPO_ARGS="daemonise=true pidFile=/var/run/polipo.pid"<br />
+<br />
case "$1" in<br />
start)<br />
stat_busy "Starting polipo"<br />
- polipo daemonise=true<br />
+ /usr/bin/polipo $POLIPO_ARGS<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
+ add_daemon polipo<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping polipo"<br />
- kill `pidof /usr/bin/polipo`<br />
+ kill $PID<br />
+ if [ $? -gt 0 ]; then<br />
+ stat_fail<br />
+ else<br />
+ rm_daemon polipo<br />
+ stat_done<br />
+ fi<br />
+ ;;<br />
+ purge)<br />
+ stat_busy "Purging polipo"<br />
+ kill -USR1 $PID<br />
+ sleep 1<br />
+ /usr/bin/polipo -x $POLIPO_ARGS<br />
+ kill -USR2 $PID<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
@@ -28,6 +44,7 @@<br />
$0 start<br />
;;<br />
*)<br />
- echo "usage: $0 {start|stop|restart}"<br />
+ echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
+exit 0<br />
</pre><br />
<br />
And create {{filename|/etc/cron.weekly/polipo}} with the following:<br />
#!/bin/sh <br />
set -e<br />
/etc/rc.d/polipo purge<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Disk_quota&diff=87455Disk quota2009-12-12T02:44:47Z<p>Time: /* Configuring */ sp</p>
<hr />
<div>[[Category: Security (English)]]<br />
[[Category: File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
From [[Wikipedia:Disk quota|Wikipedia]]:<br />
:"''A '''disk quota''' is a limit set by a system administrator that restricts certain aspects of file system usage on modern operating systems. The function of setting quotas to disks is to allocate limited disk-space in a reasonable way.''"<br />
This article covers the installation and setup of disk quota.<br />
<br />
==Installing==<br />
Disk quota only requires one package:<br />
# pacman -S quota-tools<br />
<br />
==Enabling==<br />
''For journaled quota, see the notes in [[#Journaled quota]].''<br />
<br />
1. First, edit {{filename|/etc/fstab}} to enable the quota mount option(s) on selected file systems:<br />
/dev/sda1 /home ext4 defaults 1 1<br />
:edit it as follows;<br />
/dev/sda1 /home ext4 defaults''',usrquota''' 1 1<br />
:or aditionally enable the group quota mount option;<br />
/dev/sda1 /home ext4 defaults''',usrquota,grpquota''' 1 1<br />
<br />
2. Create the quota files in the file system:<br />
# touch /home/aquota.user<br />
# touch /home/aquota.group # For group quota<br />
<br />
2. The next step is to remount:<br />
# mount -vo remount /home<br />
<br />
4. Create the quota index:<br />
# quotacheck -vgum /home<br />
:or for all partitions with the quota mount options in {{filename|/etc/mtab}};<br />
# quotacheck -vguma<br />
<br />
5. Finally, enable quotas:<br />
# quotaon -av<br />
<br />
{{tip|to automatically enable quota on boot, add {{codeline|quotaon -a >/dev/null 2>&1}} to {{filename|/etc/rc.local}}.}}<br />
<br />
===Journaled quota===<br />
Enabling journaling for disk quota adds the same benefits journaled file systems do for forced shutdowns, meaning that data is less likely to become corrupt.<br />
<br />
Setting up journaled quota is the same as above, except for the mount options:<br />
/dev/sda1 /home ext4 defaults''',usrjquota=aquota.user,jqfmt=vfsv0''' 1 1<br />
or aditionally enable the group quota mount option;<br />
/dev/sda1 /home ext4 defaults''',usrjquota=aquota.user,grpjquota=aquota.grp,jqfmt=vfsv0''' 1 1<br />
<br />
==Configuring==<br />
Replace {{Codeline|$USER}} as appropriate and edit the quota as root:<br />
{{Command|name=edquota ''$USER''|output=<br />
Disk quotas for user '''$USER''' (uid 1000):<br />
Filesystem blocks soft hard inodes soft hard<br />
/dev/sda1 1944 0 0 120 0 0<br />
}}<br />
;blocks: 1k blocks<br />
;inodes: Number of entries in directory file<br />
;soft: Max number of blocks/inodes user may have on partition before warning is issued and grace period countdown begins. If set to "0" (zero) then no limit is enforced.<br />
;hard: Max number of blocks/inodes user may have on partition. If set to "0" (zero) then no limit is enforced.<br />
{{note|to edit group quotas, use {{codeline|edquota -g $GROUP}}.}}<br />
<br />
===Example setup===<br />
Editing the limits as below, for example:<br />
Disk quotas for user testuser (uid 1000):<br />
Filesystem blocks soft hard inodes soft hard <br />
/dev/sda1 695879 10000 15000 6741 0 0<br />
sets the following restrictions: the {{codeline|soft}} limit means that once ''testuser'' uses over 10MB of space a warning email gets ensued, and after a period of time the soft limit gets enforced. The {{codeline|hard}} limit is stricter, so to speak; a user cannot go over this limit.<br />
<br />
To alter the {{codeline|soft}} limit grace period:<br />
# edquota -t<br />
<br />
==Managing==<br />
''Checking for quota limits and advanced operations''<br />
<br />
===Basics===<br />
Use this command to check for quotas on a specific partition:<br />
# repquota /home<br />
<br />
Use this command to check for all quotas that apply to a user:<br />
# quota -u $USER<br />
for groups;<br />
# quota -g $GROUP<br />
<br />
===Copying quota settings===<br />
The idea is to make a temporary user acount, modify the quota settings for that user, and then copy the generated quota files for all users to use. After setting quota settings for ''quotauser'', copy the settings:<br />
# edquota -p '''quotauser''' `awk -F: '$3 > 999 {print $1}' /etc/passwd`<br />
This applies the settings to users with a UID equal to or greater than 1000.<br />
<br />
===Other commands===<br />
There are several useful commands:<br />
repquota -a # Shows the status on diskusage<br />
warnquota # Can be used to warn the users about their quota<br />
setquota # Non-interactive quota setting--useful for scripting<br />
<br />
Lasty, {{codeline|quotastats}} is used to give thorough information about the quota system:<br />
{{Command|name=quotastats|output=<br />
Number of dquot lookups: 101289<br />
Number of dquot drops: 101271<br />
Number of still active inodes with quota : 18<br />
Number of dquot reads: 93<br />
Number of dquot writes: 2077<br />
Number of quotafile syncs: 134518740<br />
Number of dquot cache hits: 7391<br />
Number of allocated dquots: 90<br />
Number of free dquots: 2036<br />
Number of in use dquot entries (user/group): -1946<br />
}}<br />
<br />
==More resources==<br />
* http://tldp.org/HOWTO/Quota.html<br />
* http://www.sf.net/projects/linuxquota/<br />
* http://www.yolinux.com/TUTORIALS/LinuxTutorialQuotas.html<br />
* http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/admin-primer/s1-storage-quotas.html</div>Timehttps://wiki.archlinux.org/index.php?title=Disk_quota&diff=87454Disk quota2009-12-12T02:44:02Z<p>Time: /* Enabling */ rc.local now has >/dev/null</p>
<hr />
<div>[[Category: Security (English)]]<br />
[[Category: File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
From [[Wikipedia:Disk quota|Wikipedia]]:<br />
:"''A '''disk quota''' is a limit set by a system administrator that restricts certain aspects of file system usage on modern operating systems. The function of setting quotas to disks is to allocate limited disk-space in a reasonable way.''"<br />
This article covers the installation and setup of disk quota.<br />
<br />
==Installing==<br />
Disk quota only requires one package:<br />
# pacman -S quota-tools<br />
<br />
==Enabling==<br />
''For journaled quota, see the notes in [[#Journaled quota]].''<br />
<br />
1. First, edit {{filename|/etc/fstab}} to enable the quota mount option(s) on selected file systems:<br />
/dev/sda1 /home ext4 defaults 1 1<br />
:edit it as follows;<br />
/dev/sda1 /home ext4 defaults''',usrquota''' 1 1<br />
:or aditionally enable the group quota mount option;<br />
/dev/sda1 /home ext4 defaults''',usrquota,grpquota''' 1 1<br />
<br />
2. Create the quota files in the file system:<br />
# touch /home/aquota.user<br />
# touch /home/aquota.group # For group quota<br />
<br />
2. The next step is to remount:<br />
# mount -vo remount /home<br />
<br />
4. Create the quota index:<br />
# quotacheck -vgum /home<br />
:or for all partitions with the quota mount options in {{filename|/etc/mtab}};<br />
# quotacheck -vguma<br />
<br />
5. Finally, enable quotas:<br />
# quotaon -av<br />
<br />
{{tip|to automatically enable quota on boot, add {{codeline|quotaon -a >/dev/null 2>&1}} to {{filename|/etc/rc.local}}.}}<br />
<br />
===Journaled quota===<br />
Enabling journaling for disk quota adds the same benefits journaled file systems do for forced shutdowns, meaning that data is less likely to become corrupt.<br />
<br />
Setting up journaled quota is the same as above, except for the mount options:<br />
/dev/sda1 /home ext4 defaults''',usrjquota=aquota.user,jqfmt=vfsv0''' 1 1<br />
or aditionally enable the group quota mount option;<br />
/dev/sda1 /home ext4 defaults''',usrjquota=aquota.user,grpjquota=aquota.grp,jqfmt=vfsv0''' 1 1<br />
<br />
==Configuring==<br />
Replace {{Codeline|$USER}} as appropiate, and edit the quota as root:<br />
{{Command|name=edquota ''$USER''|output=<br />
Disk quotas for user '''$USER''' (uid 1000):<br />
Filesystem blocks soft hard inodes soft hard<br />
/dev/sda1 1944 0 0 120 0 0<br />
}}<br />
;blocks: 1k blocks<br />
;inodes: Number of entries in directory file<br />
;soft: Max number of blocks/inodes user may have on partition before warning is issued and grace period countdown begins. If set to "0" (zero) then no limit is enforced.<br />
;hard: Max number of blocks/inodes user may have on partition. If set to "0" (zero) then no limit is enforced.<br />
{{note|to edit group quotas, use {{codeline|edquota -g $GROUP}}.}}<br />
<br />
===Example setup===<br />
Editing the limits as below, for example:<br />
Disk quotas for user testuser (uid 1000):<br />
Filesystem blocks soft hard inodes soft hard <br />
/dev/sda1 695879 10000 15000 6741 0 0<br />
sets the following restrictions: the {{codeline|soft}} limit means that once ''testuser'' uses over 10MB of space a warning email gets ensued, and after a period of time the soft limit gets enforced. The {{codeline|hard}} limit is stricter, so to speak; a user cannot go over this limit.<br />
<br />
To alter the {{codeline|soft}} limit grace period:<br />
# edquota -t<br />
<br />
==Managing==<br />
''Checking for quota limits and advanced operations''<br />
<br />
===Basics===<br />
Use this command to check for quotas on a specific partition:<br />
# repquota /home<br />
<br />
Use this command to check for all quotas that apply to a user:<br />
# quota -u $USER<br />
for groups;<br />
# quota -g $GROUP<br />
<br />
===Copying quota settings===<br />
The idea is to make a temporary user acount, modify the quota settings for that user, and then copy the generated quota files for all users to use. After setting quota settings for ''quotauser'', copy the settings:<br />
# edquota -p '''quotauser''' `awk -F: '$3 > 999 {print $1}' /etc/passwd`<br />
This applies the settings to users with a UID equal to or greater than 1000.<br />
<br />
===Other commands===<br />
There are several useful commands:<br />
repquota -a # Shows the status on diskusage<br />
warnquota # Can be used to warn the users about their quota<br />
setquota # Non-interactive quota setting--useful for scripting<br />
<br />
Lasty, {{codeline|quotastats}} is used to give thorough information about the quota system:<br />
{{Command|name=quotastats|output=<br />
Number of dquot lookups: 101289<br />
Number of dquot drops: 101271<br />
Number of still active inodes with quota : 18<br />
Number of dquot reads: 93<br />
Number of dquot writes: 2077<br />
Number of quotafile syncs: 134518740<br />
Number of dquot cache hits: 7391<br />
Number of allocated dquots: 90<br />
Number of free dquots: 2036<br />
Number of in use dquot entries (user/group): -1946<br />
}}<br />
<br />
==More resources==<br />
* http://tldp.org/HOWTO/Quota.html<br />
* http://www.sf.net/projects/linuxquota/<br />
* http://www.yolinux.com/TUTORIALS/LinuxTutorialQuotas.html<br />
* http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/admin-primer/s1-storage-quotas.html</div>Timehttps://wiki.archlinux.org/index.php?title=Disk_quota&diff=87453Disk quota2009-12-12T02:40:29Z<p>Time: /* Installing */ gr</p>
<hr />
<div>[[Category: Security (English)]]<br />
[[Category: File systems (English)]]<br />
[[Category:HOWTOs (English)]]<br />
From [[Wikipedia:Disk quota|Wikipedia]]:<br />
:"''A '''disk quota''' is a limit set by a system administrator that restricts certain aspects of file system usage on modern operating systems. The function of setting quotas to disks is to allocate limited disk-space in a reasonable way.''"<br />
This article covers the installation and setup of disk quota.<br />
<br />
==Installing==<br />
Disk quota only requires one package:<br />
# pacman -S quota-tools<br />
<br />
==Enabling==<br />
''For journaled quota, see the notes in [[#Journaled quota]].''<br />
<br />
1. First, edit {{filename|/etc/fstab}} to enable the quota mount option(s) on selected file systems:<br />
/dev/sda1 /home ext4 defaults 1 1<br />
:edit it as follows;<br />
/dev/sda1 /home ext4 defaults''',usrquota''' 1 1<br />
:or aditionally enable the group quota mount option;<br />
/dev/sda1 /home ext4 defaults''',usrquota,grpquota''' 1 1<br />
<br />
2. Create the quota files in the file system:<br />
# touch /home/aquota.user<br />
# touch /home/aquota.group # For group quota<br />
<br />
2. The next step is to remount:<br />
# mount -vo remount /home<br />
<br />
4. Create the quota index:<br />
# quotacheck -vgum /home<br />
:or for all partitions with the quota mount options in {{filename|/etc/mtab}};<br />
# quotacheck -vguma<br />
<br />
5. Finally, enable quotas:<br />
# quotaon -av<br />
<br />
{{tip|to automatically enable quota on boot, add the previous command to {{filename|/etc/rc.local}}.}}<br />
<br />
===Journaled quota===<br />
Enabling journaling for disk quota adds the same benefits journaled file systems do for forced shutdowns, meaning that data is less likely to become corrupt.<br />
<br />
Setting up journaled quota is the same as above, except for the mount options:<br />
/dev/sda1 /home ext4 defaults''',usrjquota=aquota.user,jqfmt=vfsv0''' 1 1<br />
or aditionally enable the group quota mount option;<br />
/dev/sda1 /home ext4 defaults''',usrjquota=aquota.user,grpjquota=aquota.grp,jqfmt=vfsv0''' 1 1<br />
<br />
==Configuring==<br />
Replace {{Codeline|$USER}} as appropiate, and edit the quota as root:<br />
{{Command|name=edquota ''$USER''|output=<br />
Disk quotas for user '''$USER''' (uid 1000):<br />
Filesystem blocks soft hard inodes soft hard<br />
/dev/sda1 1944 0 0 120 0 0<br />
}}<br />
;blocks: 1k blocks<br />
;inodes: Number of entries in directory file<br />
;soft: Max number of blocks/inodes user may have on partition before warning is issued and grace period countdown begins. If set to "0" (zero) then no limit is enforced.<br />
;hard: Max number of blocks/inodes user may have on partition. If set to "0" (zero) then no limit is enforced.<br />
{{note|to edit group quotas, use {{codeline|edquota -g $GROUP}}.}}<br />
<br />
===Example setup===<br />
Editing the limits as below, for example:<br />
Disk quotas for user testuser (uid 1000):<br />
Filesystem blocks soft hard inodes soft hard <br />
/dev/sda1 695879 10000 15000 6741 0 0<br />
sets the following restrictions: the {{codeline|soft}} limit means that once ''testuser'' uses over 10MB of space a warning email gets ensued, and after a period of time the soft limit gets enforced. The {{codeline|hard}} limit is stricter, so to speak; a user cannot go over this limit.<br />
<br />
To alter the {{codeline|soft}} limit grace period:<br />
# edquota -t<br />
<br />
==Managing==<br />
''Checking for quota limits and advanced operations''<br />
<br />
===Basics===<br />
Use this command to check for quotas on a specific partition:<br />
# repquota /home<br />
<br />
Use this command to check for all quotas that apply to a user:<br />
# quota -u $USER<br />
for groups;<br />
# quota -g $GROUP<br />
<br />
===Copying quota settings===<br />
The idea is to make a temporary user acount, modify the quota settings for that user, and then copy the generated quota files for all users to use. After setting quota settings for ''quotauser'', copy the settings:<br />
# edquota -p '''quotauser''' `awk -F: '$3 > 999 {print $1}' /etc/passwd`<br />
This applies the settings to users with a UID equal to or greater than 1000.<br />
<br />
===Other commands===<br />
There are several useful commands:<br />
repquota -a # Shows the status on diskusage<br />
warnquota # Can be used to warn the users about their quota<br />
setquota # Non-interactive quota setting--useful for scripting<br />
<br />
Lasty, {{codeline|quotastats}} is used to give thorough information about the quota system:<br />
{{Command|name=quotastats|output=<br />
Number of dquot lookups: 101289<br />
Number of dquot drops: 101271<br />
Number of still active inodes with quota : 18<br />
Number of dquot reads: 93<br />
Number of dquot writes: 2077<br />
Number of quotafile syncs: 134518740<br />
Number of dquot cache hits: 7391<br />
Number of allocated dquots: 90<br />
Number of free dquots: 2036<br />
Number of in use dquot entries (user/group): -1946<br />
}}<br />
<br />
==More resources==<br />
* http://tldp.org/HOWTO/Quota.html<br />
* http://www.sf.net/projects/linuxquota/<br />
* http://www.yolinux.com/TUTORIALS/LinuxTutorialQuotas.html<br />
* http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/admin-primer/s1-storage-quotas.html</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87452Polipo2009-12-12T02:39:18Z<p>Time: wording</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind, however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, since omitting these sanity checks drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
Other [[AUR Helpers]] besides yaourt might be preferred.<br />
<br />
==Improving Polipo==<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper daemon behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, first patch {{filename|/etc/rc.d/polipo}}:<br />
<pre><br />
--- polipo.orig/polipo 2008-01-08 14:16:06.000000000 -0430<br />
+++ polipo/polipo 2009-12-08 22:03:11.081727858 -0430<br />
@@ -3,19 +3,35 @@<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
+PID=$(pidof -o %PPID /usr/bin/polipo)<br />
+POLIPO_ARGS="daemonise=true pidFile=/var/run/polipo.pid"<br />
+<br />
case "$1" in<br />
start)<br />
stat_busy "Starting polipo"<br />
- polipo daemonise=true<br />
+ /usr/bin/polipo $POLIPO_ARGS<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
+ add_daemon polipo<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping polipo"<br />
- kill `pidof /usr/bin/polipo`<br />
+ kill $PID<br />
+ if [ $? -gt 0 ]; then<br />
+ stat_fail<br />
+ else<br />
+ rm_daemon polipo<br />
+ stat_done<br />
+ fi<br />
+ ;;<br />
+ purge)<br />
+ stat_busy "Purging polipo"<br />
+ kill -USR1 $PID<br />
+ sleep 1<br />
+ /usr/bin/polipo -x $POLIPO_ARGS<br />
+ kill -USR2 $PID<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
@@ -28,6 +44,7 @@<br />
$0 start<br />
;;<br />
*)<br />
- echo "usage: $0 {start|stop|restart}"<br />
+ echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
+exit 0<br />
</pre><br />
<br />
And create {{filename|/etc/cron.weekly/polipo}} with the following:<br />
#!/bin/sh <br />
set -e<br />
/etc/rc.d/polipo purge<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Polipo&diff=87451Polipo2009-12-12T02:37:47Z<p>Time: wording</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:Daemons and system services (English)]]<br />
{{expansion}}<br />
From [http://www.pps.jussieu.fr/~jch/software/polipo/ Polipo's site]:<br />
:"''Polipo is a small and fast caching web proxy (a web cache, an HTTP proxy, a proxy server). While Polipo was designed to be used by one person or a small group of people, there is nothing that prevents it from being used by a larger group.''"<br />
<br />
Unlike [[Squid]], Polipo is very light on resources and simple to configure. This makes it ideal for single user systems and other uncomplicated setups. Do keep in mind, however, that this versatility comes at a cost; Polipo will increase its space usage without restriction as it is not aware of how big its disk cache grows. This perceived fault is by design, as it drastically reduces Polipo's memory usage and overall toll on the system. A practical way of restricting disk usage is by making Polipo run as its own user and employing [[disk quota]].<br />
<br />
The following covers installing and setting up Polipo.<br />
<br />
==Installation==<br />
Polipo is currently available in the [[AUR]]. Using [[yaourt]], install by entering:<br />
$ yaourt -S polipo<br />
Other [[AUR Helpers]] besides yaourt might be preferred.<br />
<br />
==Improving Polipo==<br />
The current Polipo package is missing a set of features users might find desirable, namely: proper daemon behavior, including placing files in {{filename|/var/run}} and a call to cleanse Polipo's cache; a cronjob that routinely performs the latter; and finally, a restricted "polipo" user to address security and maintainability concerns.<br />
<br />
To partially fix these issues, first patch {{filename|/etc/rc.d/polipo}}:<br />
<pre><br />
--- polipo.orig/polipo 2008-01-08 14:16:06.000000000 -0430<br />
+++ polipo/polipo 2009-12-08 22:03:11.081727858 -0430<br />
@@ -3,19 +3,35 @@<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
+PID=$(pidof -o %PPID /usr/bin/polipo)<br />
+POLIPO_ARGS="daemonise=true pidFile=/var/run/polipo.pid"<br />
+<br />
case "$1" in<br />
start)<br />
stat_busy "Starting polipo"<br />
- polipo daemonise=true<br />
+ /usr/bin/polipo $POLIPO_ARGS<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
+ add_daemon polipo<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping polipo"<br />
- kill `pidof /usr/bin/polipo`<br />
+ kill $PID<br />
+ if [ $? -gt 0 ]; then<br />
+ stat_fail<br />
+ else<br />
+ rm_daemon polipo<br />
+ stat_done<br />
+ fi<br />
+ ;;<br />
+ purge)<br />
+ stat_busy "Purging polipo"<br />
+ kill -USR1 $PID<br />
+ sleep 1<br />
+ /usr/bin/polipo -x $POLIPO_ARGS<br />
+ kill -USR2 $PID<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
@@ -28,6 +44,7 @@<br />
$0 start<br />
;;<br />
*)<br />
- echo "usage: $0 {start|stop|restart}"<br />
+ echo "usage: $0 {start|stop|restart|purge}"<br />
;;<br />
esac<br />
+exit 0<br />
</pre><br />
<br />
And create {{filename|/etc/cron.weekly/polipo}} with the following:<br />
#!/bin/sh <br />
set -e<br />
/etc/rc.d/polipo purge<br />
<br />
Make it executable:<br />
# chmod +x /etc/cron.weekly/polipo<br />
<br />
===Run Polipo as designated user===<br />
{{note|to-do.}}<br />
<br />
==Starting the daemon==<br />
To start the Polipo daemon:<br />
# /etc/rc.d/polipo start<br />
<br />
Add it to {{filename|/etc/rc.conf}} to start it automatically at boot:<br />
DAEMONS=(syslog-ng network netfs '''polipo''' crond)<br />
<br />
===Multiple instances===<br />
Polipo can also run without super user priveleges. To do so, first copy {{filename|/etc/polipo/config.sample}} to a suitable directory:<br />
$ cp /etc/polipo/config.sample ~/.poliporc<br />
<br />
Edit it so that it points at a writable location, instead of {{filename|/var/cache/polipo}}:<br />
# Uncomment this if you want to put the on-disk cache in a<br />
# non-standard location:<br />
diskCacheRoot = "~/.polipo-cache/"<br />
<br />
Create the cache directory:<br />
$ mkdir ~/.polipo-cache<br />
<br />
Finally, launch Polipo with the new configuration:<br />
$ polipo -c ~/.poliporc<br />
<br />
==Configuration==<br />
Management is mostly performed in {{filename|/etc/polipo/config}}. Most users can opt for using the sample configuration file, which is sufficient for most situations and well documented.<br />
# cd /etc/polipo; cp config.sample config<br />
<br />
Unlike other proxies, Polipo needs to be restarted after alterations.<br />
<br />
===Browser===<br />
Set the browser so that it uses {{codeline|localhost:8123}} for proxying. Be sure to disable the browser's disk cache to avoid redundant IO operations and bad performance.<br />
<br />
===Tunneling===<br />
{{note|this requires to run Polipo as its own user.}}<br />
Instead of manually configuring each browser or other utilities that might benefit from Polipo's caching, one can also use [[iptables]] to route traffic through polipo.<br />
<br />
After installing iptables, add the appropiate rules to {{filename|/etc/iptables/iptables.rules}}:<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
''-A OUTPUT -p tcp --dport 80 -m owner --uid-owner polipo -j ACCEPT''<br />
''-A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8123''<br />
COMMIT<br />
This routes HTTP traffic through Polipo. Remove all proxy settings from browsers, if any, and restart iptables.<br />
<br />
===Privoxy===<br />
[[Privoxy]] is a proxy useful for intercepting advertisement and other undesirables.<br />
<br />
According to Polipo's developer, in order to get the privacy enhancements of Privoxy and much (but not all) of the performance of Polipo, one should place Polipo upstream of Privoxy.<br />
<br />
In other words:<br />
*point the browser at Privoxy: {{codeline|localhost:8118}}<br />
*and direct Privoxy traffic to Polipo: {{codeline|forward / localhost:8123}} in the Privoxy configuration file.<br />
<br />
===Tor===<br />
[[Tor]] is an anonymizing proxy network.<br />
<br />
To use Polipo with Tor, uncomment or include the following in {{codeline|/etc/polipo/config}}:<br />
socksParentProxy = localhost:9050<br />
<br />
==More resources==<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/faq.html Polipo FAQ]<br />
*[http://www.pps.jussieu.fr/~jch/software/polipo/manual/index.html The Polipo Manual]</div>Timehttps://wiki.archlinux.org/index.php?title=Rsync&diff=87449Rsync2009-12-12T02:27:31Z<p>Time: mv chmod part</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:System recovery (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[http://samba.anu.edu.au/rsync/ rsync] is an open source utility that provides fast incremental file transfer.<br />
<br />
==Installation==<br />
Install the {{package Official|rsync}} package using [[pacman]]:<br />
# pacman -S rsync<br />
<br />
==Usage==<br />
For more examples, search the [http://bbs.archlinux.org/viewforum.php?id=27 Community Contributions] and [http://bbs.archlinux.org/viewforum.php?id=33 General Programming] forums.<br />
<br />
===As a cp alternative===<br />
rsync can readily be used as an advanced cp alternative, specially useful for copying larger files:<br />
$ rsync -P src dest<br />
<br />
The {{Codeline|-P}} option is the same as {{Codeline|--partial --progress}}, which keeps partially transferred files and shows a progress bar during transfer.<br />
<br />
===As a backup utility===<br />
The rsync protocol can easily be used for backups, only transferring files that have changed since the last backup. This section describes a very simple scheduled backup script using rsync, typically used for copying to removable media. For a more thorough example, see [[Full system backup with rsync]].<br />
<br />
====Automated backup====<br />
For the sake of this example, the script is created in the {{Filename|/etc/cron.daily}} directory, and will be run on a daily basis if a cron [[daemon]] is installed and properly configured. Configuring and using [[cron]] is outside the scope of this article.<br />
<br />
First, create a script containing the appropriate command options:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a --delete /folder/to/backup /location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-a}} : indicates that files should be archived, meaning that all of their attributes are preserved<br />
; {{Codeline|--delete}} : means files deleted on the source are to be deleted on the backup aswell<br />
<br />
Here, {{Filename|/folder/to/backup}} should to be changed to what needs to be backed-up ({{Filename|/home}}, for example) and {{Filename|/location/to/backup}} is where the backup should be saved ({{Filename|/media/disk}}, for instance).<br />
<br />
Finally, the script must be executable:<br />
# chmod +x /etc/cron.daily/rsync.backup<br />
<br />
====Automated backup with SSH====<br />
If backing-up to a remote host using [[SSH]], use this script instead:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a -r --delete -e ssh /folder/to/backup remoteuser@remotehost:/location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-e ssh}} : tells rsync to use SSH<br />
; {{Codeline|remoteuser}} : is the user on the host {{Codeline|remotehost}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87448System backup2009-12-12T02:25:44Z<p>Time: rm merge tmpl</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
The script is very simple; it rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination, and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=Rsync&diff=87447Rsync2009-12-12T02:25:25Z<p>Time: /* Automated backup */ less for example</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:System recovery (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[http://samba.anu.edu.au/rsync/ rsync] is an open source utility that provides fast incremental file transfer.<br />
<br />
==Installation==<br />
Install the {{package Official|rsync}} package using [[pacman]]:<br />
# pacman -S rsync<br />
<br />
==Usage==<br />
For more examples, search the [http://bbs.archlinux.org/viewforum.php?id=27 Community Contributions] and [http://bbs.archlinux.org/viewforum.php?id=33 General Programming] forums.<br />
<br />
===As a cp alternative===<br />
rsync can readily be used as an advanced cp alternative, specially useful for copying larger files:<br />
$ rsync -P src dest<br />
<br />
The {{Codeline|-P}} option is the same as {{Codeline|--partial --progress}}, which keeps partially transferred files and shows a progress bar during transfer.<br />
<br />
===As a backup utility===<br />
The rsync protocol can easily be used for backups, only transferring files that have changed since the last backup. This section describes a very simple scheduled backup script using rsync, typically used for copying to removable media. For a more thorough example, see [[Full system backup with rsync]].<br />
<br />
====Automated backup====<br />
For the sake of this example, the script is created in the {{Filename|/etc/cron.daily}} directory, and will be run on a daily basis if a cron [[daemon]] is installed and properly configured. Configuring and using [[cron]] is outside the scope of this article.<br />
<br />
First, create a script containing the appropriate command options:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a --delete /folder/to/backup /location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-a}} : indicates that files should be archived, meaning that all of their attributes are preserved<br />
; {{Codeline|--delete}} : means files deleted on the source are to be deleted on the backup aswell<br />
<br />
Here, {{Filename|/folder/to/backup}} should to be changed to what needs to be backed-up ({{Filename|/home}}, for example) and {{Filename|/location/to/backup}} is where the backup should be saved ({{Filename|/media/disk}}, for instance).<br />
<br />
====Automated backup with SSH====<br />
If backing-up to a remote host using [[SSH]], use this script instead:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a -r --delete -e ssh /folder/to/backup remoteuser@remotehost:/location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-e ssh}} : tells rsync to use SSH<br />
; {{Codeline|remoteuser}} : is the user on the host {{Codeline|remotehost}}<br />
<br />
Finally, the script must be executable:<br />
# chmod +x /etc/cron.daily/rsync.backup</div>Timehttps://wiki.archlinux.org/index.php?title=Rsync&diff=87446Rsync2009-12-12T02:24:53Z<p>Time: /* Automated backup */ mv cron link</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:System recovery (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[http://samba.anu.edu.au/rsync/ rsync] is an open source utility that provides fast incremental file transfer.<br />
<br />
==Installation==<br />
Install the {{package Official|rsync}} package using [[pacman]]:<br />
# pacman -S rsync<br />
<br />
==Usage==<br />
For more examples, search the [http://bbs.archlinux.org/viewforum.php?id=27 Community Contributions] and [http://bbs.archlinux.org/viewforum.php?id=33 General Programming] forums.<br />
<br />
===As a cp alternative===<br />
rsync can readily be used as an advanced cp alternative, specially useful for copying larger files:<br />
$ rsync -P src dest<br />
<br />
The {{Codeline|-P}} option is the same as {{Codeline|--partial --progress}}, which keeps partially transferred files and shows a progress bar during transfer.<br />
<br />
===As a backup utility===<br />
The rsync protocol can easily be used for backups, only transferring files that have changed since the last backup. This section describes a very simple scheduled backup script using rsync, typically used for copying to removable media. For a more thorough example, see [[Full system backup with rsync]].<br />
<br />
====Automated backup====<br />
For the sake of this example, the script is created in the {{Filename|/etc/cron.daily}} directory, and will be run on a daily basis if a cron [[daemon]] is installed and properly configured. Configuring and using [[cron]] is outside the scope of this article.<br />
<br />
First, create a script containing the appropriate command options:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a --delete /folder/to/backup /location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-a}} : indicates that files should be archived, meaning that all of their attributes are preserved<br />
; {{Codeline|--delete}} : means files deleted on the source are to be deleted on the backup aswell<br />
<br />
Here, {{Filename|/folder/to/backup}} should to be changed to what needs to be backed-up ({{Filename|/home}}, for example) and {{Filename|/location/to/backup}} is where the backup should be saved ({{Filename|/media/disk}}, for example).<br />
<br />
====Automated backup with SSH====<br />
If backing-up to a remote host using [[SSH]], use this script instead:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a -r --delete -e ssh /folder/to/backup remoteuser@remotehost:/location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-e ssh}} : tells rsync to use SSH<br />
; {{Codeline|remoteuser}} : is the user on the host {{Codeline|remotehost}}<br />
<br />
Finally, the script must be executable:<br />
# chmod +x /etc/cron.daily/rsync.backup</div>Timehttps://wiki.archlinux.org/index.php?title=Rsync&diff=87445Rsync2009-12-12T02:23:55Z<p>Time: add link to Full system backup with rsync</p>
<hr />
<div>[[Category:Utilities (English)]]<br />
[[Category:System recovery (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[http://samba.anu.edu.au/rsync/ rsync] is an open source utility that provides fast incremental file transfer.<br />
<br />
==Installation==<br />
Install the {{package Official|rsync}} package using [[pacman]]:<br />
# pacman -S rsync<br />
<br />
==Usage==<br />
For more examples, search the [http://bbs.archlinux.org/viewforum.php?id=27 Community Contributions] and [http://bbs.archlinux.org/viewforum.php?id=33 General Programming] forums.<br />
<br />
===As a cp alternative===<br />
rsync can readily be used as an advanced cp alternative, specially useful for copying larger files:<br />
$ rsync -P src dest<br />
<br />
The {{Codeline|-P}} option is the same as {{Codeline|--partial --progress}}, which keeps partially transferred files and shows a progress bar during transfer.<br />
<br />
===As a backup utility===<br />
The rsync protocol can easily be used for backups, only transferring files that have changed since the last backup. This section describes a very simple scheduled backup script using rsync, typically used for copying to removable media. For a more thorough example, see [[Full system backup with rsync]].<br />
<br />
====Automated backup====<br />
For the sake of this example, the script is created in the {{Filename|/etc/cron.daily}} directory, and will be run on a daily basis if a [[cron]] [[daemon]] is installed and properly configured. Configuring/using cron is outside the scope of this article.<br />
<br />
First, create a script containing the appropriate command options:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a --delete /folder/to/backup /location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-a}} : indicates that files should be archived, meaning that all of their attributes are preserved<br />
; {{Codeline|--delete}} : means files deleted on the source are to be deleted on the backup aswell<br />
<br />
Here, {{Filename|/folder/to/backup}} should to be changed to what needs to be backed-up ({{Filename|/home}}, for example) and {{Filename|/location/to/backup}} is where the backup should be saved ({{Filename|/media/disk}}, for example).<br />
<br />
====Automated backup with SSH====<br />
If backing-up to a remote host using [[SSH]], use this script instead:<br />
{{File|name=/etc/cron.daily/backup|content=<br />
#!/bin/bash<br />
rsync -a -r --delete -e ssh /folder/to/backup remoteuser@remotehost:/location/to/backup &> /dev/null}}<br />
<br />
; {{Codeline|-e ssh}} : tells rsync to use SSH<br />
; {{Codeline|remoteuser}} : is the user on the host {{Codeline|remotehost}}<br />
<br />
Finally, the script must be executable:<br />
# chmod +x /etc/cron.daily/rsync.backup</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87443System backup2009-12-12T02:02:58Z<p>Time: /* Boot setup */ gr</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
The script is very simple; it rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination, and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87442System backup2009-12-12T02:01:25Z<p>Time: /* Backup script */ less this</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
The script is very simple; it rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87440System backup2009-12-12T01:59:23Z<p>Time: /* Configure bootloader */ less so</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
This script is very simple. It rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87439System backup2009-12-12T01:58:15Z<p>Time: /* Configure bootloader */ clar</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
This script is very simple. It rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that even though the boot loader installs correctly, its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do so, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87438System backup2009-12-12T01:57:19Z<p>Time: /* Boot setup */ gr</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
This script is very simple. It rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination and configuration in the destination's {{filename|/boot/grub/menu.lst}} needs to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that the boot loader installs correctly, but its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do so, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87437System backup2009-12-12T01:55:23Z<p>Time: /* Backup script */ format</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
This script is very simple. It rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1<br />
:Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination and configuration in the destination's {{filename|/boot/grub/menu.lst}} need to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that the boot loader installs correctly, but its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do so, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87436System backup2009-12-12T01:53:36Z<p>Time: /* Partitioning */ less comma</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device) needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
This script is very simple. It rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}:<br />
In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1:<br />
Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}:<br />
This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination and configuration in the destination's {{filename|/boot/grub/menu.lst}} need to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that the boot loader installs correctly, but its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do so, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Timehttps://wiki.archlinux.org/index.php?title=System_backup&diff=87435System backup2009-12-12T01:52:51Z<p>Time: less comma</p>
<hr />
<div>[[Category:System recovery (English)]]<br />
[[Category:HOWTOs_(English)]]<br />
{{Template:Merge|Rsync}}<br />
This [[rsync]] script allows creating a full backup copy across file-systems. It is setup so that the copy includes intact booting capabilities, optionally excluding selected files.<br />
<br />
The approach has benefits over omitting system files by just copying personal data; if the system becomes corrupted in the main partition, overcoming the problem means booting into the backup as opposed to identifying and reinstalling affected programs followed by copying back personal data.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<br />
<br />
==Partitioning==<br />
<!-- this section might be wrong. investigating on veracity/replacing scripts... --><br />
File-systems in the backup ''source'' and ''destination'' device need to be the same type. It could work with a mix of ext3 and ext4, but this hasn't been tested. For booting capabilities, the partitioning on the backup source does not matter, whereas the device the backup will be copied to (destination device), needs to have a single partition.<br />
<br />
==Files==<br />
Two files are needed; the backup script and a file stating which files to include/exclude from the backup source.<br />
<br />
===Backup script===<br />
This script is very simple. It rsyncs in archive mode, ensuring that symbolic links, devices, attributes, permissions and ownerships, among other file attributes are preserved, while excluding files that match the patterns from the include/exclude list.<br />
<br />
Save it as {{filename|rbackup.sh}} and make it executable:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{codeline|/}}:<br />
In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{codeline|$}}1:<br />
Passed as an argument to the script; e.g. {{filename|/media/mountpoint}}<br />
<br />
;Include/exclude list; {{codeline|<nowiki>--exclude-from=backup.lst</nowiki>}}:<br />
This example uses {{filename|backup.lst}}.<br />
<br />
===Include/exclude list===<br />
As deciding which files should populate this list can be difficult, here's a typical backup example that excludes common files that don't need to be backed up, such as the vast majority of {{filename|/dev}}. Note that specifying every desired file or directory in {{codeline|Include}} is not needed; this section only acts as a filter for statements in {{codeline|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{filename|backup.lst}}:<br />
{{file|name=backup.lst|content=<br />
# Include<br />
+ /dev/console<br />
+ /dev/initctl<br />
+ /dev/null<br />
+ /dev/zero<br />
<br />
# Exclude<br />
- /dev/*<br />
- /proc/*<br />
- /sys/*<br />
- /tmp/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{filename|/dev}}, {{filename|/proc}}, {{filename|/sys}} and {{filename|/tmp}} are excluded because they are created by the system at runtime. Note that the directories themselves need to be preserved since they are ''not'' regenerated at boot.<br />
<br />
;Include: Even though {{filename|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{filename|console}}, {{filename|initctl}}, {{filename|null}} and {{filename|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{filename|/dev/'''sdb1'''}} along with {{filename|/media/'''mountpoint'''}} as apropiate, and mount the destination device:<br />
# mount /dev/sdb1 /media/mountpoint<br />
<br />
Run the backup script:<br />
# ./rbackup.sh /media/mountpoint/<br />
<br />
rsync will then backup to that destination.<br />
<br />
==Boot setup==<br />
After the sync is finished, a boot loader needs to be installed on the backup destination and configuration in the destination's {{filename|/boot/grub/menu.lst}} need to be amended to reflect the new location. <br />
<br />
These instructions assume [[GRUB]] is the bootloader of choice.<br />
<br />
===Install bootloader===<br />
Open the GRUB console:<br />
# grub<br />
<br />
Direct the install towards the destination device:<br />
root (hd'''1,0''')<br />
setup (hd'''1''')<br />
<br />
The '''{{codeline|root}}''' command should point to where the GRUB files are located--in this case, "{{codeline|hd 1}}" means the second storage device ({{filename|/dev/sdb}}) and "{{codeline|0}}" is the first partition ({{filename|/dev/sdb''1''}}).<br />
<br />
Whereas the '''{{codeline|setup}}''' command should point to where the actual boot loader is to be installed. In this example it is installed to the [[MBR]] of the second storage device.<br />
<br />
===Configure bootloader===<br />
The problem here is that the boot loader installs correctly, but its menu entries are for the main system's partitions, not the backup system's.<br />
<br />
It's possible to fix this by creating a custom {{filename|/boot/grub/menu.lst}} for the backup destination. In order to do so, modify {{filename|rbackup.sh}} so that it copies a custom {{filename|menu.lst}}:<br />
{{file|name=rbackup.sh|content=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
sudo sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
'''cp ~/custom.menu.lst $1/boot/grub/menu.lst;'''<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
{{tip|instead of replacing {{filename|menu.lst}} with a custom version solely for the backup, add a new GRUB entry pointing to the backup device or simply edit GRUB's menu during boot time.}}</div>Time