https://wiki.archlinux.org/api.php?action=feedcontributions&user=Reventlov&feedformat=atomArchWiki - User contributions [en]2024-03-29T08:48:07ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Thunderbird&diff=504965Thunderbird2017-12-29T15:45:35Z<p>Reventlov: Troubleshooting white page temporary freeze</p>
<hr />
<div>[[Category:Email clients]]<br />
[[de:Thunderbird]]<br />
[[fr:Thunderbird]]<br />
[[it:Thunderbird]]<br />
[[ja:Thunderbird]]<br />
{{Related articles start}}<br />
{{Related|Thunderbird/Enigmail}}<br />
{{Related|Firefox}}<br />
{{Related articles end}}<br />
<br />
[https://www.mozilla.org/thunderbird/ Mozilla Thunderbird] is an open source email, news, and chat client developed by the [https://www.mozilla.org/ Mozilla Foundation].<br />
<br />
== Installation ==<br />
<br />
[[Install]] the {{Pkg|thunderbird}} package, with a [https://www.archlinux.org/packages/?q=thunderbird-i18n language pack] if required.<br />
<br />
Other versions include:<br />
<br />
* {{App | Thunderbird Beta | Cutting edge features with relatively-good stability. | https://www.mozilla.org/thunderbird/channel/ | {{AUR|thunderbird-beta-bin}}}}<br />
* {{App | Thunderbird Earlybird | Experience the newest innovations as they're developed (equivalent to an alpha and Firefox Aurora releases). | https://www.mozilla.org/thunderbird/channel/ | {{AUR|thunderbird-earlybird}}}}<br />
* {{App | Thunderbird Nightly | Experience the newest innovations with nightly releases (for those that want to work with breakages). | https://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-comm-central/ | {{AUR|thunderbird-nightly}}}}<br />
<br />
A version overview, both past and future, can be read on the [https://wiki.mozilla.org/Releases Mozilla wiki].<br />
<br />
== Securing ==<br />
<br />
=== Considerations ===<br />
<br />
Under some circumstances Thunderbird may send your system's (internal) IP address as reply to HELO/ELHO requesting SMTP servers. If you have concerns, please read [http://kb.mozillazine.org/Replace_IP_address_with_name_in_headers this] article. You might change this for Firefox, too.<br />
<br />
If you want to hide Thunderbird for sending your system's [https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference#Linux User Agent] string,<br />
create a new empty string entry {{ic|general.useragent.override}} in the [[#Config Editor]].<br />
<br />
While Thunderbird disables email images by default, it enables HTML rendering which may expose IP address and location. Choose ''View > Message Body As > Plain Text'' to disable this.<br />
<br />
JavaScript is disabled for message content but not RSS news feeds. To disable JavaScript for RSS set {{ic|javascript.enabled}} to false in the [[#Config Editor]].<br />
<br />
== Extensions ==<br />
<br />
* {{App|[[Thunderbird/Enigmail|Enigmail]]|Extension for writing and receiving email signed and/or encrypted with the OpenPGP standard.|https://www.enigmail.net|{{AUR|thunderbird-enigmail}}, {{AUR|thunderbird-enigmail-bin}}}}<br />
* {{App|TorBirdy|Extension that configures Thunderbird to make connections over the [[Tor]] anonymity network|[https://addons.mozilla.org/thunderbird/addon/torbirdy/ TorBirdy AMO]|}}<br />
* {{App|FireTray|Adds a customizable system tray icon for Thunderbird|[https://addons.mozilla.org/thunderbird/addon/firetray/ FireTray AMO]|}}<br />
* {{App|[https://www.mozilla.org/projects/calendar/lightning/ Lightning]| A calendar extension that brings [[Wikipedia:Mozilla Sunbird|Sunbird]]'s functionality to Thunderbird, including CalDAV support.|[https://addons.mozilla.org/thunderbird/addon/lightning/ Lightning AMO] |{{aur|thunderbird-lightning-bin}}}}<br />
* {{App|SOGo Connector| Lets you sync address books via CardDAV|https://sogo.nu/download.html#/frontends|{{AUR|thunderbird-sogo-connector-bin}}}}<br />
* {{App|Cardbook|A new addressbook for Thunderbird based on the CARDDav and VCARD standards.|[https://addons.mozilla.org/thunderbird/addon/cardbook/ Cardbook AMO]|}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Config Editor ===<br />
<br />
Thunderbird can be extensively configured in ''Edit > Preferences > Advanced > General > Config Editor''.<br />
<br />
=== Setting the default browser ===<br />
<br />
{{Note|Since version 24 the {{ic|network.protocol-handler.app.*}} keys have no effect and will not be able to set the default browser.}}<br />
<br />
Thunderbird uses the default browser as defined by the [[Default applications|system MIME settings]]. This is commonly modified by the Gnome Control Center (''Gnome Control Center > Details > Default Applications > Web'') (available in: {{Pkg|gnome-control-center}}).<br />
<br />
This can be overridden in the [[#Config Editor]] by searching for {{ic|network.protocol-handler.warn-external}}.<br />
<br />
If the following three are all set to '''false''' (default), turn them to '''true''', and Thunderbird will ask you when clicking on links which application to use (remember to also check ''"Remember my choice for .. links"'').<br />
<br />
network.protocol-handler.warn-external.ftp<br />
network.protocol-handler.warn-external.http<br />
network.protocol-handler.warn-external.https<br />
<br />
=== Plain Text mode and font uniformity ===<br />
<br />
Plain Text mode lets you view all your emails without HTML rendering and is available in ''View > Message Body As''. This defaults to the [[Wikipedia:Monospace_(Unicode)|Monospace]] font but the size is still inherited from original system fontconfig settings. The following example will overwrite this with Ubuntu Mono of 10 pixels (available in: {{Pkg|ttf-ubuntu-font-family}}).<br />
<br />
Remember to run {{ic|fc-cache -fv}} to update system font cache. See [[Font configuration]] for more information.<br />
<br />
{{hc|~/.config/fontconfig/fonts.conf|<nowiki><br />
<?xml version="1.0"?><br />
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"><br />
<fontconfig><br />
<match target="pattern"><br />
<test qual="any" name="family"><string>monospace</string></test><br />
<edit name="family" mode="assign" binding="same"><string>Ubuntu Mono</string></edit><br />
<!-- For Thunderbird, lowering default font size to 10 for uniformity --><br />
<edit name="pixelsize" mode="assign"><int>10</int></edit><br />
</match><br />
</fontconfig><br />
</nowiki>}}<br />
<br />
=== Webmail with Thunderbird ===<br />
<br />
:''See upstream Wiki: [http://kb.mozillazine.org/Using_webmail_with_your_email_client Using webmail with your email client].''<br />
<br />
=== Migrate profile to another system ===<br />
<br />
{{Tip|The [https://addons.mozilla.org/thunderbird/addon/importexporttools ImportExportTools] addon offers an option to export and import a profile folder.}}<br />
<br />
Before you start with Importing or Exporting tasks, backup your complete {{ic|~/.thunderbird}} profile:<br />
<br />
$ cp -R ~/.thunderbird /to/backup/folder/<br />
<br />
With migration you just copy your current Thunderbird profile to another PC or a new Thunderbird installation:<br />
<br />
1. Install Thunderbird on the target PC<br />
<br />
2. Start Thunderbird without doing anything and quit it.<br />
<br />
3. Go to your Backup folder of your old Thunderbird installation<br />
<br />
4. Enter the backup profile folder:<br />
<br />
$ cd /to/backup/folder/.thunderbird/<oldrandomnumber>.default/<br />
<br />
5. Copy its content into the target profile folder {{ic|~/.thunderbird/<newrandomnumber>.default/}}<br />
<br />
$ cp -R /to/backup/folder/.thunderbird/<oldrandomnumber>.default/* ~/.thunderbird/<newrandomnumber>.default/<br />
<br />
=== Export + Import ===<br />
<br />
Before you start with Importing or Exporting tasks, backup your complete {{ic|~/.thunderbird}} profile:<br />
<br />
$ cp -R ~/.thunderbird /to/backup/folder/<br />
<br />
If your accounts are broken or you want to join two different Thunderbird installations, you better install one Import and Export AddOn (eg. [https://addons.mozilla.org/thunderbird/addon/importexporttools ImportExportTools AddOn]) to both Thunderbird installations and following this just export and import all your data to the new installation.<br />
<br />
=== Changing the default sorting order ===<br />
Thunderbird (up to at least 31.4.0-1) sorts mail by date with the oldest on top without any threading. While this can be changed per folder, it is easier to set a sane default instead as described in [https://superuser.com/questions/13518/change-the-default-sorting-order-in-thunderbird this Superuser.com post].<br />
<br />
Set these preferences in the [[#Config Editor]]:<br />
<br />
mailnews.default_sort_order = 2 (descending)<br />
mailnews.default_view_flags = 1 (Threaded view)<br />
<br />
=== Maildir support ===<br />
The default message store format is mbox. To enable the use of Maildir, see [https://wiki.mozilla.org/Thunderbird/Maildir Mozilla wiki: Thunderbird/Maildir]. You basically have to set the following preference in the [[#Config Editor]]:<br />
<br />
mail.serverDefaultStoreContractID = @mozilla.org/msgstore/maildirstore;1<br />
<br />
Some limitations up to at least 31.4.0-1: only the "tmp" and "cur" directories are supported. The "new" directory is completely ignored. The read state of mails are stored in a separate ".msf" file, so initially all local mail using Maildir will be marked as unread even when located in the "cur" directory.<br />
<br />
=== Spell checking ===<br />
<br />
[[Install]] {{Pkg|hunspell}} and a [https://www.archlinux.org/packages/?q=hunspell+dict hunspell language dictionary] and restart Thunderbird.<br />
<br />
See the Firefox article for [[Firefox#Firefox does not remember default spell check language|how to set the default spell checking language]].<br />
<br />
=== Native notifications ===<br />
<br />
Enable {{ic|mail.biff.use_system_alert}} in the [[#Config Editor]].<br />
<br />
== Troubleshooting ==<br />
<br />
=== LDAP Segfault ===<br />
<br />
An [https://bugzilla.mozilla.org/show_bug.cgi?id=292127 LDAP clash (Bugzilla#292127)] arises on systems configured to use it to fetch user information. A possible [https://bugzilla.mozilla.org/show_bug.cgi?id=292127#c7 workaround] consists of renaming the conflicting bundled LDAP library.<br />
<br />
=== Error: Incoming server already exists ===<br />
<br />
It seems Thunderbird (v24) still has that bug which pops up with "Incoming server already exists" if you want to reinstall a previously deleted account with the same account data afterwards. Unfortunately, if you get this error you can now only clean reinstall Thunderbird: <br />
<br />
1. Make a backup of your current profile:<br />
<br />
$ cp -R ~/.thunderbird /to/backup/folder/<br />
<br />
2. Export all you Accounts, Calendar and Feeds via an AddOn like it's written in ''Export section'' of this Wiki.<br />
3. Uninstall your current Thunderbird installation<br />
<br />
$ pacman -R thunderbird<br />
<br />
4. Remove all your data by deleting your current Thunderbird folder {{ic|rm -R ~/.thunderbird/}}.<br />
<br />
5. Install Thunderbird again:<br />
<br />
$ pacman -S thunderbird<br />
<br />
6.Create your mail accounts, feeds and calenders (empty).<br />
<br />
7. Install the [https://addons.mozilla.org/thunderbird/addon/importexporttools/ ImportExportTools] AddOn<br />
<br />
8. Import all your data.<br />
<br />
=== Thunderbird UI freezes eceiving a new message ===<br />
<br />
If thunderbird is configured to show an alert when a new message arrives, or at launch, the lack of a notification daemon may freeze the interface (white screen) for many seconds. You can solve this issue by disabling alerts or installing a [[Desktop_notifications#Notification_servers|notification server]].</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Gitea&diff=496325Gitea2017-11-13T16:42:00Z<p>Reventlov: Note on the shell</p>
<hr />
<div>[[Category:Version Control System]]<br />
[[Category:Web applications]]<br />
[[ja:Gitea]]<br />
{{Related articles start}}<br />
{{Related|Gogs}}<br />
{{Related articles end}}<br />
{{Expansion|Missing PostgreSQL, [[Apache]] proxy example, etc.}}<br />
[https://gitea.io/ Gitea] is a community managed fork of [[Gogs]], lightweight code hosting solution written in Go and published under the MIT license.<br />
<br />
== Installation ==<br />
[[Install]] the {{AUR|gitea}} or {{AUR|gitea-git}} package.<br />
<br />
Gitea requires the use of a database backend, the following are supported:<br />
* [[MariaDB]]/[[MySQL]]<br />
* [[PostgreSQL]]<br />
* [[SQLite]] <br />
* [https://github.com/pingcap/tidb TiDB]<br />
<br />
== Running ==<br />
{{Note|If you want Gitea to listen on all interfaces, set {{ic|1=HTTP_ADDR = 0.0.0.0}} in {{ic|/var/lib/gitea/custom/conf/app.ini}}.}}<br />
<br />
[[Start/enable]] {{ic|gitea.service}}, the webinterface should listen on {{ic|http://localhost:3000}}.<br />
<br />
When running Gitea for the first time it should redirect to {{ic|http://localhost:3000/install}}.<br />
<br />
== Configuration ==<br />
{{Note|{{AUR|gitea-git}} already provides a basic configuration file of {{ic|/var/lib/gitea/custom/conf/app.ini}} on first install.}}<br />
The user configuration file should be located at {{ic|/etc/gitea/app.ini}}. Do '''not''' edit the main configuration file ({{ic|/var/lib/gitea/conf/app.ini}}), since this file is included in the binary and will be overwritten on each update. Instead copy (if not exists) {{ic|/var/lib/gitea/conf/app.ini}} to {{ic|/etc/gitea/app.ini}}.<br />
<br />
Gitea application and repository data will be saved into ''/var/lib/gitea'', however it is possible to set custom locations in {{ic|/etc/gitea/app.ini}}.<br />
<br />
Gitea relies on bash for operations like cloning in ssh; bash should therefore be the shell of the user running gitea.<br />
<br />
=== MariaDB/MySQL ===<br />
{{Note|MySQL socket support can be enabled by using {{ic|/var/run/mysqld/mysqld.sock}} as the listen address.}}<br />
<br />
The following is an example of setting up [[MariaDB]]:<br />
{{hc|$ mysql -u root -p|2=<br />
mysql> CREATE DATABASE `gitea` DEFAULT CHARACTER SET `utf8mb4` COLLATE `utf8mb4_general_ci`;<br />
mysql> CREATE USER `gitea`@'localhost' IDENTIFIED BY 'password';<br />
mysql> GRANT ALL PRIVILEGES ON `gitea`.* TO `gitea`@`localhost`;<br />
mysql> \q<br />
}}<br />
<br />
Try connecting to the new database with the new user:<br />
<br />
$ mysql -u '''gitea''' -p -D gitea<br />
<br />
Configure MariaDB on first run or by updating {{ic|app.ini}}:<br />
{{hc|/etc/gitea/app.ini|2=<br />
DB_TYPE = mysql<br />
HOST = 127.0.0.1:3306 ; or /var/run/mysqld/mysqld.sock<br />
NAME = gitea<br />
USER = gitea<br />
PASSWD = '''password'''<br />
}}<br />
<br />
=== Enable SSH Support ===<br />
{{Note|<br />
*{{AUR|gitea-git}} provides a {{ic|gitea}} [[group]] and [[user]].<br />
*{{AUR|gitea}} uses {{ic|git}} as [[group]]/[[user]], use {{ic|git}} instead of {{ic|gitea}} on instructions given below.<br />
*See [[SSH keys#Key ignored by the server]] if the prompt for password keeps active.<br />
}}<br />
{{Warning|If you do all configuration via SSH do not close the session before you tested that everything is working, else you may lock yourself out.}}<br />
<br />
*Make sure [[SSH]] has been properly configured.<br />
*Create the {{ic|gitea}} [[group]] and [[user]] with {{ic|/home/gitea}} as home directory:<br />
# groupadd --system gitea<br />
# useradd --system -c 'Gitea' -g gitea -m -d /home/gitea -s /bin/bash gitea<br />
*Set correct permissions:<br />
# chown -R gitea:gitea /var/log/gitea<br />
# chown -R gitea:gitea /var/lib/gitea<br />
*Update {{ic|app.ini}} to the running [[SSH]] configuration:<br />
{{hc|/etc/gitea/app.ini|2=<br />
[server]<br />
; Disable SSH feature when not available<br />
DISABLE_SSH = '''false'''<br />
; Domain name to be exposed in clone URL<br />
SSH_DOMAIN = %(DOMAIN)s<br />
; Port number to be exposed in clone URL<br />
SSH_PORT = '''22'''<br />
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.<br />
SSH_ROOT_PATH = '''/home/gitea/.ssh'''<br />
}}<br />
*Update the [[Secure_Shell#Configuration_2|SSH configuration]] with {{ic|AuthorizedKeysFile .ssh/authorized_keys}} and {{ic|AllowUsers gitea}}, e.g.:<br />
{{hc|/etc/ssh/sshd_config|2=<br />
Port 22<br />
AuthorizedKeysFile '''.ssh/authorized_keys'''<br />
UseDNS no<br />
PermitUserEnvironment '''yes'''<br />
PermitRootLogin no<br />
PasswordAuthentication no<br />
PermitEmptyPasswords no<br />
AllowUsers archie '''gitea'''<br />
PubkeyAuthentication yes<br />
PrintMotd no<br />
Subsystem sftp /usr/lib/ssh/sftp-server<br />
}}<br />
*Set correct [[SSH keys#Key ignored by the server|SSH permissions]] <br />
*[[Restart]] {{ic|gitea.service}} and {{ic|sshd.service}}<br />
*Generate a [[SSH_keys#Generating_an_SSH_key_pair|SSH key pair]] on the '''client''' (if non exists)<br />
*Copy the contents of the (newly) generated {{ic|~/.ssh/id_rsa.pub}} to '''Add Key''' on the '''Your Settings''', '''SSH Keys''' on the Gitea webinterface.<br />
<br />
You should now be able to use SSH-authentication to manage the repositories, without entering an username/password.<br />
<br />
=== Disable HTTP protocol ===<br />
By default, the ability to interact with repositories by HTTP protocol is enabled.<br />
You may want to disable HTTP-support if using [[SSH]], by setting {{ic|DISABLE_HTTP_GIT}} to '''true'''.<br />
<br />
== Advanced Configuration ==<br />
See the [https://gogs.io/docs/intro/faqs Gogs FAQ's] for more configuration examples.<br />
<br />
=== Configure nginx as reverse proxy ===<br />
{{Tip|[[Let’s Encrypt]] is a free, automated, and open certificate authority. A plugin is available to request valid SSL certificates straight from the command line and automatic configuration.}}<br />
An example of using [[nginx]] as reverse proxy including [[OpenSSL]]:<br />
{{hc|/etc/nginx/servers-available/git|2=<br />
# redirect to ssl<br />
server {<br />
listen 80;<br />
listen [::]:80;<br />
server_name git.domain.tld;<br />
return 301 https://$server_name$request_uri;<br />
}<br />
<br />
server {<br />
listen 443 ssl http2;<br />
listen [::]:443 ssl http2;<br />
server_name git.domain.tld;<br />
client_max_body_size 50M;<br />
ssl_certificate ssl/'''cert.crt''';<br />
ssl_certificate_key ssl/'''cert.key''';<br />
location / {<br />
proxy_pass http://localhost:3000;<br />
proxy_set_header Host $host;<br />
proxy_set_header X-Real-IP $remote_addr;<br />
}<br />
}<br />
}}<br />
<br />
Update the ''server'' section of {{ic|app.ini}}:<br />
{{hc|/var/lib/gitea/custom/conf/app.ini|2=<br />
[server]<br />
PROTOCOL = http<br />
DOMAIN = git.domain.tld<br />
ROOT_URL = https://git.domain.tld/<br />
HTTP_ADDR = 0.0.0.0<br />
HTTP_PORT = 3000<br />
}}<br />
{{Note|You don't need to activate any SSL certificate options in {{ic|app.ini}}.}}<br />
<br />
Finally update the ''cookie'' section - set COOKIE_SECURE to '''true'''.<br />
<br />
== See also ==<br />
* [https://docs.gitea.io/ Gitea Documentation]<br />
* [https://gogs.io/docs Gogs Documentation]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=OpenSMTPD&diff=459597OpenSMTPD2016-12-19T13:07:14Z<p>Reventlov: More precision on the FQDN part</p>
<hr />
<div>[[Category:Mail server]]<br />
{{Related articles start}}<br />
{{Related|Dovecot}}<br />
{{Related|Postfix}}<br />
{{Related|Exim}}<br />
{{Related articles end}}<br />
<br />
This article explains how to install and configure a simple [https://www.opensmtpd.org/ OpenSMTPD] server.<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{Pkg|opensmtpd}} from the [[official repositories]].<br />
<br />
== Configuration ==<br />
<br />
{{Pkg|opensmtpd}} is configured in {{ic|/etc/smtpd}}.<br />
<br />
=== Local mail ===<br />
<br />
To have local mail working, for example for [[cron]] mails, it is enough to simply [[start]] {{ic|smtpd.service}}.<br />
<br />
The default configuration of OpenSMTPD is to do local retrieval and delivery of mail, and also relay outgoing mail. See {{man|5|smtpd.conf|url=http://man.openbsd.org/smtpd.conf}}.<br />
<br />
==== Local-only ====<br />
<br />
To do local-only mail, the following is enough:<br />
<br />
{{hc|/etc/smtpd/smtpd.conf|<br />
listen on localhost<br />
accept for local alias <aliases> deliver to mbox<br />
}}<br />
<br />
=== Hybrid : local mail and relay ===<br />
<br />
These two lines in {{ic|/etc/smtpd/smtpd.conf}} :<br />
<br />
accept for local alias <aliases> deliver to mbox<br />
accept for any relay via "smtp://smtp.foo.bar" as "@foo.bar"<br />
<br />
configure OpenSMTPD to :<br />
<br />
* send local email ''locally'', without going through a relay (useful for cron & at mail notifications)<br />
<br />
* use a relay to send a mail outside of localhost<br />
<br />
Simply replace ''smtp.foo.bar'' by your ISP mail server, or another server at<br />
your convenience.<br />
<br />
=== Simple OpenSMTPD/mbox configuration ===<br />
<br />
==== Create encryption keys ====<br />
<br />
{{pkg|openssl}} provides TLS support and is installed by default on Arch installations.<br />
<br />
Create a private key and self-signed certificate. This is adequate for most installations that do not require a [[wikipedia:Certificate_signing_request|CSR]]:<br />
<br />
# mkdir -m 700 /etc/smtpd/tls; cd /etc/smtpd/tls<br />
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout smtpd.key -out smtpd.crt -days 1095<br />
# chmod 400 smtpd.key; chmod 444 smtpd.crt<br />
<br />
==== Create user accounts ====<br />
<br />
* Create a user account on the mail server for each desired mailbox. <br />
<br />
# useradd -m -s /bin/bash roger<br />
# useradd -m -s /bin/bash shirley<br />
<br />
* OpenSMTPD will deliver messages to the user account's mbox file at {{ic|/var/spool/mail/''<username>''}} <br />
* Multiple SMTP email addresses can be routed to a given mbox if desired.<br />
<br />
==== Craft a simple smtpd.conf setup ====<br />
<br />
* A working configuration can be had in as little as nine lines!<br />
{{hc|/etc/smtpd/smtpd.conf|<br />
pki mx.domain.tld certificate "/etc/smtpd/tls/smtpd.crt"<br />
pki mx.domain.tld key "/etc/smtpd/tls/smtpd.key"<br />
<br />
table creds "/etc/smtpd/creds"<br />
table vdoms "/etc/smtpd/vdoms"<br />
table vusers "/etc/smtpd/vusers"<br />
<br />
listen on eth0 tls pki mx.domain.tld<br />
listen on eth0 port 587 tls-require pki mx.domain.tld auth <creds><br />
<br />
accept from any for domain <vdoms> virtual <vusers> deliver to mbox<br />
accept for any relay<br />
}}<br />
<br />
==== Create tables ====<br />
<br />
* For the domain table file; simply put one domain per line<br />
<br />
{{hc|/etc/smtpd/vdoms|<br />
personaldomain.org<br />
businessname.com<br />
}}<br />
<br />
* For the user table file; list one inbound SMTP email address per line and then map it to an mbox user account name, SMTP email address, or any combination of the two on the right, separated by commas.<br />
<br />
{{hc|/etc/smtpd/vusers|<br />
roger@personaldomain.org roger<br />
newsletters@personaldomain.org roger,roger.rulz@gmail.com<br />
<br />
roger@businessname.com roger<br />
shirley@businessname.com shirley<br />
info@businessname.com roger,shirley<br />
contact@businessname.com info@businessname.com<br />
}}<br />
<br />
* For the creds table file; put the user name in the 1st column and the password hash in the 2nd column<br />
<br />
{{hc|/etc/smtpd/creds|<br />
roger <password hash created using 'smtpctl encrypt' command><br />
shirley <password hash created using 'smtpctl encrypt' command><br />
}}<br />
<br />
=== Test the configuration ===<br />
<br />
# smtpd -n<br />
<br />
If you get a message that says 'configuration OK' - you're ready to [[systemd|rock and roll]]. If not, work on any configuration errors and try again.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Console debugging ===<br />
<br />
If you're having problems with mail delivery, try [[stop]]ping the {{ic|smtpd.service}} and launching the daemon manually with the 'do not daemonize' and 'verbose output' options. Then watch the console for errors.<br />
<br />
# smtpd -dv<br />
<br />
=== Subsystem tracing ===<br />
<br />
Add the {{ic|-T}} flag to get real-time subsystem tracing<br />
<br />
# smtpd -dv -T smtp<br />
<br />
Alternately, use the {{ic|smtpctl trace ''<subsystem>''}} command if the daemon is already running. The trace output will appear in the console output above as well as the journalctl output for the smtpd.service. For example:<br />
<br />
# smtpctl trace expand && smtpctl trace lookup<br />
<br />
...will trace both aliases/virtual/forward expansion and user/credentials lookups<br />
<br />
=== Manual Submission port authentication ===<br />
<br />
* Encode username and password in base64<br />
<br />
# printf 'username\0username\0password' | base64 <br />
<br />
* Connect to submission port using {{ic|openssl s_client}} command<br />
<br />
# openssl s_client -host mx.domain.tld -port 587 -starttls smtp<br />
<br />
* enter {{ic|ehlo myhostname}} followed by {{ic|AUTH PLAIN}}. Paste in the base64 string from step above after {{ic|334}} response.<br />
<br />
250 HELP<br />
ehlo test.domain.tld<br />
250-mx.hostname.tld Hello test.domain.tld [5.5.5.5], pleased to meet you<br />
250-8BITMIME<br />
250-ENHANCEDSTATUSCODES<br />
250-SIZE 36700160<br />
250-DSN<br />
250-AUTH PLAIN LOGIN<br />
250 HELP<br />
AUTH PLAIN<br />
334 <br />
dXNlcm5hbWUAdXNlcm5hbWUAcGFzc3dvcmQ=<br />
235 2.0.0: Authentication succeeded<br />
<br />
=== "Helo command rejected: need fully-qualified hostname" ===<br />
<br />
When sending email, if you get this kind of messages, set your FQDN in the file {{ic|/etc/smtpd/mailname}}. Otherwise, the server name is derived from the local hostname returned by gethostname(3), either directly if it is a fully qualified domain name, or by retreiving the associated canonical name through getaddrinfo(3).<br />
<br />
=== Resources ===<br />
<br />
There are also several handy web sites that can help you test DNS records, deliverability, and encryption support<br />
* [http://mxtoolbox.com/ MXToolBox]<br />
* [http://ismyemailworking.com/ IsMyEmailWorking.com]<br />
* [http://www.mail-tester.com/ MailTester]<br />
* [https://checktls.com/ TLS tests and tools]<br />
* [https://starttls.info/ STARTTLS.info]<br />
* [https://pingability.com/zoneinfo.jsp Pingability Quick DNS Check]<br />
<br />
== See also==<br />
<br />
* OpenSMTPD pairs well with [[Dovecot]]. Combine the two for a nice minimalist mailserver<br />
* [http://opensmtpd.org/ OpenSMTPD project page]<br />
* [https://coderwall.com/p/eejzja Simple SMTP server with OpenSMTPD]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=OpenSMTPD&diff=459596OpenSMTPD2016-12-19T13:05:11Z<p>Reventlov: /* Troubleshooting */ You may need to set up your FQDN</p>
<hr />
<div>[[Category:Mail server]]<br />
{{Related articles start}}<br />
{{Related|Dovecot}}<br />
{{Related|Postfix}}<br />
{{Related|Exim}}<br />
{{Related articles end}}<br />
<br />
This article explains how to install and configure a simple [https://www.opensmtpd.org/ OpenSMTPD] server.<br />
<br />
== Installation ==<br />
<br />
[[Install]] {{Pkg|opensmtpd}} from the [[official repositories]].<br />
<br />
== Configuration ==<br />
<br />
{{Pkg|opensmtpd}} is configured in {{ic|/etc/smtpd}}.<br />
<br />
=== Local mail ===<br />
<br />
To have local mail working, for example for [[cron]] mails, it is enough to simply [[start]] {{ic|smtpd.service}}.<br />
<br />
The default configuration of OpenSMTPD is to do local retrieval and delivery of mail, and also relay outgoing mail. See {{man|5|smtpd.conf|url=http://man.openbsd.org/smtpd.conf}}.<br />
<br />
==== Local-only ====<br />
<br />
To do local-only mail, the following is enough:<br />
<br />
{{hc|/etc/smtpd/smtpd.conf|<br />
listen on localhost<br />
accept for local alias <aliases> deliver to mbox<br />
}}<br />
<br />
=== Hybrid : local mail and relay ===<br />
<br />
These two lines in {{ic|/etc/smtpd/smtpd.conf}} :<br />
<br />
accept for local alias <aliases> deliver to mbox<br />
accept for any relay via "smtp://smtp.foo.bar" as "@foo.bar"<br />
<br />
configure OpenSMTPD to :<br />
<br />
* send local email ''locally'', without going through a relay (useful for cron & at mail notifications)<br />
<br />
* use a relay to send a mail outside of localhost<br />
<br />
Simply replace ''smtp.foo.bar'' by your ISP mail server, or another server at<br />
your convenience.<br />
<br />
=== Simple OpenSMTPD/mbox configuration ===<br />
<br />
==== Create encryption keys ====<br />
<br />
{{pkg|openssl}} provides TLS support and is installed by default on Arch installations.<br />
<br />
Create a private key and self-signed certificate. This is adequate for most installations that do not require a [[wikipedia:Certificate_signing_request|CSR]]:<br />
<br />
# mkdir -m 700 /etc/smtpd/tls; cd /etc/smtpd/tls<br />
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout smtpd.key -out smtpd.crt -days 1095<br />
# chmod 400 smtpd.key; chmod 444 smtpd.crt<br />
<br />
==== Create user accounts ====<br />
<br />
* Create a user account on the mail server for each desired mailbox. <br />
<br />
# useradd -m -s /bin/bash roger<br />
# useradd -m -s /bin/bash shirley<br />
<br />
* OpenSMTPD will deliver messages to the user account's mbox file at {{ic|/var/spool/mail/''<username>''}} <br />
* Multiple SMTP email addresses can be routed to a given mbox if desired.<br />
<br />
==== Craft a simple smtpd.conf setup ====<br />
<br />
* A working configuration can be had in as little as nine lines!<br />
{{hc|/etc/smtpd/smtpd.conf|<br />
pki mx.domain.tld certificate "/etc/smtpd/tls/smtpd.crt"<br />
pki mx.domain.tld key "/etc/smtpd/tls/smtpd.key"<br />
<br />
table creds "/etc/smtpd/creds"<br />
table vdoms "/etc/smtpd/vdoms"<br />
table vusers "/etc/smtpd/vusers"<br />
<br />
listen on eth0 tls pki mx.domain.tld<br />
listen on eth0 port 587 tls-require pki mx.domain.tld auth <creds><br />
<br />
accept from any for domain <vdoms> virtual <vusers> deliver to mbox<br />
accept for any relay<br />
}}<br />
<br />
==== Create tables ====<br />
<br />
* For the domain table file; simply put one domain per line<br />
<br />
{{hc|/etc/smtpd/vdoms|<br />
personaldomain.org<br />
businessname.com<br />
}}<br />
<br />
* For the user table file; list one inbound SMTP email address per line and then map it to an mbox user account name, SMTP email address, or any combination of the two on the right, separated by commas.<br />
<br />
{{hc|/etc/smtpd/vusers|<br />
roger@personaldomain.org roger<br />
newsletters@personaldomain.org roger,roger.rulz@gmail.com<br />
<br />
roger@businessname.com roger<br />
shirley@businessname.com shirley<br />
info@businessname.com roger,shirley<br />
contact@businessname.com info@businessname.com<br />
}}<br />
<br />
* For the creds table file; put the user name in the 1st column and the password hash in the 2nd column<br />
<br />
{{hc|/etc/smtpd/creds|<br />
roger <password hash created using 'smtpctl encrypt' command><br />
shirley <password hash created using 'smtpctl encrypt' command><br />
}}<br />
<br />
=== Test the configuration ===<br />
<br />
# smtpd -n<br />
<br />
If you get a message that says 'configuration OK' - you're ready to [[systemd|rock and roll]]. If not, work on any configuration errors and try again.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Console debugging ===<br />
<br />
If you're having problems with mail delivery, try [[stop]]ping the {{ic|smtpd.service}} and launching the daemon manually with the 'do not daemonize' and 'verbose output' options. Then watch the console for errors.<br />
<br />
# smtpd -dv<br />
<br />
=== Subsystem tracing ===<br />
<br />
Add the {{ic|-T}} flag to get real-time subsystem tracing<br />
<br />
# smtpd -dv -T smtp<br />
<br />
Alternately, use the {{ic|smtpctl trace ''<subsystem>''}} command if the daemon is already running. The trace output will appear in the console output above as well as the journalctl output for the smtpd.service. For example:<br />
<br />
# smtpctl trace expand && smtpctl trace lookup<br />
<br />
...will trace both aliases/virtual/forward expansion and user/credentials lookups<br />
<br />
=== Manual Submission port authentication ===<br />
<br />
* Encode username and password in base64<br />
<br />
# printf 'username\0username\0password' | base64 <br />
<br />
* Connect to submission port using {{ic|openssl s_client}} command<br />
<br />
# openssl s_client -host mx.domain.tld -port 587 -starttls smtp<br />
<br />
* enter {{ic|ehlo myhostname}} followed by {{ic|AUTH PLAIN}}. Paste in the base64 string from step above after {{ic|334}} response.<br />
<br />
250 HELP<br />
ehlo test.domain.tld<br />
250-mx.hostname.tld Hello test.domain.tld [5.5.5.5], pleased to meet you<br />
250-8BITMIME<br />
250-ENHANCEDSTATUSCODES<br />
250-SIZE 36700160<br />
250-DSN<br />
250-AUTH PLAIN LOGIN<br />
250 HELP<br />
AUTH PLAIN<br />
334 <br />
dXNlcm5hbWUAdXNlcm5hbWUAcGFzc3dvcmQ=<br />
235 2.0.0: Authentication succeeded<br />
<br />
=== "Helo command rejected: need fully-qualified hostname" ===<br />
<br />
When sending email, if you get this kind of messages, set your FQDN (domain.tld) in the file {{ic|/etc/smtpd/mailname}}<br />
<br />
=== Resources ===<br />
<br />
There are also several handy web sites that can help you test DNS records, deliverability, and encryption support<br />
* [http://mxtoolbox.com/ MXToolBox]<br />
* [http://ismyemailworking.com/ IsMyEmailWorking.com]<br />
* [http://www.mail-tester.com/ MailTester]<br />
* [https://checktls.com/ TLS tests and tools]<br />
* [https://starttls.info/ STARTTLS.info]<br />
* [https://pingability.com/zoneinfo.jsp Pingability Quick DNS Check]<br />
<br />
== See also==<br />
<br />
* OpenSMTPD pairs well with [[Dovecot]]. Combine the two for a nice minimalist mailserver<br />
* [http://opensmtpd.org/ OpenSMTPD project page]<br />
* [https://coderwall.com/p/eejzja Simple SMTP server with OpenSMTPD]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Systemd-networkd&diff=413276Systemd-networkd2015-12-25T09:58:45Z<p>Reventlov: /* Usage with containers */ Adding a note concerning version >= 220 and forwarding</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Network configuration]]<br />
[[Category:Virtualization]]<br />
[[fr:systemd-networkd]]<br />
[[ja:systemd-networkd]]<br />
[[ru:Systemd-networkd]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd-nspawn}}<br />
{{Related|Network bridge}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related|:Category:Network managers}}<br />
{{Related articles end}}<br />
<br />
''systemd-networkd'' is a system daemon that manages network configurations. It detects and configures network devices as they appear; it can also create virtual network devices. This service can be especially useful to set up complex network configurations for a container managed by [[systemd-nspawn]] or for virtual machines. It also works fine on simple connections.<br />
<br />
== Basic usage ==<br />
The {{Pkg|systemd}} package is part of the default Arch installation and contains all needed files to operate a wired network. Wireless adapters can be setup by other services, such as [[wpa_supplicant]], which are covered later in this article.<br />
<br />
=== Required services and setup ===<br />
<br />
To use ''systemd-networkd'', [[start]] the following two services and [[enable]] them to run on system boot:<br />
<br />
* {{ic|systemd-networkd.service}}<br />
* {{ic|systemd-resolved.service}}<br />
<br />
{{Note|''systemd-resolved'' is actually required only if you are specifying DNS entries in ''.network'' files or if you want to obtain DNS addresses from networkd's DHCP client.}}<br />
<br />
For compatibility with [[resolv.conf]], delete or rename the existing file and create the following symbolic link:<br />
<br />
# ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf<br />
<br />
Optionally, if you wish to use the local DNS stub resolver of ''systemd-resolved'' (and thus use LLMNR and DNS merging per interface), replace {{ic|dns}} with {{ic|resolve}} in {{ic|/etc/nsswitch.conf}}:<br />
<br />
hosts: files '''resolve''' myhostname<br />
<br />
See {{ic|man systemd-resolved}} and {{ic|man resolved.conf}} and [https://github.com/systemd/systemd/blob/master/README#L205 Systemd README].<br />
<br />
{{Note|Systemd's {{ic|resolve}} may not search the local domain when given just the hostname, even when {{ic|1=UseDomains=yes}} or {{ic|1=Domains=[domain-list]}} is present in the appropriate {{ic|.network}} file, and that file produces the expected {{ic|search [domain-list]}} in {{ic|resolv.conf}}. If you run into this problem:<br />
* Switch to using fully-qualified domain names<br />
* Use {{ic|/etc/hosts}} to resolve hostnames<br />
* Fall back to using glibc's {{ic|dns}} instead of using systemd's {{ic|resolve}}}}<br />
<br />
=== Configuration examples ===<br />
All configurations in this section are stored as {{ic|foo.network}} in {{ic|/etc/systemd/network}}. For a full listing of options and processing order, see [[#Configuration files]] and the {{ic|systemd.network}} man page.<br />
<br />
Systemd/udev automatically assigns predictable, stable network interface names for all local Ethernet, WLAN, and WWAN interfaces. Use {{ic|networkctl list}} to list the devices on the system.<br />
<br />
After making changes to a configuration file, reload the networkd daemon.<br />
<br />
# systemctl restart systemd-networkd <br />
<br />
{{Note|In the examples below, '''enp1s0''' is the wired adapter and '''wlp2s0''' is the wireless adapter. These names can be different on different systems.}}<br />
<br />
==== Wired adapter using DHCP ====<br />
{{hc|/etc/systemd/network/''wired''.network|<nowiki><br />
[Match]<br />
Name=enp1s0<br />
<br />
[Network]<br />
DHCP=ipv4</nowiki><br />
}}<br />
<br />
==== Wired adapter using a static IP ====<br />
{{hc|/etc/systemd/network/''wired''.network|<nowiki><br />
[Match]<br />
Name=enp1s0<br />
<br />
[Network]<br />
Address=10.1.10.9/24<br />
Gateway=10.1.10.1</nowiki><br />
}}<br />
<br />
See the {{ic|systemd.network(5)}} man page for more network options such as specifying DNS servers and a broadcast address.<br />
<br />
==== Wireless adapter ====<br />
In order to connect to a wireless network with ''systemd-networkd'', a wireless adapter configured with another service such as [[wpa_supplicant]] is required. In this example, the corresponding systemd service file that needs to be enabled is {{ic|wpa_supplicant@wlp2s0.service}}.<br />
<br />
{{hc|/etc/systemd/network/''wireless''.network|<nowiki><br />
[Match]<br />
Name=wlp2s0<br />
<br />
[Network]<br />
DHCP=ipv4<br />
</nowiki>}}<br />
<br />
If the wireless adapter has a static IP address, the configuration is the same (except for the interface name) as in a [[#Wired adapter using a static IP|wired adapter]].<br />
<br />
==== Wired and wireless adapters on the same machine ====<br />
<br />
This setup will enable a DHCP IP for both a wired and wireless connection making use of the metric directive to allow the kernel the decide on-the-fly which one to use. This way, no connection downtime is observed when the wired connection is unplugged.<br />
<br />
The kernel's route metric (same as configured with ''ip'') decides which route to use for outgoing packets, in cases when several match. This will be the case when both wireless and wired devices on the system have active connections. To break the tie, the kernel uses the metric. If one of the connections is terminated, the other automatically wins without there being a gap with nothing configured (ongoing transfers may still not deal with this nicely but that is at a different OSI layer).<br />
<br />
{{Note|The '''Metric''' option is for static routes while the '''RouteMetric''' option is for setups not using static routes.}}<br />
<br />
{{hc|/etc/systemd/network/''wired''.network|<nowiki><br />
[Match]<br />
Name=enp1s0<br />
<br />
[Network]<br />
DHCP=ipv4<br />
<br />
[DHCP]<br />
RouteMetric=10<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/network/''wireless''.network|<nowiki><br />
[Match]<br />
Name=wlp2s0<br />
<br />
[Network]<br />
DHCP=ipv4<br />
<br />
[DHCP]<br />
RouteMetric=20<br />
</nowiki>}}<br />
<br />
==== IPv6 privacy extensions ====<br />
<br />
If you are using IPv6 you might also want to set the {{ic|IPv6PrivacyExtensions}} option as settings placed in {{ic|/etc/sysctl.d/40-ipv6.conf}} are not honored.<br />
<br />
{{hc|/etc/systemd/network/''wireless''.network|<nowiki><br />
[Match]<br />
Name=wlp2s0<br />
<br />
[Network]<br />
DHCP=yes<br />
IPv6PrivacyExtensions=true<br />
<br />
[DHCP]<br />
RouteMetric=20<br />
</nowiki>}}<br />
<br />
== Configuration files ==<br />
<br />
Configuration files are located in {{ic|/usr/lib/systemd/network}}, the volatile runtime network directory {{ic|/run/systemd/network}} and, the local administration network directory {{ic|/etc/systemd/network}}. Files in {{ic|/etc/systemd/network}} have the highest priority.<br />
<br />
There are three types of configuration files. <br />
<br />
* '''.network''' files. They will apply a network configuration for a ''matching'' device<br />
* '''.netdev''' files. They will create a ''virtual network device'' for a ''matching'' environment<br />
* '''.link''' files. When a network device appears, [[udev]] will look for the first ''matching'' '''.link''' file<br />
<br />
They all follow the same rules: <br />
<br />
* If '''all''' conditions in the {{ic|[Match]}} section are matched, the profile will be activated<br />
* an empty {{ic|[Match]}} section means the profile will apply in any case (can be compared to the {{ic|*}} joker)<br />
* each entry is a key with the {{ic|1=NAME=VALUE}} syntax <br />
* all configuration files are collectively sorted and processed in lexical order, regardless of the directory in which they live<br />
* files with identical name replace each other<br />
<br />
{{Tip|<br />
* to override a system-supplied file in {{ic|/usr/lib/systemd/network}} in a permanent manner (i.e even after upgrade), place a file with same name in {{ic|/etc/systemd/network}} and symlink it to {{ic|/dev/null}}<br />
* the {{ic|*}} joker can be used in {{ic|VALUE}} (e.g {{ic|en*}} will match any Ethernet device)<br />
* following this [https://mailman.archlinux.org/pipermail/arch-general/2014-March/035381.html Arch-general thread], the best practice is to setup specific container network settings ''inside the container'' with '''networkd''' configuration files.<br />
}}<br />
<br />
=== network files ===<br />
<br />
These files are aimed at setting network configuration variables, especially for servers and containers.<br />
<br />
Below is a basic structure of a {{ic|''MyProfile''.network}} file:<br />
<br />
{{hc|/etc/systemd/network/''MyProfile''.network|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Network]<br />
''a vertical list of keys''<br />
<br />
[Address]<br />
''a vertical list of keys''<br />
<br />
[Route]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} the device name (e.g Br0, enp4s0)<br />
* {{ic|1=Host=}} the machine hostname<br />
* {{ic|1=Virtualization=}} check whether the system is executed in a virtualized environment or not. A {{ic|1=Virtualization=no}} key will only apply on your host machine, while {{ic|1=Virtualization=yes}} apply to any container or VM.<br />
<br />
==== [Network] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=DHCP=}} enables [[Wikipedia:Dynamic Host Configuration Protocol|DHCPv4]] and/or DHCPv6 support. Accepts {{ic|yes}}, {{ic|no}}, {{ic|ipv4}} or {{ic|ipv6}}<br />
* {{ic|1=DNS=}} is a [[Wikipedia:Domain Name System|DNS]] server address. You can specify this option more than once<br />
* {{ic|1=Bridge=}} is the name of the bridge to add the link to<br />
* {{ic|1=IPForward=}} enables IP forwarding, performing the forwarding according to the routing table, and is required for setting up [[Internet sharing]]. Accepts {{ic|yes}}, {{ic|no}}, {{ic|ipv4}}, {{ic|ipv6}} or {{ic|kernel}}. Note that {{ic|1=IPForward}} defaults to 0, which means that if you do not specify a setting for {{ic|1=IPForward}} in your .network file, your interface will have IP forwarding turned off even if you turned it on with {{ic|sysctl}} or by writing into {{ic|/proc/sys}}.<br />
<br />
==== [Address] section ====<br />
Most common key in the {{ic|[Address]}} section is:<br />
<br />
* {{ic|1=Address=}} is a static '''IPv4''' or '''IPv6''' address and its prefix length, separated by a {{ic|/}} character (e.g {{ic|192.168.1.90/24}}). This option is '''mandatory''' unless DHCP is used.<br />
<br />
==== [Route] section ====<br />
Most common key in the {{ic|[Route]}} section is:<br />
<br />
* {{ic|1=Gateway=}} is the address of your machine gateway. This option is '''mandatory''' unless DHCP is used.<br />
For an exhaustive key list, please refer to {{ic|systemd.network(5)}}<br />
<br />
{{Tip|you can put the {{ic|1=Address=}} and {{ic|1=Gateway=}} keys in the {{ic|[Network]}} section as a short-hand if {{ic|1=Address=}} contains only an Address key and {{ic|1=Gateway=}} section contains only a Gateway key<br />
}}<br />
<br />
=== netdev files ===<br />
<br />
These files will create virtual network devices.<br />
<br />
Below is a basic structure of a ''Mydevice''.netdev file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.netdev|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Netdev]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=Host=}} and {{ic|1=Virtualization=}}<br />
<br />
==== [Netdev] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} is the interface name used when creating the netdev. This option is '''compulsory'''<br />
* {{ic|1=Kind=}} is the netdev kind. For example, ''bridge'', ''bond'', ''vlan'', ''veth'', ''sit'', etc. are supported. This option is '''compulsory'''<br />
<br />
For an exhaustive key list, please refer to {{ic|systemd.netdev(5)}}<br />
<br />
=== link files ===<br />
<br />
These files are an alternative to custom udev rules and will be applied by [[udev]] as the device appears.<br />
<br />
Below is a basic structure of a ''Mydevice''.link file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.link|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Link]<br />
''a vertical list of keys''<br />
}}<br />
<br />
The {{ic|[Match]}} section will determine if a given link file may be applied to a given device, when the {{ic|[Link]}} section specifies the device configuration.<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=MACAddress=}}, {{ic|1=Host=}} and {{ic|1=Virtualization=}}.<br />
<br />
{{ic|1=Type=}} is the device type (e.g. vlan)<br />
<br />
==== [Link] section ====<br />
<br />
Most common keys are:<br />
<br />
{{ic|1=MACAddressPolicy=}} is either ''persistent'' when the hardware has a persistent MAC address (as most hardware should) or ''random'' , which allows to give a random MAC address when the device appears.<br />
<br />
{{ic|1=MACAddress=}} shall be used when no {{ic|1=MACAddressPolicy=}} is specified.<br />
<br />
{{Note|the system {{ic|/usr/lib/systemd/network/99-default.link}} is generally sufficient for most of the basic cases.}}<br />
<br />
== Usage with containers ==<br />
<br />
The service is available with {{Pkg|systemd}} >= 210. You will want to [[systemd#Basic systemctl usage|enable and start]] the {{ic|systemd-networkd.service}} on the host and container.<br />
<br />
For debugging purposes, it is strongly advised to [[install]] the {{Pkg|bridge-utils}}, {{Pkg|net-tools}} and {{Pkg|iproute2}} packages.<br />
<br />
If you are using ''systemd-nspawn'', you may need to modify the {{ic|systemd-nspawn@.service}} and append boot options to the {{ic|ExecStart}} line. Please refer to {{ic|man 1 systemd-nspawn}} for an exhaustive list of options.<br />
<br />
Note that if you want to take advantage of automatic DNS configuration from DHCP, you need to enable {{ic|systemd-resolved}} and symlink {{ic|/run/systemd/resolve/resolv.conf}} to {{ic|/etc/resolv.conf}}. See {{ic|systemd-resolved.service(8)}} for more details.<br />
<br />
{{Style|Too many points for a tip, some of them are very similar so they could be merged.}}<br />
<br />
{{Tip|1=Before you start to configure your container network, it is useful to:<br />
* disable all your [[netctl]] services. This will avoid any potential conflicts with '''systemd-networkd''' and make all your configurations easier to test. Furthermore, odds are high you will end with few or even no [[netctl]] activated profiles. The {{ic|netctl list}} command will output a list of all your profiles, with the activated one being starred.<br />
* disable the {{ic|systemd-nspawn@.service}} and use the {{ic|systemd-nspawn -bnD /path_to/your_container/}} command as root to boot the container. To log off and shutdown inside the container {{ic|systemctl poweroff}} is used as root. Once the network setting meets your requirements, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-nspawn@.service}}<br />
* disable the {{ic|dhcpcd.service}} if enabled on your system, since it activates ''dhcpcd'' on '''all''' interfaces<br />
* make sure you have no [[netctl]] profiles activated in the container, and ensure that {{ic|systemd-networkd.service}} is neither enabled nor started<br />
* make sure you do not have any [[iptables]] rules which can block traffic<br />
* make sure ''packet forwarding'' is [[Internet sharing#Enable packet forwarding|enabled]] if you want to let containers access the internet. Make sure that your .network file does not accidentally turn off forwarding because if you do not have a IPForward=1 setting in it, systemd-networkd will turn off forwarding on this interface, even if you have it enabled globally.<br />
* when the daemon is started the systemd {{ic|networkctl}} command displays the status of network interfaces.<br />
}}<br />
<br />
{{Note|For the set-up described below, <br />
* we will limit the output of the {{ic|ip a}} command to the concerned interfaces<br />
* we assume the ''host'' is your main OS you are booting to and the ''container'' is your guest virtual machine<br />
* all interface names and IP addresses are only examples<br />
}}<br />
<br />
{{Note|[[systemd-networkd]] introduced new forwarding semantics in version 220/221.[https://github.com/systemd/systemd/blob/a2088fd025deb90839c909829e27eece40f7fce4/NEWS] It '''overrides''' {{ic|net.*.ip_forward}} settings, turning forwarding off by default. To have it respect above settings it is required to set {{ic|1=IPForward=kernel}} in systemd-networkd's interface configuration file (see {{ic|man 5 systemd.network}} for more information).}}<br />
<br />
=== Basic DHCP network ===<br />
<br />
This setup will enable a DHCP IP for host and container. In this case, both systems will share the same IP as they share the same interfaces.<br />
<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
DHCP=ipv4<br />
</nowiki>}}<br />
<br />
Then, [[enable]] and start {{ic|systemd-networkd.service}} on your container.<br />
<br />
You can of course replace {{ic|en*}} by the full name of your ethernet device given by the output of the {{ic|ip link}} command.<br />
<br />
* on host and container:<br />
<br />
{{hc|$ ip a|<br />
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.72/24 brd 192.168.1.255 scope global enp7s0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
By default hostname received from the DHCP server will be used as the transient hostname.<br />
<br />
To change it add {{ic|1=UseHostname=false}} in section {{ic|[DHCPv4]}}<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[DHCPv4]<br />
UseHostname=false<br />
</nowiki>}}<br />
<br />
If you did not want configure a DNS in {{ic|/etc/resolv.conf}} and want to rely on DHCP for setting it up, you need to [[enable]] {{ic|systemd-resolved.service}} and symlink {{ic|/run/systemd/resolve/resolv.conf}} to {{ic|/etc/resolv.conf}}<br />
<br />
# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf<br />
<br />
See {{ic|systemd-resolved.service(8)}} for more details.<br />
<br />
=== DHCP with two distinct IP ===<br />
<br />
==== Bridge interface ====<br />
<br />
Create a virtual bridge interface <br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.netdev|<nowiki><br />
[NetDev]<br />
Name=br0<br />
Kind=bridge<br />
</nowiki>}}<br />
<br />
On host and container:<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default <br />
link/ether ae:bd:35:ea:0c:c9 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Note that the interface br0 is listed but is DOWN.<br />
<br />
==== Bind ethernet to bridge ====<br />
<br />
Modify the {{ic|/etc/systemd/network/''MyDhcp''.network}} to remove the DHCP, as the bridge requires an interface to bind to with no IP, and add a key to bind this device to br0. Let us change its name to a more relevant one.<br />
<br />
{{hc|/etc/systemd/network/''MyEth''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
Bridge=br0<br />
</nowiki>}}<br />
<br />
==== Bridge network ====<br />
<br />
Create a network profile for the Bridge<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DHCP=ipv4<br />
</nowiki>}}<br />
<br />
==== Add option to boot the container ====<br />
<br />
As we want to give a separate IP for host and container, we need to ''Disconnect'' networking of the container from the host. To do this, add this option {{ic|1=--network-bridge=br0}} to your container boot command.<br />
<br />
# systemd-nspawn --network-bridge&#61;br0 -bD /path_to/my_container<br />
<br />
==== Result ====<br />
<br />
* on host<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default <br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.87/24 brd 192.168.1.255 scope global br0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
6: vb-''MyContainer'': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000<br />
link/ether d2:7c:97:97:37:25 brd ff:ff:ff:ff:ff:ff<br />
inet6 fe80::d07c:97ff:fe97:3725/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip a|<br />
2: host0: <BROADCAST,MULTICAST,ALLMULTI,AUTOMEDIA,NOTRAILERS,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 5e:96:85:83:a8:5d brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.73/24 brd 192.168.1.255 scope global host0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::5c96:85ff:fe83:a85d/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
==== Notice ====<br />
<br />
* we have now one IP address for Br0 on the host, and one for host0 in the container<br />
* two new interfaces have appeared: {{ic|vb-''MyContainer''}} in the host and {{ic|host0}} in the container. This comes as a result of the {{ic|1=--network-bridge=br0}} option. This option ''implies'' another option, {{ic|--network-veth}}. This means a ''virtual Ethernet link'' has been created between host and container.<br />
* the DHCP address on {{ic|host0}} comes from the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file.<br />
* on host<br />
<br />
{{hc|$ brctl show|<br />
bridge name bridge id STP enabled interfaces<br />
br0 8000.14dae9b57a88 no enp7s0<br />
vb-''MyContainer''<br />
}}<br />
<br />
the above command output confirms we have a bridge with two interfaces binded to.<br />
<br />
* on host<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev br0 <br />
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.87<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev host0 <br />
192.168.1.0/24 dev host0 proto kernel scope link src 192.168.1.73<br />
}}<br />
<br />
the above command outputs confirm we have activated {{ic|br0}} and {{ic|host0}} interfaces with an IP address and Gateway 192.168.1.254. The gateway address has been automatically grabbed by ''systemd-networkd''<br />
<br />
{{hc|$ cat /run/systemd/resolve/resolv.conf|<br />
nameserver 192.168.1.254<br />
}}<br />
<br />
=== Static IP network ===<br />
<br />
Setting a static IP for each device can be helpful in case of deployed web services (e.g FTP, http, SSH). Each device will keep the same MAC address across reboots if your system {{ic|/usr/lib/systemd/network/99-default.link}} file has the {{ic|1=MACAddressPolicy=persistent}} option (it has by default). Thus, you will easily route any service on your Gateway to the desired device.<br />
First, we shall get rid of the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file. To do it in a permanent way (e.g even after upgrades), do the following on container. This will mask the file {{ic|/usr/lib/systemd/network/80-container-host0.network}} since files of the same name in {{ic|/etc/systemd/network}} take priority over {{ic|/usr/lib/systemd/network}}.<br />
<br />
# ln -sf /dev/null /etc/systemd/network/80-container-host0.network<br />
<br />
Then, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-networkd}} on your container.<br />
<br />
The needed configuration files:<br />
* on host <br />
{{Accuracy|In the listing of configuration files, /etc/systemd/network/MyBridge.netdev has the .netdev extension. But, the MyBridge.network example file has the .network extension.}}<br />
<br />
/etc/systemd/network/''MyBridge''.netdev<br />
/etc/systemd/network/''MyEth''.network<br />
<br />
A modified ''MyBridge''.network<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.87/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
* on container<br />
<br />
{{hc|/etc/systemd/network/''MyVeth''.network|<nowiki><br />
[Match]<br />
Name=host0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.94/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [http://www.freedesktop.org/software/systemd/man/systemd-networkd.service.html systemd.networkd man page]<br />
* [https://plus.google.com/u/0/+TomGundersen/posts Tom Gundersen, main systemd-networkd developer, G+ home page]<br />
* [https://coreos.com/blog/intro-to-systemd-networkd/ Tom Gundersen posts on Core OS blog]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=1393759#p1393759 How to set up systemd-networkd with wpa_supplicant] (WonderWoofy's walkthrough on Arch forums)</div>Reventlovhttps://wiki.archlinux.org/index.php?title=PKGBUILD&diff=354137PKGBUILD2014-12-29T11:15:36Z<p>Reventlov: /* arch */ typo</p>
<hr />
<div>[[Category:Package development]]<br />
[[cs:PKGBUILD]]<br />
[[da:PKGBUILD]]<br />
[[el:PKGBUILD]]<br />
[[es:PKGBUILD]]<br />
[[fa:PKGBUILD]]<br />
[[fr:PKGBUILD]]<br />
[[it:PKGBUILD]]<br />
[[ja:PKGBUILD]]<br />
[[pl:PKGBUILD]]<br />
[[pt:PKGBUILD]]<br />
[[ru:PKGBUILD]]<br />
[[sr:PKGBUILD]]<br />
[[zh-CN:PKGBUILD]]<br />
[[zh-TW:PKGBUILD]]<br />
{{Related articles start}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch Build System}}<br />
{{Related|Creating packages}}<br />
{{Related|:Category:Package development}}<br />
{{Related|Pacman tips}}<br />
{{Related|Arch User Repository}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
A '''PKGBUILD''' is an [[Arch Linux]] package build description file (actually, it is a shell script) used when [[Creating packages|creating packages]].<br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and information stored in PKGBUILDs. When ''makepkg'' is run, it searches for a {{Ic|PKGBUILD}} in the current directory and follows the instructions therein to either compile or otherwise acquire the files to build a package file ({{ic|''pkgname''.pkg.tar.xz}}). The resulting package contains binary files and installation instructions, readily installed with [[pacman]].<br />
<br />
This article discusses the variables used in PKGBUILDs. For information on the PKGBUILD functions, refer to [[Creating packages#PKGBUILD functions]].<br />
<br />
== Variables ==<br />
The following are variables that can be filled out in the PKGBUILD file. {{ic|pkgname}}, {{ic|pkgver}}, {{ic|pkgrel}}, and {{ic|arch}} are all mandatory. {{ic|license}} is not strictly necessary to build a package, but it is recommended for any PKGBUILDs you might want to share with others. {{ic|makepkg}} produces warnings if it isn't present.<br />
<br />
It is common practice to define the variables in the PKGBUILD in same order as given here. However, this is not mandatory, as long as correct [[Bash]] syntax is used.<br />
<br />
=== pkgname ===<br />
The name of the package. It should consist of alphanumeric and any of the following characters: {{ic|@}}, {{ic|.}}, {{ic|_}}, {{ic|+}}, {{ic|-}} (at symbol, dot, underscore, plus, hyphen). All letters should be lowercase and names are not allowed to start with hyphens. For the sake of consistency, {{ic|pkgname}} should match the name of the source tarball of the software you are packaging. For instance, if the software is in {{ic|foobar-2.5.tar.gz}}, the {{ic|pkgname}} value should be {{ic|foobar}}. The present working directory the PKGBUILD file is in should also match the {{ic|pkgname}}.<br />
<br />
=== pkgver ===<br />
The version of the package. The value should be the same as the version released by the author of the package. It can contain letters, numbers, periods and underscore but CANNOT contain a hyphen. If the author of the package uses a hyphen in their version numbering scheme, replace it with an underscore. For instance, if the version is {{ic|0.99-10}}, it should be changed to {{ic|0.99_10}}. If the {{ic|pkgver}} variable is used later in the PKGBUILD then the underscore can easily be substituted for a hyphen on usage e.g.:<br />
source=("$pkgname-${pkgver//_/-}.tar.gz")<br />
<br />
{{Warning|If upstream uses a timestamp versioning such as {{ic|05102014}}, ensure to use the reversed date, i.e. {{ic|20141005}} ([[Wikipedia:ISO 8601|ISO 8601]] format). Otherwise it will not appear as a newer version.}}<br />
<br />
=== pkgrel ===<br />
The release number of the package specific to Arch Linux. This value allows users to differentiate between consecutive builds of the same version of a package. When a new package version is first released, the '''release number starts at 1'''. As fixes and optimizations are made to the {{ic|PKGBUILD}} file, the package will be '''re-released''' and the '''release number''' will increment by 1. When a new version of the package comes out, the release number resets to 1.<br />
<br />
=== pkgdir ===<br />
This variable reflects the root directory of what will be put into the package. It is commonly used in {{ic|1=make DESTDIR="$pkgdir" install}}. This variable should not be modified from any of the PKGBUILD functions ({{ic|prepare()}}, {{ic|build()}}, {{ic|check()}}, etc.).<br />
<br />
=== epoch ===<br />
Used to force the package to be seen as newer than any previous versions with a lower epoch, even if the version number would normally not trigger such an upgrade. This value is required to be a positive integer; the default value if left unspecified is 0. This is useful when the version numbering scheme of a package changes (or is alphanumeric), breaking normal version comparison logic. See {{ic|pacman(8)}} [[man page]] for more information on version comparisons.<br />
{{Warning|Do not use epoch unless you are fully aware of the implications of doing so.}}<br />
<br />
=== pkgbase ===<br />
An optional global directive is available when building a split package, pkgbase is used to refer to the group of packages in the output of makepkg and in the naming of source-only tarballs. If not specified, the first element in the pkgname array is used. All options and directives for the split packages default to the global values given in the PKGBUILD. Nevertheless, the following ones can be overridden within each split package's packaging function: pkgver, pkgrel, epoch, pkgdesc, arch, url, license, groups, depends, optdepends, provides, conflicts, replaces, backup, options, install and changelog. The variable is not allowed to begin with a hyphen.<br />
<br />
=== pkgdesc ===<br />
The description of the package. The description should be about 80 characters or less and should not include the package name in a self-referencing way. For example, "Nedit is a text editor for X11" should instead be written as "A text editor for X11".<br />
<br />
{{Note|Do not follow this rule thoughtlessly when submitting packages to the [[AUR]]. If the package name differs from the application name for some reason, inclusion of the full application name in the description can be the only way to ensure that the package can be found via search.}}<br />
<br />
=== arch ===<br />
An array of architectures that the {{ic|PKGBUILD}} file is known to build and work on. Currently, it should contain {{ic|i686}} and/or {{ic|x86_64}}, {{ic|1=arch=('i686' 'x86_64')}}. The value {{ic|any}} can also be used for architecture-independent packages.<br />
<br />
You can access the target architecture with the variable {{ic|$CARCH}} during a build, and even when defining variables. See also {{bug|16352}}. Example:<br />
<br />
depends=('foobar')<br />
if test "$CARCH" == x86_64; then<br />
depends+=('lib32-glibc')<br />
fi<br />
<br />
<br />
{{Note|With pacman 4.2, specific variables like depends_x86_64 or source_x86_64 can be used to achieve the same result.}}<br />
<br />
=== url ===<br />
The URL of the official site of the software being packaged.<br />
<br />
=== license ===<br />
The license under which the software is distributed. The {{pkg|licenses}} package from the [[official repositories]] contains many commonly used licenses, which are installed to {{ic|/usr/share/licenses/common}}. If a package is licensed under one of these licenses, the value should be set to the directory name, e.g. {{ic|1=license=('GPL')}}. If the appropriate license is not included in the official {{Pkg|licenses}} package, several things must be done:<br />
<br />
# The license file(s) should be included in: {{ic|/usr/share/licenses/''pkgname''/}}, e.g. {{ic|/usr/share/licenses/foobar/LICENSE}}.<br />
# If the source tarball does NOT contain the license details and the license is only displayed elsewhere, e.g. a website, then you need to copy the license to a file and include it.<br />
# Add {{ic|custom}} to the {{ic|license}} array. Optionally, you can replace {{ic|custom}} with {{ic|custom:name of license}}. Once a license is used in two or more packages in an official repository (including {{ic|[community]}}), it becomes a part of the {{Pkg|licenses}} package.<br />
* The [[Wikipedia:BSD License|BSD]], [[Wikipedia:MIT License|MIT]], [[Wikipedia:ZLIB license|zlib/png]] and [[Wikipedia:Python License|Python]] licenses are special cases and could not be included in the {{pkg|licenses}} package. For the sake of the {{ic|license}} array, it is treated as a common license ({{ic|1=license=('BSD')}}, {{ic|1=license=('MIT')}}, {{ic|1=license=('ZLIB')}} and {{ic|1=license=('Python')}}) but technically each one is a custom license because each one has its own copyright line. Any packages licensed under these four should have its own unique license stored in {{ic|/usr/share/licenses/''pkgname''}}. Some packages may not be covered by a single license. In these cases, multiple entries may be made in the license array, e.g. {{ic|1=license=('GPL' 'custom:name of license')}}.<br />
* Additionally, the (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:<br />
** (L)GPL — (L)GPLv2 or any later version<br />
** (L)GPL2 — (L)GPL2 only<br />
** (L)GPL3 — (L)GPL3 or any later version<br />
* If after researching the issue no license can be determined, {{ic|PKGBUILD.proto}} suggests using {{ic|unknown}}. However, upstream should be contacted about the conditions under which the software is (and is not) available.<br />
<br />
{{Tip|Some software authors do not provide separate license file and describe distribution rules in section of common ReadMe.txt. This information can be extracted in separate file during {{Ic|build}} phase with something like this: {{Ic|sed -n '/'''This software'''/,/''' thereof.'''/p' ReadMe.txt > LICENSE}}.}}<br />
<br />
=== groups ===<br />
The group the package belongs in. For instance, when you install the {{Grp|kdebase}} package, it installs all packages that belong in the {{Grp|kde}} group.<br />
<br />
=== depends ===<br />
An array of package names that must be installed before this software can be run. Version restrictions can be specified with comparison operators, e.g. {{ic|1=depends=('foobar>=1.8.0')}}; if multiple restrictions are needed, the dependency can be repeated for each of them [https://mailman.archlinux.org/pipermail/arch-general/2012-July/029022.html], e.g. {{ic|1=depends=('foobar>=1.8.0' 'foobar<2.0.0')}}. <br />
<br />
It is not necessary to specify the version of the packages required. You do not need to list packages that your software depends on if other packages your software depends on already have those packages listed in their dependency. For instance, {{pkg|gtk2}} depends on {{pkg|glib2}} and {{pkg|glibc}}. However, {{pkg|glibc}} does not need to be listed as a dependency for {{pkg|gtk2}} because it is a dependency for {{pkg|glib2}}.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=depends_x86_64=()}}.<br />
<br />
=== optdepends ===<br />
An array of package names that are not needed for the software to function but provides additional features. A short description of the extra functionality each optdepend provides for the package should also be noted.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=optdepends_x86_64=()}}.<br />
<br />
An {{ic|optdepends}} may look like this:<br />
optdepends=(<br />
'cups: printing support'<br />
'sane: scanners support'<br />
'libgphoto2: digital cameras support'<br />
'alsa-lib: sound support'<br />
'giflib: GIF images support'<br />
'libjpeg: JPEG images support'<br />
'libpng: PNG images support'<br />
)<br />
<br />
=== makedepends ===<br />
An array of package names that must be installed to build the software but unnecessary for using the software after installation. You can specify the minimum version dependency of the packages in the same format as the {{ic|depends}} array.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=makedepends_x86_64=()}}.<br />
<br />
{{Note|Specifying packages that are already in {{ic|depends}} is not necessary.}}<br />
{{Warning|The group {{Grp|base-devel}} is assumed to be already installed when building with makepkg. Members of "base-devel" '''should not''' be included in {{ic|makedepends}} arrays.}}<br />
<br />
=== checkdepends ===<br />
An array of packages this package depends on to run its test suite but are not needed at runtime. Packages in this list follow the same format as depends. These dependencies are only considered when the [[Creating packages#check()|check()]] function is present and is to be run by makepkg.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=checkdepends_x86_64=()}}.<br />
<br />
{{Warning|The group {{Grp|base-devel}} is assumed to be already installed when building with makepkg. Members of "base-devel" '''should not''' be included in {{ic|checkdepends}} arrays.}}<br />
<br />
=== provides ===<br />
An array of package names that this package provides the features of (or a virtual package such as {{Ic|cron}} or {{Ic|sh}}). Packages that provide the same things can be installed at the same time unless conflict with each other (see below). <br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=provides_x86_64=()}}.<br />
<br />
{{Warning|If you use this variable, you should add the version ({{ic|pkgver}} and perhaps the {{ic|pkgrel}}) that this package will provide if dependencies may be affected by it. For instance, if you are providing a modified ''qt'' package named ''qt-foobar'' version 3.3.8 which provides ''qt'' then the {{ic|provides}} array should look like {{ic|1=provides=('qt=3.3.8')}}. Putting {{ic|1=provides=('qt')}} will cause to fail those dependencies that require a specific version of ''qt''. Do not add {{ic|pkgname}} to your {{ic|provides}} array; this is done automatically.}}<br />
<br />
=== conflicts ===<br />
An array of package names that may cause problems with this package if installed. A package with this name and all packages which {{Ic|provides}} virtual packages with this name will be removed. You can also specify the version properties of the conflicting packages in the same format as the {{ic|depends}} array.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=conflicts_x86_64=()}}.<br />
<br />
=== replaces ===<br />
An array of obsolete package names that are replaced by this package, e.g. {{ic|1=replaces=('wireshark')}} for the {{pkg|wireshark-gtk}} package. After syncing with {{ic|pacman -Sy}}, it will immediately replace an installed package upon encountering another package with the matching {{ic|replaces}} in the repositories. If you are providing an alternate version of an already existing package, use the {{ic|conflicts}} variable which is only evaluated when actually installing the conflicting package.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=replaces_x86_64=()}}.<br />
<br />
=== backup ===<br />
An array of files that can contain user-made changes and should be preserved during upgrade or removal of a package, primarily intended for configuration files in {{ic|/etc}}.<br />
<br />
When updating, new version may be saved as {{ic|file.pacnew}} to avoid overwriting a file which already exists and was previously modified by the user. Similarly, when the package is removed, user-modified file will be preserved as {{ic|file.pacsave}} unless the package was removed with {{ic|pacman -Rn}} command. <br />
<br />
The file paths in this array should be relative paths (e.g. {{ic|etc/pacman.conf}}) not absolute paths (e.g. {{ic|/etc/pacman.conf}}). See also [[Pacnew and Pacsave files]].<br />
<br />
=== options ===<br />
This array allows you to override some of the default behavior of {{ic|makepkg}}, defined in {{Ic|/etc/makepkg.conf}}. To set an option, include the option name in the array. To reverse the default behavior, place an '''{{ic|!}}''' at the front of the option.<br />
<br />
The full list of the available options can be found in {{ic|man PKGBUILD}}.<br />
<br />
=== install ===<br />
The name of the ''.install'' script to be included in the package. pacman has the ability to store and execute a package-specific script when it installs, removes or upgrades a package. The script contains the following functions which run at different times:<br />
<br />
* {{ic|pre_install}} — The script is run right before files are extracted. One argument is passed: new package version.<br />
* {{ic|post_install}} — The script is run right after files are extracted. One argument is passed: new package version.<br />
* {{ic|pre_upgrade}} — The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|post_upgrade}} — The script is run right after files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|pre_remove}} — The script is run right before files are removed. One argument is passed: old package version.<br />
* {{ic|post_remove}} — The script is run right after files are removed. One argument is passed: old package version.<br />
<br />
Each function is run [[chroot]]ed inside the pacman install directory. See [https://bbs.archlinux.org/viewtopic.php?pid=913891 this thread].<br />
<br />
{{Tip|A prototype ''.install'' is provided at {{ic|/usr/share/pacman/proto.install}}. For a web-based prototype, refer to [https://projects.archlinux.org/pacman.git/plain/proto/proto.install pacman's gitweb page].}}<br />
<br />
=== changelog ===<br />
The name of the package changelog. To view changelogs for installed packages (that have this file):<br />
pacman -Qc ''pkgname''<br />
<br />
{{Tip|A prototype changelog file is provided at {{ic|/usr/share/pacman/ChangeLog.proto}}.}}<br />
<br />
=== source ===<br />
An array of files which are needed to build the package. It must contain the location of the software source, which in most cases is a full HTTP or FTP URL. The previously set variables {{ic|pkgname}} and {{ic|pkgver}} can be used effectively here (e.g. {{ic|<nowiki>source=("https://example.com/$pkgname-$pkgver.tar.gz")</nowiki>}}).<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=source_x86_64=()}}. There must be a corresponding integrity array with checksums, e.g. {{ic|1=md5sums_x86_64=()}}.<br />
<br />
{{Note|If you need to supply files which are not downloadable on the fly, e.g. self-made patches, you simply put those into the same directory where your {{ic|PKGBUILD}} file is in and add the file name to this array. Any paths you add here are resolved relative to the directory where the {{ic|PKGBUILD}} lies. Before the actual build process is started, all of the files referenced in this array will be downloaded or checked for existence, and {{ic|makepkg}} will not proceed if any are missing.}}<br />
<br />
{{Tip|You can specify a different name for the downloaded file — if the downloaded file has a different name for some reason, like the URL had a GET parameter — using the following syntax: {{Ic|''filename''::''fileuri''}}<br />
For example:<br />
{{bc|1=source=("project_name::<nowiki>hg+https://googlefontdirectory.googlecode.com/hg/</nowiki>")}}}}<br />
<br />
=== noextract ===<br />
An array of files listed under the {{ic|source}} array which should not be extracted from their archive format by {{ic|makepkg}}. This most commonly applies to archives which cannot be handled by {{ic|/usr/bin/bsdtar}} because {{Pkg|libarchive}} processes all files as streams rather than random access as {{Pkg|unzip}} does. In these situations, the alternative unarchiving tool (e.g., {{ic|unzip}}, {{ic|p7zip}}, etc.) should be added in the {{ic|makedepends}} array and the first line of the [[Creating packages#prepare()|prepare()]] function should extract the source archive manually; for example:<br />
<br />
unzip [source].zip<br />
<br />
Note that while the {{ic|source}} array accepts URLs, {{ic|noextract}} is '''just''' the file name portion. So, for example, you would do something like this (simplified from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/grub grub2's PKGBUILD]):<br />
<br />
source=(<nowiki>"http://ftp.archlinux.org/other/grub2/grub2_extras_lua_r20.tar.xz"</nowiki>)<br />
noextract=('grub2_extras_lua_r20.tar.xz')<br />
<br />
To extract ''nothing'', you can do something fancy like this (taken from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/firefox-i18n#n123 firefox-i18n]):<br />
<br />
noextract=("${source[@]%%::*}")<br />
<br />
{{Note|More conservative Bash substitution would possibly include a loop that calls {{ic|basename}}. If you have read this far, you should get the idea.}}<br />
<br />
=== md5sums ===<br />
An array of MD5 checksums of the files listed in the {{ic|source}} array. Once all files in the {{ic|source}} array are available, an MD5 hash of each file will be automatically generated and compared with the values of this array in the same order they appear in the {{ic|source}} array. While the order of the source files itself does not matter, it is important that it matches the order of this array because {{ic|makepkg}} cannot guess which checksum belongs to what source file. You can generate this array quickly and easily using the command {{ic|updpkgsums}} in the directory that contains the {{ic|PKGBUILD}} file.<br />
{{Note|The MD5 algorithm is known to have weaknesses; you should consider using a stronger alternative from the SHA-2 family of hash algorithms, such as SHA-256.}}<br />
<br />
=== sha1sums ===<br />
An array of 160-bit SHA-1 checksums. This is an alternative to {{ic|md5sums}} described above. To enable use and generation of these checksums, set up the {{ic|INTEGRITY_CHECK}} option in {{ic|/etc/makepkg.conf}}. See {{ic|man makepkg.conf}}.<br />
{{Note|The SHA-1 algorithm is known to have weaknesses; you should consider using a stronger alternative from the SHA-2 family of hash algorithms, such as SHA-256.}}<br />
<br />
=== sha256sums, sha384sums, sha512sums ===<br />
An array of SHA-2 checksums with digest sizes 256, 384, and 512 bits, respectively. These are alternatives to {{ic|md5sums}} and {{ic|sha1sums}} described above and have fewer known weaknesses. To enable use and generation of these checksums, set up the {{ic|INTEGRITY_CHECK}} option in {{ic|/etc/makepkg.conf}}. See {{ic|man makepkg.conf}}.<br />
<br />
=== validpgpkeys ===<br />
An array of PGP fingerprints. If this array is non-empty, makepkg will only accept signatures from the keys listed here and will ignore the trust values from the keyring. If the source file was signed with a subkey, makepkg will still use the primary key for comparison.<br />
<br />
Only full fingerprints are accepted. They must be uppercase and must not contain whitespace characters.<br />
<br />
== See also ==<br />
*[https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5) Manual Page]<br />
*[http://ix.io/66p Example PKGBUILD file]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=PKGBUILD&diff=354136PKGBUILD2014-12-29T11:13:54Z<p>Reventlov: /* arch */ Mentioning the architecture specific variables</p>
<hr />
<div>[[Category:Package development]]<br />
[[cs:PKGBUILD]]<br />
[[da:PKGBUILD]]<br />
[[el:PKGBUILD]]<br />
[[es:PKGBUILD]]<br />
[[fa:PKGBUILD]]<br />
[[fr:PKGBUILD]]<br />
[[it:PKGBUILD]]<br />
[[ja:PKGBUILD]]<br />
[[pl:PKGBUILD]]<br />
[[pt:PKGBUILD]]<br />
[[ru:PKGBUILD]]<br />
[[sr:PKGBUILD]]<br />
[[zh-CN:PKGBUILD]]<br />
[[zh-TW:PKGBUILD]]<br />
{{Related articles start}}<br />
{{Related|Arch packaging standards}}<br />
{{Related|Arch Build System}}<br />
{{Related|Creating packages}}<br />
{{Related|:Category:Package development}}<br />
{{Related|Pacman tips}}<br />
{{Related|Arch User Repository}}<br />
{{Related|makepkg}}<br />
{{Related|pacman}}<br />
{{Related articles end}}<br />
<br />
A '''PKGBUILD''' is an [[Arch Linux]] package build description file (actually, it is a shell script) used when [[Creating packages|creating packages]].<br />
<br />
Packages in Arch Linux are built using the [[makepkg]] utility and information stored in PKGBUILDs. When ''makepkg'' is run, it searches for a {{Ic|PKGBUILD}} in the current directory and follows the instructions therein to either compile or otherwise acquire the files to build a package file ({{ic|''pkgname''.pkg.tar.xz}}). The resulting package contains binary files and installation instructions, readily installed with [[pacman]].<br />
<br />
This article discusses the variables used in PKGBUILDs. For information on the PKGBUILD functions, refer to [[Creating packages#PKGBUILD functions]].<br />
<br />
== Variables ==<br />
The following are variables that can be filled out in the PKGBUILD file. {{ic|pkgname}}, {{ic|pkgver}}, {{ic|pkgrel}}, and {{ic|arch}} are all mandatory. {{ic|license}} is not strictly necessary to build a package, but it is recommended for any PKGBUILDs you might want to share with others. {{ic|makepkg}} produces warnings if it isn't present.<br />
<br />
It is common practice to define the variables in the PKGBUILD in same order as given here. However, this is not mandatory, as long as correct [[Bash]] syntax is used.<br />
<br />
=== pkgname ===<br />
The name of the package. It should consist of alphanumeric and any of the following characters: {{ic|@}}, {{ic|.}}, {{ic|_}}, {{ic|+}}, {{ic|-}} (at symbol, dot, underscore, plus, hyphen). All letters should be lowercase and names are not allowed to start with hyphens. For the sake of consistency, {{ic|pkgname}} should match the name of the source tarball of the software you are packaging. For instance, if the software is in {{ic|foobar-2.5.tar.gz}}, the {{ic|pkgname}} value should be {{ic|foobar}}. The present working directory the PKGBUILD file is in should also match the {{ic|pkgname}}.<br />
<br />
=== pkgver ===<br />
The version of the package. The value should be the same as the version released by the author of the package. It can contain letters, numbers, periods and underscore but CANNOT contain a hyphen. If the author of the package uses a hyphen in their version numbering scheme, replace it with an underscore. For instance, if the version is {{ic|0.99-10}}, it should be changed to {{ic|0.99_10}}. If the {{ic|pkgver}} variable is used later in the PKGBUILD then the underscore can easily be substituted for a hyphen on usage e.g.:<br />
source=("$pkgname-${pkgver//_/-}.tar.gz")<br />
<br />
{{Warning|If upstream uses a timestamp versioning such as {{ic|05102014}}, ensure to use the reversed date, i.e. {{ic|20141005}} ([[Wikipedia:ISO 8601|ISO 8601]] format). Otherwise it will not appear as a newer version.}}<br />
<br />
=== pkgrel ===<br />
The release number of the package specific to Arch Linux. This value allows users to differentiate between consecutive builds of the same version of a package. When a new package version is first released, the '''release number starts at 1'''. As fixes and optimizations are made to the {{ic|PKGBUILD}} file, the package will be '''re-released''' and the '''release number''' will increment by 1. When a new version of the package comes out, the release number resets to 1.<br />
<br />
=== pkgdir ===<br />
This variable reflects the root directory of what will be put into the package. It is commonly used in {{ic|1=make DESTDIR="$pkgdir" install}}. This variable should not be modified from any of the PKGBUILD functions ({{ic|prepare()}}, {{ic|build()}}, {{ic|check()}}, etc.).<br />
<br />
=== epoch ===<br />
Used to force the package to be seen as newer than any previous versions with a lower epoch, even if the version number would normally not trigger such an upgrade. This value is required to be a positive integer; the default value if left unspecified is 0. This is useful when the version numbering scheme of a package changes (or is alphanumeric), breaking normal version comparison logic. See {{ic|pacman(8)}} [[man page]] for more information on version comparisons.<br />
{{Warning|Do not use epoch unless you are fully aware of the implications of doing so.}}<br />
<br />
=== pkgbase ===<br />
An optional global directive is available when building a split package, pkgbase is used to refer to the group of packages in the output of makepkg and in the naming of source-only tarballs. If not specified, the first element in the pkgname array is used. All options and directives for the split packages default to the global values given in the PKGBUILD. Nevertheless, the following ones can be overridden within each split package's packaging function: pkgver, pkgrel, epoch, pkgdesc, arch, url, license, groups, depends, optdepends, provides, conflicts, replaces, backup, options, install and changelog. The variable is not allowed to begin with a hyphen.<br />
<br />
=== pkgdesc ===<br />
The description of the package. The description should be about 80 characters or less and should not include the package name in a self-referencing way. For example, "Nedit is a text editor for X11" should instead be written as "A text editor for X11".<br />
<br />
{{Note|Do not follow this rule thoughtlessly when submitting packages to the [[AUR]]. If the package name differs from the application name for some reason, inclusion of the full application name in the description can be the only way to ensure that the package can be found via search.}}<br />
<br />
=== arch ===<br />
An array of architectures that the {{ic|PKGBUILD}} file is known to build and work on. Currently, it should contain {{ic|i686}} and/or {{ic|x86_64}}, {{ic|1=arch=('i686' 'x86_64')}}. The value {{ic|any}} can also be used for architecture-independent packages.<br />
<br />
You can access the target architecture with the variable {{ic|$CARCH}} during a build, and even when defining variables. See also {{bug|16352}}. Example:<br />
<br />
depends=('foobar')<br />
if test "$CARCH" == x86_64; then<br />
depends+=('lib32-glibc')<br />
fi<br />
<br />
<br />
{{Note|With pacman 4.2, specific variables like depends_x86_64=() or source_x86_64=() can be used to achieve the same result.}}<br />
<br />
=== url ===<br />
The URL of the official site of the software being packaged.<br />
<br />
=== license ===<br />
The license under which the software is distributed. The {{pkg|licenses}} package from the [[official repositories]] contains many commonly used licenses, which are installed to {{ic|/usr/share/licenses/common}}. If a package is licensed under one of these licenses, the value should be set to the directory name, e.g. {{ic|1=license=('GPL')}}. If the appropriate license is not included in the official {{Pkg|licenses}} package, several things must be done:<br />
<br />
# The license file(s) should be included in: {{ic|/usr/share/licenses/''pkgname''/}}, e.g. {{ic|/usr/share/licenses/foobar/LICENSE}}.<br />
# If the source tarball does NOT contain the license details and the license is only displayed elsewhere, e.g. a website, then you need to copy the license to a file and include it.<br />
# Add {{ic|custom}} to the {{ic|license}} array. Optionally, you can replace {{ic|custom}} with {{ic|custom:name of license}}. Once a license is used in two or more packages in an official repository (including {{ic|[community]}}), it becomes a part of the {{Pkg|licenses}} package.<br />
* The [[Wikipedia:BSD License|BSD]], [[Wikipedia:MIT License|MIT]], [[Wikipedia:ZLIB license|zlib/png]] and [[Wikipedia:Python License|Python]] licenses are special cases and could not be included in the {{pkg|licenses}} package. For the sake of the {{ic|license}} array, it is treated as a common license ({{ic|1=license=('BSD')}}, {{ic|1=license=('MIT')}}, {{ic|1=license=('ZLIB')}} and {{ic|1=license=('Python')}}) but technically each one is a custom license because each one has its own copyright line. Any packages licensed under these four should have its own unique license stored in {{ic|/usr/share/licenses/''pkgname''}}. Some packages may not be covered by a single license. In these cases, multiple entries may be made in the license array, e.g. {{ic|1=license=('GPL' 'custom:name of license')}}.<br />
* Additionally, the (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:<br />
** (L)GPL — (L)GPLv2 or any later version<br />
** (L)GPL2 — (L)GPL2 only<br />
** (L)GPL3 — (L)GPL3 or any later version<br />
* If after researching the issue no license can be determined, {{ic|PKGBUILD.proto}} suggests using {{ic|unknown}}. However, upstream should be contacted about the conditions under which the software is (and is not) available.<br />
<br />
{{Tip|Some software authors do not provide separate license file and describe distribution rules in section of common ReadMe.txt. This information can be extracted in separate file during {{Ic|build}} phase with something like this: {{Ic|sed -n '/'''This software'''/,/''' thereof.'''/p' ReadMe.txt > LICENSE}}.}}<br />
<br />
=== groups ===<br />
The group the package belongs in. For instance, when you install the {{Grp|kdebase}} package, it installs all packages that belong in the {{Grp|kde}} group.<br />
<br />
=== depends ===<br />
An array of package names that must be installed before this software can be run. Version restrictions can be specified with comparison operators, e.g. {{ic|1=depends=('foobar>=1.8.0')}}; if multiple restrictions are needed, the dependency can be repeated for each of them [https://mailman.archlinux.org/pipermail/arch-general/2012-July/029022.html], e.g. {{ic|1=depends=('foobar>=1.8.0' 'foobar<2.0.0')}}. <br />
<br />
It is not necessary to specify the version of the packages required. You do not need to list packages that your software depends on if other packages your software depends on already have those packages listed in their dependency. For instance, {{pkg|gtk2}} depends on {{pkg|glib2}} and {{pkg|glibc}}. However, {{pkg|glibc}} does not need to be listed as a dependency for {{pkg|gtk2}} because it is a dependency for {{pkg|glib2}}.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=depends_x86_64=()}}.<br />
<br />
=== optdepends ===<br />
An array of package names that are not needed for the software to function but provides additional features. A short description of the extra functionality each optdepend provides for the package should also be noted.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=optdepends_x86_64=()}}.<br />
<br />
An {{ic|optdepends}} may look like this:<br />
optdepends=(<br />
'cups: printing support'<br />
'sane: scanners support'<br />
'libgphoto2: digital cameras support'<br />
'alsa-lib: sound support'<br />
'giflib: GIF images support'<br />
'libjpeg: JPEG images support'<br />
'libpng: PNG images support'<br />
)<br />
<br />
=== makedepends ===<br />
An array of package names that must be installed to build the software but unnecessary for using the software after installation. You can specify the minimum version dependency of the packages in the same format as the {{ic|depends}} array.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=makedepends_x86_64=()}}.<br />
<br />
{{Note|Specifying packages that are already in {{ic|depends}} is not necessary.}}<br />
{{Warning|The group {{Grp|base-devel}} is assumed to be already installed when building with makepkg. Members of "base-devel" '''should not''' be included in {{ic|makedepends}} arrays.}}<br />
<br />
=== checkdepends ===<br />
An array of packages this package depends on to run its test suite but are not needed at runtime. Packages in this list follow the same format as depends. These dependencies are only considered when the [[Creating packages#check()|check()]] function is present and is to be run by makepkg.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=checkdepends_x86_64=()}}.<br />
<br />
{{Warning|The group {{Grp|base-devel}} is assumed to be already installed when building with makepkg. Members of "base-devel" '''should not''' be included in {{ic|checkdepends}} arrays.}}<br />
<br />
=== provides ===<br />
An array of package names that this package provides the features of (or a virtual package such as {{Ic|cron}} or {{Ic|sh}}). Packages that provide the same things can be installed at the same time unless conflict with each other (see below). <br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=provides_x86_64=()}}.<br />
<br />
{{Warning|If you use this variable, you should add the version ({{ic|pkgver}} and perhaps the {{ic|pkgrel}}) that this package will provide if dependencies may be affected by it. For instance, if you are providing a modified ''qt'' package named ''qt-foobar'' version 3.3.8 which provides ''qt'' then the {{ic|provides}} array should look like {{ic|1=provides=('qt=3.3.8')}}. Putting {{ic|1=provides=('qt')}} will cause to fail those dependencies that require a specific version of ''qt''. Do not add {{ic|pkgname}} to your {{ic|provides}} array; this is done automatically.}}<br />
<br />
=== conflicts ===<br />
An array of package names that may cause problems with this package if installed. A package with this name and all packages which {{Ic|provides}} virtual packages with this name will be removed. You can also specify the version properties of the conflicting packages in the same format as the {{ic|depends}} array.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=conflicts_x86_64=()}}.<br />
<br />
=== replaces ===<br />
An array of obsolete package names that are replaced by this package, e.g. {{ic|1=replaces=('wireshark')}} for the {{pkg|wireshark-gtk}} package. After syncing with {{ic|pacman -Sy}}, it will immediately replace an installed package upon encountering another package with the matching {{ic|replaces}} in the repositories. If you are providing an alternate version of an already existing package, use the {{ic|conflicts}} variable which is only evaluated when actually installing the conflicting package.<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=replaces_x86_64=()}}.<br />
<br />
=== backup ===<br />
An array of files that can contain user-made changes and should be preserved during upgrade or removal of a package, primarily intended for configuration files in {{ic|/etc}}.<br />
<br />
When updating, new version may be saved as {{ic|file.pacnew}} to avoid overwriting a file which already exists and was previously modified by the user. Similarly, when the package is removed, user-modified file will be preserved as {{ic|file.pacsave}} unless the package was removed with {{ic|pacman -Rn}} command. <br />
<br />
The file paths in this array should be relative paths (e.g. {{ic|etc/pacman.conf}}) not absolute paths (e.g. {{ic|/etc/pacman.conf}}). See also [[Pacnew and Pacsave files]].<br />
<br />
=== options ===<br />
This array allows you to override some of the default behavior of {{ic|makepkg}}, defined in {{Ic|/etc/makepkg.conf}}. To set an option, include the option name in the array. To reverse the default behavior, place an '''{{ic|!}}''' at the front of the option.<br />
<br />
The full list of the available options can be found in {{ic|man PKGBUILD}}.<br />
<br />
=== install ===<br />
The name of the ''.install'' script to be included in the package. pacman has the ability to store and execute a package-specific script when it installs, removes or upgrades a package. The script contains the following functions which run at different times:<br />
<br />
* {{ic|pre_install}} — The script is run right before files are extracted. One argument is passed: new package version.<br />
* {{ic|post_install}} — The script is run right after files are extracted. One argument is passed: new package version.<br />
* {{ic|pre_upgrade}} — The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|post_upgrade}} — The script is run right after files are extracted. Two arguments are passed in the following order: new package version, old package version.<br />
* {{ic|pre_remove}} — The script is run right before files are removed. One argument is passed: old package version.<br />
* {{ic|post_remove}} — The script is run right after files are removed. One argument is passed: old package version.<br />
<br />
Each function is run [[chroot]]ed inside the pacman install directory. See [https://bbs.archlinux.org/viewtopic.php?pid=913891 this thread].<br />
<br />
{{Tip|A prototype ''.install'' is provided at {{ic|/usr/share/pacman/proto.install}}. For a web-based prototype, refer to [https://projects.archlinux.org/pacman.git/plain/proto/proto.install pacman's gitweb page].}}<br />
<br />
=== changelog ===<br />
The name of the package changelog. To view changelogs for installed packages (that have this file):<br />
pacman -Qc ''pkgname''<br />
<br />
{{Tip|A prototype changelog file is provided at {{ic|/usr/share/pacman/ChangeLog.proto}}.}}<br />
<br />
=== source ===<br />
An array of files which are needed to build the package. It must contain the location of the software source, which in most cases is a full HTTP or FTP URL. The previously set variables {{ic|pkgname}} and {{ic|pkgver}} can be used effectively here (e.g. {{ic|<nowiki>source=("https://example.com/$pkgname-$pkgver.tar.gz")</nowiki>}}).<br />
<br />
Additional architecture-specific array can be added by appending an underscore and the architecture name, e.g. {{ic|1=source_x86_64=()}}. There must be a corresponding integrity array with checksums, e.g. {{ic|1=md5sums_x86_64=()}}.<br />
<br />
{{Note|If you need to supply files which are not downloadable on the fly, e.g. self-made patches, you simply put those into the same directory where your {{ic|PKGBUILD}} file is in and add the file name to this array. Any paths you add here are resolved relative to the directory where the {{ic|PKGBUILD}} lies. Before the actual build process is started, all of the files referenced in this array will be downloaded or checked for existence, and {{ic|makepkg}} will not proceed if any are missing.}}<br />
<br />
{{Tip|You can specify a different name for the downloaded file — if the downloaded file has a different name for some reason, like the URL had a GET parameter — using the following syntax: {{Ic|''filename''::''fileuri''}}<br />
For example:<br />
{{bc|1=source=("project_name::<nowiki>hg+https://googlefontdirectory.googlecode.com/hg/</nowiki>")}}}}<br />
<br />
=== noextract ===<br />
An array of files listed under the {{ic|source}} array which should not be extracted from their archive format by {{ic|makepkg}}. This most commonly applies to archives which cannot be handled by {{ic|/usr/bin/bsdtar}} because {{Pkg|libarchive}} processes all files as streams rather than random access as {{Pkg|unzip}} does. In these situations, the alternative unarchiving tool (e.g., {{ic|unzip}}, {{ic|p7zip}}, etc.) should be added in the {{ic|makedepends}} array and the first line of the [[Creating packages#prepare()|prepare()]] function should extract the source archive manually; for example:<br />
<br />
unzip [source].zip<br />
<br />
Note that while the {{ic|source}} array accepts URLs, {{ic|noextract}} is '''just''' the file name portion. So, for example, you would do something like this (simplified from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/grub grub2's PKGBUILD]):<br />
<br />
source=(<nowiki>"http://ftp.archlinux.org/other/grub2/grub2_extras_lua_r20.tar.xz"</nowiki>)<br />
noextract=('grub2_extras_lua_r20.tar.xz')<br />
<br />
To extract ''nothing'', you can do something fancy like this (taken from [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/firefox-i18n#n123 firefox-i18n]):<br />
<br />
noextract=("${source[@]%%::*}")<br />
<br />
{{Note|More conservative Bash substitution would possibly include a loop that calls {{ic|basename}}. If you have read this far, you should get the idea.}}<br />
<br />
=== md5sums ===<br />
An array of MD5 checksums of the files listed in the {{ic|source}} array. Once all files in the {{ic|source}} array are available, an MD5 hash of each file will be automatically generated and compared with the values of this array in the same order they appear in the {{ic|source}} array. While the order of the source files itself does not matter, it is important that it matches the order of this array because {{ic|makepkg}} cannot guess which checksum belongs to what source file. You can generate this array quickly and easily using the command {{ic|updpkgsums}} in the directory that contains the {{ic|PKGBUILD}} file.<br />
{{Note|The MD5 algorithm is known to have weaknesses; you should consider using a stronger alternative from the SHA-2 family of hash algorithms, such as SHA-256.}}<br />
<br />
=== sha1sums ===<br />
An array of 160-bit SHA-1 checksums. This is an alternative to {{ic|md5sums}} described above. To enable use and generation of these checksums, set up the {{ic|INTEGRITY_CHECK}} option in {{ic|/etc/makepkg.conf}}. See {{ic|man makepkg.conf}}.<br />
{{Note|The SHA-1 algorithm is known to have weaknesses; you should consider using a stronger alternative from the SHA-2 family of hash algorithms, such as SHA-256.}}<br />
<br />
=== sha256sums, sha384sums, sha512sums ===<br />
An array of SHA-2 checksums with digest sizes 256, 384, and 512 bits, respectively. These are alternatives to {{ic|md5sums}} and {{ic|sha1sums}} described above and have fewer known weaknesses. To enable use and generation of these checksums, set up the {{ic|INTEGRITY_CHECK}} option in {{ic|/etc/makepkg.conf}}. See {{ic|man makepkg.conf}}.<br />
<br />
=== validpgpkeys ===<br />
An array of PGP fingerprints. If this array is non-empty, makepkg will only accept signatures from the keys listed here and will ignore the trust values from the keyring. If the source file was signed with a subkey, makepkg will still use the primary key for comparison.<br />
<br />
Only full fingerprints are accepted. They must be uppercase and must not contain whitespace characters.<br />
<br />
== See also ==<br />
*[https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5) Manual Page]<br />
*[http://ix.io/66p Example PKGBUILD file]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Pacman/Rosetta&diff=348174Pacman/Rosetta2014-12-04T15:38:25Z<p>Reventlov: pacman -Syu synchronize first</p>
<hr />
<div>[[Category:Package management]]<br />
[[es:Pacman Rosetta]]<br />
[[ja:Pacman Rosetta]]<br />
[[sr:Pacman Rosetta]]<br />
[[zh-CN:Pacman Rosetta]]<br />
This page pulls heavily from [http://old-en.opensuse.org/Software_Management_Command_Line_Comparison openSUSE's Software Management Command Line Comparison]. It has been simplified and has added Arch to the comparison, as well as modified the order in which each distribution exists for the benefit of Arch users.<br />
<br />
Users from other Linux distributions can benefit from pacman by using a simple wrapper: [https://github.com/icy/pacapt pacapt]. The script could also be intended for Arch users having to temporarily deal with another distribution.<br />
<br />
[https://github.com/icy/pacapt pacapt] is a pacman shell script implementation for other linux distribution.<br />
<br />
{{Note|<br />
* Some of the tools described here are specific to a certain version of pacman. The -Qk option is new in pacman 4.1.<br />
* The command {{ic|pkgfile}} can be found in the {{Pkg|pkgfile}} package.<br />
}}<br />
{|<br />
| align="center" style="background:#f0f0f0;"|'''<font color="#707070">Action</font>'''<br />
| align="center" style="background:#f0f0f0;"|'''Arch'''<br />
| align="center" style="background:#f0f0f0;"|'''Red Hat/Fedora'''<br />
| align="center" style="background:#f0f0f0;"|'''Debian/Ubuntu'''<br />
| align="center" style="background:#f0f0f0;"|'''SUSE/openSUSE'''<br />
| align="center" style="background:#f0f0f0;"|'''Gentoo'''<br />
|-<br />
| Install a package(s) by name ||pacman -S||yum install ||apt-get install||zypper install zypper in|| emerge [-a]<br />
|- style="background:#e4e4e4"<br />
| Remove a package(s) by name ||pacman -Rc||yum remove/erase ||apt-get remove||zypper remove zypper rm ||emerge -C<br />
|-<br />
| Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par. ||pacman -Ss||yum search ||apt-cache search||zypper search zypper se [-s]||emerge -S <br />
|- style="background:#e4e4e4"<br />
| Upgrade Packages - Install packages which have an older version already installed ||pacman -Syu||yum update ||apt-get update: apt-get upgrade||zypper update zypper up||emerge -u world<br />
|-<br />
| Upgrade Packages - Another form of the update command, which can perform more complex updates -- like distribution upgrades. When the usual update command will omit package updates, which include changes in dependencies, this command can perform those updates. ||pacman -Syu||yum distro-sync ||apt-get dist-upgrade||zypper dup||emerge -uDN world<br />
|- style="background:#e4e4e4"<br />
| Reinstall given Package - Will reinstall the given package without dependency hassle. ||pacman -S||yum reinstall||apt-get install --reinstall||zypper install --force||emerge [-a]<br />
|-<br />
| Installs local package file, e.g. app.rpm and uses the installation sources to resolve dependencies ||pacman -U||yum localinstall ||dpkg -i && apt-get install -f||zypper in /path/to/local.rpm||emerge<br />
|- style="background:#e4e4e4"<br />
| Updates package(s) with local packages and uses the installation sources to resolve dependencies ||pacman -U||yum localupdate ||n/a||emerge||<br />
|-<br />
| Use some magic to fix broken dependencies in a system || pacman dep level - testdb, shared lib level - findbrokenpkgs or lddd||package-cleanup --problems||apt-get --fix-broken / aptitude install||zypper verify ||revdep-rebuild<br />
|- style="background:#e4e4e4"<br />
| Only downloads the given package(s) without unpacking or installing them ||pacman -Sw||yumdownloader (found in yum-utils package)||apt-get --download-only / aptitude download|| zypper --download-only ||emerge --fetchonly <br />
|-<br />
| Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed. ||<nowiki>pacman -Qdtq | pacman -Rs -</nowiki>||yum autoremove||apt-get autoremove ||zypper rm -u||emerge --depclean <br />
|- style="background:#e4e4e4"<br />
| Downloads the corresponding source package(s) to the given package name(s) || Use [[ABS]] && makepkg -o ||yumdownloader --source||apt-get source / debcheckout||zypper source-install||emerge --fetchonly<br />
|- style="background:#e4e4e4"<br />
| Remove packages no longer included in any repositories. ||||package-cleanup --orphans||||||<br />
|-<br />
| Install/Remove packages to satisfy build-dependencies. Uses information in the source package. ||automatic||yum-builddep||apt-get build-dep ||zypper si -d||emerge -o <br />
|- style="background:#e4e4e4"<br />
| Add a package lock rule to keep its current state from being changed ||${EDITOR} /etc/pacman.conf<br/>modify IgnorePkg array||yum.conf <--”exclude” option (add/amend)||<nowiki>echo "$PKGNAME hold" | dpkg --set-selections</nowiki>||Put package name in /etc/zypp/locks, or zypper al||/etc/portage/package.mask<br />
|-<br />
| Delete a package lock rule ||remove package from IgnorePkg line in /etc/pacman.conf||yum.conf <--”exclude” option (remove/amend)||<nowiki>echo "$PKGNAME install" | dpkg --set-selections</nowiki> ||Remove package name from /etc/zypp/locks||/etc/portage/package.mask (or package.unmask) <br />
|- style="background:#e4e4e4"<br />
| Show a listing of all lock rules ||cat /etc/pacman.conf||yum.conf (research needed)||/etc/apt/preferences ||View /etc/zypp/locks||cat /etc/portage/package.mask<br />
|-<br />
| Add a checkpoint to the package system for later rollback ||||(unnecessary, done on every transaction)||||n/a ||<br />
|- style="background:#e4e4e4"<br />
| Remove a checkpoint from the system ||N/A||N/A||||n/a ||<br />
|-<br />
| Provide a list of all system checkpoints ||N/A||yum history list||||n/a ||<br />
|- style="background:#e4e4e4"<br />
| Rolls entire packages back to a certain date or checkpoint. ||N/A||yum history rollback||||n/a ||<br />
|-<br />
|- <br />
| Undo a single specified transaction. ||N/A||yum history undo||||n/a||||<br />
|- style="background:#e4e4e4"<br />
| Mark a package previously installed as a dependency as explicitly required. ||pacman -D --asexplicit||||aptitude unmarkauto||||emerge --select <br />
|- <br />
| Install package(s) as dependency / without marking as explicitly required. ||pacman -S --asdeps||||||||emerge -1<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|-<br />
| '''''Package information management''''' ||||||||||<br />
|- style="background:#e4e4e4"<br />
| Get a dump of the whole system information - Prints, Saves or similar the current state of the package management system. Preferred output is text or XML. (Note: Why either-or here? No tool offers the option to choose the output format.) ||(see /var/lib/pacman/local)||(see /var/lib/rpm/Packages)||apt-cache stats||n/a ||emerge --info<br />
|-<br />
| Show all or most information about a package. The tools' verbosity for the default command vary. But with options, the tools are on par with each other. ||pacman -[S<nowiki>|</nowiki>Q]i ||yum list or info ||apt-cache show / apt-cache policy||zypper info zypper if||emerge -S; emerge -pv; eix<br />
|- style="background:#e4e4e4"<br />
| Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par. ||pacman -Ss ||yum search ||apt-cache search||zypper search zypper se [-s]||emerge -S <br />
|-<br />
| Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options. ||pacman -Qu ||yum list updates yum check-update ||apt-get upgrade -> n||zypper list-updates zypper patch-check (just for patches) ||emerge -uDNp world<br />
|- style="background:#e4e4e4"<br />
| Display a list of all packages in all installation sources that are handled by the packages management. Some tools provide options or additional commands to limit the output to a specific installation source. ||pacman -Sl ||yum list available||apt-cache dumpavail apt-cache dump (Cache only) apt-cache pkgnames||zypper packages ||emerge -ep world<br />
|-<br />
| Displays packages which provide the given exp. aka reverse provides. Mainly a shortcut to search a specific field. Other tools might offer this functionality through the search command. ||pkgfile <filename>||yum provides / yum whatprovides ||apt-file search <filename>||zypper what-provides zypper wp|| equery belongs (only installed packages); pfl<br />
|- style="background:#e4e4e4"<br />
| Display packages which require X to be installed, aka show reverse/ dependencies.||pacman -Sii||yum resolvedep ||apt-cache rdepends / aptitude search ~Dpattern||IN PROGRESS || equery depends<br />
|-<br />
| Display packages which conflict with given expression (often package). Search can be used as well to mimic this function.||(none)||repoquery --whatconflicts||aptitude search '~Cpattern'||IN PROGRESS ||<br />
|- style="background:#e4e4e4"<br />
| List all packages which are required for the given package, aka show dependencies. ||pacman -[S<nowiki>|</nowiki>Q]i||yum deplist ||apt-cache depends / apt-cache show||IN PROGRESS || emerge -ep<br />
|-<br />
| List what the current package provides ||||yum provides ||||IN PROGRESS||equery files<br />
|- style="background:#e4e4e4"<br />
| List the files that the package holds. Again, this functionality can be mimicked by other more complex commands. ||pacman -Ql $pkgname <br/>pkgfile -l ||repoquery -l $pkgname ||dpkg-query -L $pkgname ||IN PROGRESS ||equery files<br />
|-<br />
| List all packages that require a particular package ||||repoquery --whatrequires [--recursive]||||||equery depends -a<br />
|- style="background:#e4e4e4"<br />
| Search all packages to find the one which holds the specified file. auto-apt is using this functionality. ||pkgfile -s||yum provides / yum whatprovides ||apt-file search||IN PROGRESS ||equery belongs<br />
|- style="background:#e4e4e4"<br />
| Display all packages that the specified packages obsoletes. ||||yum list obsoletes ||apt-cache show||IN PROGRESS|| <br />
|-<br />
| Verify dependencies of the complete system. Used if installation process was forcefully killed. ||testdb||yum deplist ||apt-get check||n/a || emerge -uDN world<br />
|- style="background:#e4e4e4"<br />
| Generates a list of installed packages || pacman -Q || yum list installed || dpkg --get-selections || zypper ||emerge -ep world<br />
|-<br />
| List packages that are installed but are not available in any installation source (anymore). ||pacman -Qm||yum list extras || deborphan || |zypper se -si | grep 'System Packages'||eix-test-obsolete<br />
|- style="background:#e4e4e4"<br />
| List packages that were recently added to one of the installation sources, i.e. which are new to it. ||(none)||yum list recent ||aptitude search '~N' / aptitude forget-new||n/a||eix-diff<br />
|-<br />
| Show a log of actions taken by the software management. ||cat /var/log/pacman.log ||yum history cat /var/log/yum.log||cat /var/log/dpkg.log||cat /var/log/zypp/history || located in /var/log/portage<br />
|- style="background:#e4e4e4"<br />
| Clean up all local caches. Options might limit what is actually cleaned. Autoclean removes only unneeded, obsolete information. ||pacman -Sc<br/>pacman -Scc ||yum clean all ||apt-get clean / apt-get autoclean / aptitude clean|| zypper clean || eclean distfiles<br />
|-<br />
| Add a local package to the local package cache mostly for debugging purposes. ||cp $pkgname /var/cache/pacman/pkg/||||apt-cache add ||n/a || cp $srcfile /usr/portage/distfiles<br />
|- style="background:#e4e4e4"<br />
| Display the source package to the given package name(s) ||||repoquery -s||apt-cache showsrc ||n/a||<br />
|-<br />
| Generates an output suitable for processing with dotty for the given package(s). ||||||apt-cache dotty ||n/a ||<br />
|- style="background:#e4e4e4"<br />
| Set the priority of the given package to avoid upgrade, force downgrade or to overwrite any default behavior. Can also be used to prefer a package version from a certain installation source. ||${EDITOR} /etc/pacman.conf<br/>Modify HoldPkg and/or IgnorePkg arrays||yum-plugin-priorities and yum-plugin-protect-packages||/etc/apt/preferences, apt-cache policy|| zypper mr -p || ${EDITOR} /etc/portage/package.keywords<br/>Add a line with =category/package-version<br />
|-<br />
| Remove a previously set priority ||||||/etc/apt/preferences ||zypper mr -p || ${EDITOR} /etc/portage/package.keywords<br/>remove offending line<br />
|- style="background:#e4e4e4"<br />
| Show a list of set priorities. ||||||apt-cache policy /etc/apt/preferences ||n/a || cat /etc/portage/package.keywords<br />
|-<br />
| Ignores problems that priorities may trigger. ||||||||n/a ||<br />
|-<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|- style="background:#e4e4e4"<br />
| Installation sources management ||${EDITOR} /etc/pacman.conf||${EDITOR} /etc/yum.repos.d/${REPO}.repo||${EDITOR} /etc/apt/sources.list|| ||layman<br />
|-<br />
| Add an installation source to the system. Some tools provide additional commands for certain sources, others allow all types of source URI for the add command. Again others, like apt and yum force editing a sources list. apt-cdrom is a special command, which offers special options design for CDs/DVDs as source. ||${EDITOR} /etc/pacman.conf||${EDITOR} /etc/yum.repos.d/${REPO}.repo||apt-cdrom add||zypper service-add ||layman, overlays<br />
|- style="background:#e4e4e4"<br />
| Refresh the information about the specified installation source(s) or all installation sources. ||pacman -Sy ||yum clean expire-cache && yum check-update ||apt-get update||zypper refresh zypper ref||layman -f<br />
|-<br />
| Prints a list of all installation sources including important information like URI, alias etc. ||cat /etc/pacman.d/mirrorlist||cat /etc/yum.repos.d/*||||zypper service-list ||layman -l<br />
|- style="background:#e4e4e4"<br />
| Disable an installation source for an operation ||||yum --disablerepo=${REPO}||||||emerge package::repo-to-use<br />
|- <br />
| Download packages from a different version of the distribution than the one installed. ||||yum --releasever=${VERSION} ||apt-get install -t release package/ apt-get install package/release (deps not covered)||||echo "category/package ~amd64" >> /etc/portage/package.keywords && emerge package<br />
|- style="background:#e4e4e4"<br />
| '''''Other commands''''' ||||||||||<br />
|-<br />
| Start a shell to enter multiple commands in one session ||||yum shell ||apt-config shell||zypper shell ||<br />
|-<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|- style="background:#e4e4e4"<br />
| '''''Package Verification'''''||||||||||<br />
|-<br />
| Single package||pacman -Qk[k] <package>||rpm -V <package>||debsums||rpm -V <package>||equery check<br />
|- style="background:#e4e4e4"<br />
| All packages||pacman -Qk[k]||rpm -Va||debsums||rpm -Va||equery check<br />
|-<br />
| ||||||||||<br />
|-<br />
| ||||||||||<br />
|-<br />
| '''''Package Querying'''''||||||||||<br />
|- style="background:#e4e4e4"<br />
| List installed local packages along with version||pacman -Q||rpm -qa||dpkg -l||||emerge -e world<br />
|-<br />
| Display local package information: Name, version, description, etc.||pacman -Qi ||rpm -qi ||dpkg -s||||emerge -pv and emerge -S<br />
|- style="background:#e4e4e4"<br />
| Display remote package information: Name, version, description, etc.||pacman -Si ||yum info ||apt-cache show / aptitude show||||emerge -pv and emerge -S<br />
|- <br />
| Display files provided by local package||pacman -Ql ||rpm -ql||dpkg -L||||equery files<br />
|- style="background:#e4e4e4"<br />
| Display files provided by a remote package||pkgfile -l||repoquery -l||||||pfl<br />
|- <br />
| Query the package which provides FILE ||pacman -Qo ||rpm -qf (installed only) or yum whatprovides (everything) ||dpkg -S/dlocate||||equery belongs<br />
|- style="background:#e4e4e4"<br />
| Query a package supplied on the command line rather than an entry in the package management database||pacman -Qp||rpm -qp||dpkg -I||||<br />
|-<br />
| Show the changelog of a package||pacman -Qc||rpm -q --changelog||apt-get changelog|||||equery changes -f<br />
|- style="background:#e4e4e4"<br />
| Search locally installed package for names or descriptions ||pacman -Qs|| ||aptitude search <nowiki>'~i(~nexpr|~dexpr)'</nowiki>|||||eix -S -I<br />
|-<br />
| List packages not required by any other package||pacman -Qt||package-cleanup --all --leaves||deborphan -anp1||||<br />
|-<br />
| ||||||||||<br />
|-<br />
| '''''Building Packages'''''||||||||||<br />
|- style="background:#e4e4e4"<br />
| Build a package||makepkg -s||rpmbuild -ba (normal) mock (in chroot)||debuild||rpmbuild -ba ||ebuild; quickpkg<br />
|-<br />
| Check for possible packaging issues||namcap||rpmlint ||lintian||||repoman<br />
|- style="background:#e4e4e4"<br />
| List the contents of a package file||pacman -Qpl <file>||rpmls rpm -qpl||dpkg -c||rpm -qpl||<br />
|-<br />
| Extract a package ||tar -Jxvf||<nowiki>rpm2cpio | cpio -vid</nowiki>||<nowiki>ar vx | tar -zxvf data.tar.gz</nowiki>||<nowiki>rpm2cpio | cpio -vid</nowiki>||tar -jxvf<br />
|- style="background:#e4e4e4"<br />
| Query a package supplied on the command line rather than an entry in the package management database||pacman -Qp||rpm -qp||dpkg -I||||<br />
|-<br />
| align="center" style="background:#f0f0f0;"|'''<font color="#707070">Action</font>'''<br />
| align="center" style="background:#f0f0f0;"|'''Arch'''<br />
| align="center" style="background:#f0f0f0;"|'''Red Hat/Fedora'''<br />
| align="center" style="background:#f0f0f0;"|'''Debian/Ubuntu'''<br />
| align="center" style="background:#f0f0f0;"|'''SUSE/openSUSE'''<br />
| align="center" style="background:#f0f0f0;"|'''Gentoo'''<br />
|}</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Systemd-networkd&diff=332234Systemd-networkd2014-08-24T15:14:14Z<p>Reventlov: </p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Network managers]]<br />
[[Category:Virtualization]]<br />
[[fr:systemd-networkd]]<br />
[[ja:systemd-networkd]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd-nspawn}}<br />
{{Related|Network bridge}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related|:Category:Network managers}}<br />
{{Related articles end}}<br />
<br />
As of version 210, systemd now includes support for basic network configuration through [[udev]] and networkd.<br />
<br />
''systemd-networkd'' is a system daemon that manages network configuration. It detects and configures network devices as they appear, as well as creates virtual network devices. This service can run alongside your usual network management tool like [[netctl]] or even replace it for some configurations when it comes to virtualization. This service can especially be very useful to setup basic or more complex network settings (static IP, bridge,vlan...) for a container managed by [[systemd-nspawn]].<br />
<br />
It is not intended to configure low-level settings of network interfaces as this remains [[udev]]'s job.<br />
<br />
networkd is intended for simple setups such as VMs or containers, but also works fine on Ethernet connections. It has no support for WiFi but can be used with [[wpa_supplicant]] to manage wireless connection.<br />
<br />
{{Note|''systemd-networkd'' is under heavy development, be sure to check for the changes of configuration syntax and new features at every update. Reading the [http://cgit.freedesktop.org/systemd/systemd/tree/NEWS changelog/news] is recommended.}}<br />
<br />
== Installation ==<br />
<br />
The service is available with {{Pkg|systemd}} >= 210. You will want to [[systemd#Basic systemctl usage|enable and start]] the {{ic|systemd-networkd.service}} on the host and container.<br />
<br />
For debugging purposes, it is strongly advised to [[pacman|install]] the {{Pkg|bridge-utils}}, {{Pkg|net-tools}} and {{Pkg|iproute2}} packages.<br />
<br />
If you are using ''systemd-nspawn'', you may need to modify the {{ic|systemd-nspawn@.service}} and append boot options to the {{ic|ExecStart}} line. Please refer to {{ic|man 1 systemd-nspawn}} for an exhaustive list of options.<br />
<br />
Note that if you want to take advantage of automatic DNS configuration from DHCP, you need to enable {{ic|systemd-resolved}} and symlink {{ic|/run/systemd/resolve/resolv.conf}} to {{ic|/etc/resolv.conf}}. See {{ic|systemd-resolved.service(8)}} for more details.<br />
<br />
== Configuration files ==<br />
<br />
Configuration files will be read from {{ic|/usr/lib/systemd/network}}, the volatile runtime network directory {{ic|/run/systemd/network}} and the local administration network directory {{ic|/etc/systemd/network}}. Files in {{ic|/etc/systemd/network}} have the highest priority.<br />
<br />
There are three types of configuration files. <br />
<br />
* '''.network''' files. They will apply a network configuration for a ''matching'' device<br />
* '''.netdev''' files. They will create a ''virtual network device'' for a ''matching'' environment<br />
* '''.link''' files. When a network device appears, [[udev]] will look for the first ''matching'' '''.link''' file<br />
<br />
They all follow the same rules: <br />
<br />
* If '''all''' conditions in the {{ic|[Match]}} section are matched, the profile will be activated<br />
* an empty {{ic|[Match]}} section means the profile will apply in any case (can be compared to the {{ic|*}} joker)<br />
* each entry is a key with the {{ic|1=NAME=VALUE}} syntax <br />
* all configuration files are collectively sorted and processed in lexical order, regardless of the directory in which they live<br />
* files with identical name replace each other<br />
<br />
{{Tip|<br />
* to override a system-supplied file in {{ic|/usr/lib/systemd/network}} in a permanent manner (i.e even after upgrade), place a file with same name in {{ic|/etc/systemd/network}} and symlink it to {{ic|/dev/null}}<br />
* the {{ic|*}} joker can be used in {{ic|VALUE}} (e.g {{ic|en*}} will match any Ethernet device)<br />
* following this [https://mailman.archlinux.org/pipermail/arch-general/2014-March/035381.html Arch-general thread], the best practice is to setup specific container network settings ''inside the container'' with '''networkd''' configuration files.<br />
}}<br />
<br />
=== network files ===<br />
<br />
These files are aimed at setting network configuration variables, especially for servers and containers.<br />
<br />
Below is a basic structure of a ''MyProfile''.network file:<br />
<br />
{{hc|/etc/systemd/network/''MyProfile''.network|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Network]<br />
''a vertical list of keys''<br />
<br />
[Address]<br />
''a vertical list of keys''<br />
<br />
[Route]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} the device name (e.g Br0, enp4s0)<br />
* {{ic|1=Host=}} the machine hostname<br />
* {{ic|1=Virtualization=}} check whether the system is executed in a virtualized environment or not. A {{ic|1=Virtualization=no}} key will only apply on your host machine, while {{ic|1=Virtualization=yes}} apply to any container or VM.<br />
<br />
==== [Network] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=DHCP=}} is a Boolean. When set to {{ic|true}} it enables a basic [[Wikipedia:Dynamic Host Configuration Protocol|DHCPv4]] support.<br />
* {{ic|1=DNS=}} is a [[Wikipedia:Domain Name System|DNS]] server address. You can specify this option more than once<br />
* {{ic|1=Bridge=}} is the name of the bridge to add the link to<br />
<br />
==== [Address] section ====<br />
Most common key in the {{ic|[Address]}} section is:<br />
<br />
* {{ic|1=Address=}} is a static '''IPv4''' or '''IPv6''' address and its prefix length, separated by a {{ic|/}} character (e.g {{ic|192.168.1.90/24}}). This option is '''mandatory'''<br />
<br />
==== [Route] section ====<br />
Most common key in the {{ic|[Route]}} section is:<br />
<br />
* {{ic|1=Gateway=}} is the address of your machine gateway. This option is '''mandatory'''<br />
For an exhaustive key list, please refer to {{ic|systemd.network(5)}}<br />
<br />
{{Tip|you can put the {{ic|1=Address=}} and {{ic|1=Gateway=}} keys in the {{ic|[Network]}} section as a short-hand if {{ic|1=Address=}} contains only an Address key and {{ic|1=Gateway=}} section contains only a Gateway key<br />
}}<br />
<br />
=== netdev files ===<br />
<br />
These files will create virtual network devices.<br />
<br />
Below is a basic structure of a ''Mydevice''.netdev file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.netdev|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Netdev]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=Host=}} and {{ic|1=Virtualization=}}<br />
<br />
==== [Netdev] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} is the interface name used when creating the netdev. This option is '''compulsory'''<br />
* {{ic|1=Kind=}} is the netdev kind. Currently, ''bridge'', ''bond'', ''vlan'' and ''macvlan'' are supported. This option is '''compulsory'''<br />
<br />
For an exhaustive key list, please refer to {{ic|systemd.netdev(5)}}<br />
<br />
=== link files ===<br />
<br />
These files are an alternative to custom udev rules and will be applied by [[udev]] as the device appears.<br />
<br />
Below is a basic structure of a ''Mydevice''.link file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.link|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Link]<br />
''a vertical list of keys''<br />
}}<br />
<br />
The {{ic|[Match]}} section will determine if a given link file may be applied to a given device, when the {{ic|[Link]}} section specifies the device configuration.<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=MACADRESS=}}, {{ic|1=Host=}} and {{ic|1=Virtualization=}}.<br />
<br />
{{ic|1=Type=}} is the device type (e.g. vlan)<br />
<br />
==== [Link] section ====<br />
<br />
Most common keys are:<br />
<br />
{{ic|1=MACAddressPolicy=}} is either ''persistent'' when the hardware has a persistent MAC address (as most hardware should) or ''random'' , which allows to give a random MAC address when the device appears.<br />
<br />
{{ic|1=MACAddress=}} shall be used when no {{ic|1=MACAddressPoicy=}} is specified.<br />
<br />
{{Note|the system {{ic|/usr/lib/systemd/network/99-default.link}} is generally sufficient for most of the basic cases.}}<br />
<br />
== Usage ==<br />
<br />
{{Tip|before you start to configure your container network, it is useful to:<br />
* disable all your [[netctl]] services. This will avoid any potential conflicts with '''systemd-networkd''' and make all your configurations easier to test. Furthermore, odds are high you will end with few or even no [[netctl]] activated profiles. The {{ic|$ netctl list}} command will output a list of all your profiles, with the activated one being starred.<br />
* disable {{ic|systemd-nspawn@.service}} and use the {{ic|# systemd-nspawn -bD /path_to/your_container/}} command with some more options to boot the container. To log off and shutdown, run inside the container {{ic|# systemctl poweroff}}. Once your network setting met your requirements, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-nspawn@.service}}<br />
* disable {{ic|dhcpcd.service}} if enabled on your system. This service apply dhcpcd on '''all''' interfaces<br />
* make sure you have no [[netctl]] profiles activated on your container, nor the {{ic|systemd-networkd.service}} enabled and started<br />
* make sure you don't have any [[iptables]] rules which can block traffic<br />
* make sure ''packet forwarding'' is [[Internet sharing|enabled]] if you plan to set up a ''private network'' on your container<br />
* after any configuration files, reload the networkd daemon when running {{ic|# systemctl restart systemd-networkd}}<br />
}}<br />
<br />
{{Note|For the set-up described below, <br />
* we will limit the output of the {{ic|$ ip a}} command to the concerned interfaces<br />
* we assume the ''host'' is your main OS you are booting to and the ''container'' is your guest virtual machine<br />
* all interface names and IP adresses are only examples<br />
}}<br />
<br />
=== Basic DHCP network ===<br />
<br />
This set up will enable a DHCP IP for host and container. In this case, both systems will share the same IP as they share the same interfaces.<br />
<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
DHCP=yes<br />
</nowiki>}}<br />
<br />
You can of course replace {{ic|en*}} by the full name of your Ethernet device given by the output of the {{ic|$ ip link}} command.<br />
<br />
* on host and container:<br />
<br />
{{hc|$ ip a|<br />
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.72/24 brd 192.168.1.255 scope global enp7s0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
By default hostname received from the DHCP server will be used as the transient hostname.<br />
<br />
To change it add {{ic|1=UseHostname=false}} in section {{ic|[DHCPv4]}}<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[DHCPv4]<br />
UseHostname=false<br />
</nowiki>}}<br />
<br />
If you did not want configure a DNS in {{ic|/etc/resolv.conf}} and want to rely on DHCP for setting it up, you need to enable {{ic|systemd-resolved}} and symlink {{ic|/run/systemd/resolve/resolv.conf}} to {{ic|/etc/resolv.conf}}. See {{ic|systemd-resolved.service(8)}} for more details.<br />
<br />
$ systemctl enable systemd-resolved<br />
$ ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf<br />
<br />
=== DHCP with two distinct IP ===<br />
<br />
==== Bridge interface ====<br />
<br />
Create a virtual bridge interface <br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.netdev|<nowiki><br />
[NetDev]<br />
Name=br0<br />
Kind=bridge<br />
</nowiki>}}<br />
<br />
* on host and container:<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default <br />
link/ether ae:bd:35:ea:0c:c9 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Note that the interface br0 is listed but is DOWN.<br />
<br />
==== Bind Ethernet to Bridge ====<br />
<br />
Modify the {{ic|/etc/systemd/network/''MyDhcp''.network}} to remove the DHCP, as the bridge requires an interface to bind to with no IP, and add a key to bind this device to br0. Let's change its name to a more relevant one.<br />
<br />
{{hc|/etc/systemd/network/''MyEth''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
Bridge=br0<br />
</nowiki>}}<br />
<br />
==== Bridge network ====<br />
<br />
Create a network profile for the Bridge<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DHCP=yes<br />
</nowiki>}}<br />
<br />
==== Add option to boot the container ====<br />
<br />
As we want to give a separate IP for host and container, we need to ''Disconnect'' networking of the container from the host. To do this, add this option {{ic|1=--network-bridge=br0}} to your container boot command.<br />
<br />
# systemd-nspawn --network-bridge&#61;br0 -bD /path_to/my_container<br />
<br />
==== Result ====<br />
<br />
* on host<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default <br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.87/24 brd 192.168.1.255 scope global br0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
6: vb-''MyContainer'': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000<br />
link/ether d2:7c:97:97:37:25 brd ff:ff:ff:ff:ff:ff<br />
inet6 fe80::d07c:97ff:fe97:3725/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip a|<br />
2: host0: <BROADCAST,MULTICAST,ALLMULTI,AUTOMEDIA,NOTRAILERS,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 5e:96:85:83:a8:5d brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.73/24 brd 192.168.1.255 scope global host0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::5c96:85ff:fe83:a85d/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
==== Notice ====<br />
<br />
* we have now one IP address for Br0 on the host, and one for host0 in the container<br />
* two new interfaces have appeared: {{ic|vb-''MyContainer''}} in the host and {{ic|host0}} in the container. This comes as a result of the {{ic|1=--network-bridge=br0}} option. This option ''implies'' another option, {{ic|--network-veth}}. This means a ''virtual Ethernet link'' has been created between host and container.<br />
* the DHCP address on {{ic|host0}} comes from the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file.<br />
* on host<br />
<br />
{{hc|$ brctl show|<br />
bridge name bridge id STP enabled interfaces<br />
br0 8000.14dae9b57a88 no enp7s0<br />
vb-''MyContainer''<br />
}}<br />
<br />
the above command output confirms we have a bridge with two interfaces binded to.<br />
<br />
* on host<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev br0 <br />
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.87<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev host0 <br />
192.168.1.0/24 dev host0 proto kernel scope link src 192.168.1.73<br />
}}<br />
<br />
the above command outputs confirm we have activated {{ic|br0}} and {{ic|host0}} interfaces with an IP address and Gateway 192.168.1.254. The gateway address has been automatically grabbed by ''systemd-networkd''<br />
<br />
{{hc|$ cat /run/systemd/resolve/resolv.conf|<br />
nameserver 192.168.1.254<br />
}}<br />
<br />
=== Static IP network ===<br />
<br />
Setting a static IP for each device can be helpful in case of deployed web services (e.g FTP, http, SSH). Each device will keep the same MAC address across reboots if your system {{ic|/usr/lib/systemd/network/99-default.link}} file has the {{ic|1=MACAdressPolicy=persistent}} option (it has by default). Thus, you will easily route any service on your Gateway to the desired device.<br />
First, we shall get rid of the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file. To do it in a permanent way (e.g even after upgrades), do the following on '''both''' host and container. This will mask the file {{ic|/usr/lib/systemd/network/80-container-host0.network}} since files of the same name in {{ic|/etc/systemd/network}} take priority over {{ic|/usr/lib/systemd/network}}.<br />
<br />
# ln -sf /dev/null /etc/systemd/network/80-container-host0.network<br />
<br />
Then, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-networkd}} on your container.<br />
<br />
The needed configuration files:<br />
<br />
* on host <br />
<br />
/etc/systemd/network/''MyBridge''.netdev<br />
/etc/systemd/network/''MyEth''.network<br />
<br />
A modified ''MyBridge''.network<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.87/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
* on container<br />
<br />
{{hc|/etc/systemd/network/''MyVeth''.network|<nowiki><br />
[Match]<br />
Name=host0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.94/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [http://www.freedesktop.org/software/systemd/man/systemd-networkd.service.html systemd.networkd man page]<br />
* [https://plus.google.com/u/0/+TomGundersen/posts Tom Gundersen, main systemd-networkd developer, G+ home page]<br />
* [https://coreos.com/blog/intro-to-systemd-networkd/ Tom Gundersen posts on Core OS blog]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Systemd-networkd&diff=326677Systemd-networkd2014-07-25T13:31:40Z<p>Reventlov: </p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Network managers]]<br />
[[Category:Virtualization]]<br />
[[fr:systemd-networkd]]<br />
[[ja:systemd-networkd]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd-nspawn}}<br />
{{Related|Network bridge}}<br />
{{Related|Network configuration}}<br />
{{Related|Wireless network configuration}}<br />
{{Related|:Category:Network managers}}<br />
{{Related articles end}}<br />
<br />
As of version 210, systemd now includes support for basic network configuration through [[udev]] and networkd.<br />
<br />
''systemd-networkd'' is a system daemon that manages network configuration. It detects and configures network devices as they appear, as well as creates virtual network devices. This service can run alongside your usual network management tool like [[netctl]] or even replace it for some configurations when it comes to virtualization. This service can especially be very useful to setup basic or more complex network settings (static IP, bridge,vlan...) for a container managed by [[systemd-nspawn]].<br />
<br />
It is not intended to configure low-level settings of network interfaces as this remains [[udev]]'s job.<br />
<br />
networkd is intended for simple setups such as VMs or containers, but also works fine on Ethernet connections. It has no support for WiFi but can be used with [[wpa_supplicant]] to manage wireless connection.<br />
<br />
{{Note|Systemd-networkd is under heavy development, be sure to check for the changes of configuration syntax/new features at every update. Suscribing to the systemd mailing list is recommended}}<br />
<br />
== Installation ==<br />
<br />
The service is available with {{Pkg|systemd}} >= 210. You will want to [[systemd#Basic systemctl usage|enable and start]] the {{ic|systemd-networkd.service}} on the host and container.<br />
<br />
For debugging purposes, it is strongly advised to [[pacman|install]] the {{Pkg|bridge-utils}}, {{Pkg|net-tools}} and {{Pkg|iproute2}} packages.<br />
<br />
Depending on your networking set-up, you will need to modify the {{ic|systemd-nspawn@.service}} and append to the {{ic|ExecStart}} line some boot options. Please refer to {{ic|systemd-nspawn(1)}} for an exhaustive list of options.<br />
<br />
Note that if you want to take advantage of automatic DNS configuration from DHCP, you need to enable {{ic|systemd-resolved}} and symlink {{ic|/run/systemd/resolve/resolv.conf}} to {{ic|/etc/resolv.conf}}. See {{ic|systemd-resolved.service(8)}} for more details.<br />
<br />
== Configuration files ==<br />
<br />
Configuration files will be read from {{ic|/usr/lib/systemd/network}}, the volatile runtime network directory {{ic|/run/systemd/network}} and the local administration network directory {{ic|/etc/systemd/network}}. Files in {{ic|/etc/systemd/network}} have the highest priority.<br />
<br />
There are three types of configuration files. <br />
<br />
* '''.network''' files. They will apply a network configuration for a ''matching'' device<br />
* '''.netdev''' files. They will create a ''virtual network device'' for a ''matching'' environment<br />
* '''.link''' files. When a network device appears, [[udev]] will look for the first ''matching'' '''.link''' file<br />
<br />
They all follow the same rules: <br />
<br />
* If '''all''' conditions in the {{ic|[Match]}} section are matched, the profile will be activated<br />
* an empty {{ic|[Match]}} section means the profile will apply in any case (can be compared to the {{ic|*}} joker)<br />
* each entry is a key with the {{ic|1=NAME=VALUE}} syntax <br />
* all configuration files are collectively sorted and processed in lexical order, regardless of the directory in which they live<br />
* files with identical name replace each other<br />
<br />
{{Tip|<br />
* to override a system-supplied file in {{ic|/usr/lib/systemd/network}} in a permanent manner (i.e even after upgrade), place a file with same name in {{ic|/etc/systemd/network}} and symlink it to {{ic|/dev/null}}<br />
* the {{ic|*}} joker can be used in {{ic|VALUE}} (e.g {{ic|en*}} will match any Ethernet device)<br />
* following this [https://mailman.archlinux.org/pipermail/arch-general/2014-March/035381.html Arch-general thread], the best practice is to setup specific container network settings ''inside the container'' with '''networkd''' configuration files.<br />
}}<br />
<br />
=== network files ===<br />
<br />
These files are aimed at setting network configuration variables, especially for servers and containers.<br />
<br />
Below is a basic structure of a ''MyProfile''.network file:<br />
<br />
{{hc|/etc/systemd/network/''MyProfile''.network|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Network]<br />
''a vertical list of keys''<br />
<br />
[Address]<br />
''a vertical list of keys''<br />
<br />
[Route]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} the device name (e.g Br0, enp4s0)<br />
* {{ic|1=Host=}} the machine hostname<br />
* {{ic|1=Virtualization=}} check whether the system is executed in a virtualized environment or not. A {{ic|1=Virtualization=no}} key will only apply on your host machine, while {{ic|1=Virtualization=yes}} apply to any container or VM.<br />
<br />
==== [Network] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=DHCP=}} is a Boolean. When set to {{ic|true}} it enables a basic [[Wikipedia:Dynamic Host Configuration Protocol|DHCPv4]] support.<br />
* {{ic|1=DNS=}} is a [[Wikipedia:Domain Name System|DNS]] server address. You can specify this option more than once<br />
* {{ic|1=Bridge=}} is the name of the bridge to add the link to<br />
<br />
==== [Address] section ====<br />
Most common key in the {{ic|[Address]}} section is:<br />
<br />
* {{ic|1=Address=}} is a static '''IPv4''' or '''IPv6''' address and its prefix length, separated by a {{ic|/}} character (e.g {{ic|192.168.1.90/24}}). This option is '''mandatory'''<br />
<br />
==== [Route] section ====<br />
Most common key in the {{ic|[Route]}} section is:<br />
<br />
* {{ic|1=Gateway=}} is the address of your machine gateway. This option is '''mandatory'''<br />
For an exhaustive key list, please refer to {{ic|systemd.network(5)}}<br />
<br />
{{Tip|you can put the {{ic|1=Address=}} and {{ic|1=Gateway=}} keys in the {{ic|[Network]}} section as a short-hand if {{ic|1=Address=}} contains only an Address key and {{ic|1=Gateway=}} section contains only a Gateway key<br />
}}<br />
<br />
=== netdev files ===<br />
<br />
These files will create virtual network devices.<br />
<br />
Below is a basic structure of a ''Mydevice''.netdev file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.netdev|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Netdev]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=Host=}} and {{ic|1=Virtualization=}}<br />
<br />
==== [Netdev] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} is the interface name used when creating the netdev. This option is '''compulsory'''<br />
* {{ic|1=Kind=}} is the netdev kind. Currently, ''bridge'', ''bond'', ''vlan'' and ''macvlan'' are supported. This option is '''compulsory'''<br />
<br />
For an exhaustive key list, please refer to {{ic|systemd.netdev(5)}}<br />
<br />
=== link files ===<br />
<br />
These files are an alternative to custom udev rules and will be applied by [[udev]] as the device appears.<br />
<br />
Below is a basic structure of a ''Mydevice''.link file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.link|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Link]<br />
''a vertical list of keys''<br />
}}<br />
<br />
The {{ic|[Match]}} section will determine if a given link file may be applied to a given device, when the {{ic|[Link]}} section specifies the device configuration.<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=MACADRESS=}}, {{ic|1=Host=}} and {{ic|1=Virtualization=}}.<br />
<br />
{{ic|1=Type=}} is the device type (e.g. vlan)<br />
<br />
==== [Link] section ====<br />
<br />
Most common keys are:<br />
<br />
{{ic|1=MACAddressPolicy=}} is either ''persistent'' when the hardware has a persistent MAC address (as most hardware should) or ''random'' , which allows to give a random MAC address when the device appears.<br />
<br />
{{ic|1=MACAddress=}} shall be used when no {{ic|1=MACAddressPoicy=}} is specified.<br />
<br />
{{Note|the system {{ic|/usr/lib/systemd/network/99-default.link}} is generally sufficient for most of the basic cases.}}<br />
<br />
== Usage ==<br />
<br />
{{Tip|before you start to configure your container network, it is useful to:<br />
* disable all your [[netctl]] services. This will avoid any potential conflicts with '''systemd-networkd''' and make all your configurations easier to test. Furthermore, odds are high you will end with few or even no [[netctl]] activated profiles. The {{ic|$ netctl list}} command will output a list of all your profiles, with the activated one being starred.<br />
* disable {{ic|systemd-nspawn@.service}} and use the {{ic|# systemd-nspawn -bD /path_to/your_container/}} command with some more options to boot the container. To log off and shutdown, run inside the container {{ic|# systemctl poweroff}}. Once your network setting met your requirements, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-nspawn@.service}}<br />
* disable {{ic|dhcpcd.service}} if enabled on your system. This service apply dhcpcd on '''all''' interfaces<br />
* make sure you have no [[netctl]] profiles activated on your container, nor the {{ic|systemd-networkd.service}} enabled and started<br />
* make sure you don't have any [[iptables]] rules which can block traffic<br />
* make sure ''packet forwarding'' is [[Internet sharing|enabled]] if you plan to set up a ''private network'' on your container<br />
* after any configuration files, reload the networkd daemon when running {{ic|# systemctl restart systemd-networkd}}<br />
}}<br />
<br />
{{Note|For the set-up described below, <br />
* we will limit the output of the {{ic|$ ip a}} command to the concerned interfaces<br />
* we assume the ''host'' is your main OS you are booting to and the ''container'' is your guest virtual machine<br />
* all interface names and IP adresses are only examples<br />
}}<br />
<br />
=== Basic DHCP network ===<br />
<br />
This set up will enable a DHCP IP for host and container. In this case, both systems will share the same IP as they share the same interfaces.<br />
<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
DHCP=yes<br />
</nowiki>}}<br />
<br />
You can of course replace {{ic|en*}} by the full name of your Ethernet device given by the output of the {{ic|$ ip link}} command.<br />
<br />
* on host and container:<br />
<br />
{{hc|$ ip a|<br />
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.72/24 brd 192.168.1.255 scope global enp7s0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
By default hostname received from the DHCP server will be used as the transient hostname.<br />
<br />
To change it add {{ic|1=UseHostname=false}} in section {{ic|[DHCPv4]}}<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[DHCPv4]<br />
UseHostname=false<br />
</nowiki>}}<br />
<br />
If you did not want configure a DNS in {{ic|/etc/resolv.conf}} and want to rely on DHCP for setting it up, you need to enable {{ic|systemd-resolved}} and symlink {{ic|/run/systemd/resolve/resolv.conf}} to {{ic|/etc/resolv.conf}}. See {{ic|systemd-resolved.service(8)}} for more details.<br />
<br />
$ systemctl enable systemd-resolved<br />
$ ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf<br />
<br />
=== DHCP with two distinct IP ===<br />
<br />
==== Bridge interface ====<br />
<br />
Create a virtual bridge interface <br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.netdev|<nowiki><br />
[NetDev]<br />
Name=br0<br />
Kind=bridge<br />
</nowiki>}}<br />
<br />
* on host and container:<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default <br />
link/ether ae:bd:35:ea:0c:c9 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Note that the interface br0 is listed but is DOWN.<br />
<br />
==== Bind Ethernet to Bridge ====<br />
<br />
Modify the {{ic|/etc/systemd/network/''MyDhcp''.network}} to remove the DHCP, as the bridge requires an interface to bind to with no IP, and add a key to bind this device to br0. Let's change its name to a more relevant one.<br />
<br />
{{hc|/etc/systemd/network/''MyEth''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
Bridge=br0<br />
</nowiki>}}<br />
<br />
==== Bridge network ====<br />
<br />
Create a network profile for the Bridge<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DHCP=yes<br />
</nowiki>}}<br />
<br />
==== Add option to boot the container ====<br />
<br />
As we want to give a separate IP for host and container, we need to ''Disconnect'' networking of the container from the host. To do this, add this option {{ic|1=--network-bridge=br0}} to your container boot command.<br />
<br />
# systemd-nspawn --network-bridge&#61;br0 -bD /path_to/my_container<br />
<br />
==== Result ====<br />
<br />
* on host<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default <br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.87/24 brd 192.168.1.255 scope global br0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
6: vb-''MyContainer'': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000<br />
link/ether d2:7c:97:97:37:25 brd ff:ff:ff:ff:ff:ff<br />
inet6 fe80::d07c:97ff:fe97:3725/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip a|<br />
2: host0: <BROADCAST,MULTICAST,ALLMULTI,AUTOMEDIA,NOTRAILERS,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 5e:96:85:83:a8:5d brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.73/24 brd 192.168.1.255 scope global host0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::5c96:85ff:fe83:a85d/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
==== Notice ====<br />
<br />
* we have now one IP address for Br0 on the host, and one for host0 in the container<br />
* two new interfaces have appeared: {{ic|vb-''MyContainer''}} in the host and {{ic|host0}} in the container. This comes as a result of the {{ic|1=--network-bridge=br0}} option. This option ''implies'' another option, {{ic|--network-veth}}. This means a ''virtual Ethernet link'' has been created between host and container.<br />
* the DHCP address on {{ic|host0}} comes from the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file.<br />
* on host<br />
<br />
{{hc|$ brctl show|<br />
bridge name bridge id STP enabled interfaces<br />
br0 8000.14dae9b57a88 no enp7s0<br />
vb-''MyContainer''<br />
}}<br />
<br />
the above command output confirms we have a bridge with two interfaces binded to.<br />
<br />
* on host<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev br0 <br />
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.87<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev host0 <br />
192.168.1.0/24 dev host0 proto kernel scope link src 192.168.1.73<br />
}}<br />
<br />
the above command outputs confirm we have activated {{ic|br0}} and {{ic|host0}} interfaces with an IP address and Gateway 192.168.1.254. The gateway address has been automatically grabbed by ''systemd-networkd''<br />
<br />
{{hc|$ cat /run/systemd/resolve/resolv.conf|<br />
nameserver 192.168.1.254<br />
}}<br />
<br />
=== Static IP network ===<br />
<br />
Setting a static IP for each device can be helpful in case of deployed web services (e.g FTP, http, SSH). Each device will keep the same MAC address across reboots if your system {{ic|/usr/lib/systemd/network/99-default.link}} file has the {{ic|1=MACAdressPolicy=persistent}} option (it has by default). Thus, you will easily route any service on your Gateway to the desired device.<br />
First, we shall get rid of the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file. To do it in a permanent way (e.g even after upgrades), do the following on '''both''' host and container. This will mask the file {{ic|/usr/lib/systemd/network/80-container-host0.network}} since files of the same name in /etc/systemd/network take priority over /usr/lib/systemd/network.<br />
<br />
# ln -sf /dev/null /etc/systemd/network/80-container-host0.network<br />
<br />
Then, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-networkd}} on your container.<br />
<br />
The needed configuration files:<br />
<br />
* on host <br />
<br />
/etc/systemd/network/''MyBridge''.netdev<br />
/etc/systemd/network/''MyEth''.network<br />
<br />
A modified ''MyBridge''.network<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.87/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
* on container<br />
<br />
{{hc|/etc/systemd/network/''MyVeth''.network|<nowiki><br />
[Match]<br />
Name=host0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.94/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
Et voila!<br />
<br />
== See also ==<br />
<br />
* [http://www.freedesktop.org/software/systemd/man/systemd-networkd.service.html systemd.networkd man page]<br />
* [https://plus.google.com/u/0/+TomGundersen/posts Tom Gundersen, main systemd-networkd developer, G+ home page]<br />
* [https://coreos.com/blog/intro-to-systemd-networkd/ Tom Gundersen posts on Core OS blog]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Acer_C720_Chromebook&diff=324644Acer C720 Chromebook2014-07-11T16:34:50Z<p>Reventlov: Added link to a photo of the screw</p>
<hr />
<div>[[Category:Acer]]<br />
[[ja:Acer C720 Chromebook]]<br />
[[zh-cn:Acer C720 Chromebook]]<br />
The Acer C720 Chromebook (and newer chromebooks in general) features a "legacy boot" mode that makes it easy to boot Linux and other operating systems. The legacy boot mode is provided by the [http://www.coreboot.org/SeaBIOS SeaBIOS] payload of coreboot. SeaBIOS behaves like a traditional BIOS that boots into the MBR of a disk, and from there into your standard bootloaders like Syslinux and GRUB.<br />
== Installation ==<br />
<br />
First enable legacy boot / SeaBIOS from the developer mode of Chrome OS. Then install and boot Linux as you would on a traditional x86 BIOS system.<br />
<br />
=== Enabling Developer Mode ===<br />
<br />
{{Warning|'''This will wipe all of your data!'''}}<br />
<br />
To enter developer mode: <br />
* Press and hold the {{ic|Esc+F3 (Refresh)}} keys, then press the {{ic|Power}} button. This enters recovery mode.<br />
* Now, press {{ic|Ctrl+D}} (no prompt). It will ask you to confirm, then the system will revert its state and enable developer mode.<br />
* Press {{ic|Ctrl+D}} (or wait 30 seconds for the beep and boot) at the white boot splash screen to enter Chrome OS.<br />
<br />
=== Enabling SeaBIOS ===<br />
<br />
After changing to developer mode, you need to get a superuser prompt. How you do this depends on whether you've configured Chrome OS or not.<br />
<br />
==== Superuser shell without Chrome OS configuration ====<br />
If you've never configured chromeos, just press {{ic|Ctrl+Alt+F2}} (F2 is the "Forward" arrow on the top row, →), you'll see a login prompt.<br />
<br />
* Use {{ic|chronos}} as the username, it should not prompt you for a password.<br />
* Become superuser with {{ic|sudo bash}}<br />
<br />
==== Supseruser shell with Chrome OS configuration ====<br />
If you have configured Chrome OS already:<br />
<br />
* Open a crosh window with {{ic|Ctrl+Alt+T}}.<br />
* Open a bash shell with the {{ic|shell}} command.<br />
* Become superuser with {{ic|sudo bash}}<br />
<br />
==== Enabling Legacy Bios ====<br />
Once you have your superuser shell:<br />
<br />
* Enable legacy boot with:<br />
# crossystem dev_boot_usb=1 dev_boot_legacy=1<br />
* Reboot the machine<br />
<br />
You can now start SeaBIOS by pressing {{ic|Ctrl-L}} at the white boot splash screen. If you want to make SeaBIOS default, you '''MUST''' first remove the write protect screw and then run:<br />
<br />
{{Warning|'''I'm serious! You HAVE to remove the write-protect screw first! Otherwise the system will be corrupted and you'll need to recover it. It's the number 7 in [http://www.chromium.org/_/rsrc/1381990807648/chromium-os/developer-information-for-chrome-os-devices/acer-c720-chromebook/c720-chromebook-annotated-innards.png this picture].'''}}<br />
<br />
# set_gbb_flags.sh 0×489<br />
<br />
=== Installing Arch Linux ===<br />
<br />
Create a [https://wiki.archlinux.org/index.php/USB_Flash_Installation_Media USB drive] with the Arch Linux installer. Plug the USB drive into the Chromebook, and start SeaBIOS with {{ic|Ctrl-L}} at the white boot splash screen. Press {{ic|Esc}} to get a boot menu and select the number corresponding to your USB drive. The Arch Linux installer boot menu should appear. Follow your favorite [https://wiki.archlinux.org/index.php/Beginners%27_Guide installation guide].<br />
<br />
A few installation notes:<br />
* For a 64-bit installation, use the 2013.10.01 ISO, and boot into the x86_64 installer with the {{ic|1=mem=1536m}} kernel option. (You can download torrent on [http://linuxtracker.org/index.php?page=torrent-details&id=4343552155062db9a7a05a10904f5c68f98b1216 linuxtracker.org] - See the comments for more http seeds as the torrent is nearly dead). Also, at this point, some of the PGP keys on the 2013.10.01 boot image have expired, you will need to update the package {{ic|archlinux-keyring}} before running {{ic|pacstrap}} (see source from forum [https://bbs.archlinux.org/viewtopic.php?pid=1425856#p1425856 here]).<br />
* A fresh DOS partition table on the SSD with one bootable 16GB root partition works. Note that this will wipe Chrome OS.<br />
* Choose [https://wiki.archlinux.org/index.php/Beginners%27_Guide#GRUB GRUB] as your bootloader, for now, instead of Syslinux.<br />
* After installing it's not Ctrl + D to boot OS it's Ctrl + L (To save you hours figuring out why you can't boot)<br />
<br />
=== Xorg Video Driver ===<br />
<br />
Use the {{ic|xf86-video-intel}} driver.<br />
<br />
$ sudo pacman -S xf86-video-intel<br />
<br />
=== Touchpad Kernel Modules ===<br />
<br />
Enabling the touchpad currently requires building a set of patched Haswell Chromebook kernel modules. Fortunately, ChrUbuntu provides a script for automatically building and installing these modules: [http://goo.gl/kz917j cros-haswell-modules.sh]. A modified version for Arch Linux is available here: <br />
<br />
{{Warning|Do not use [http://pastebin.com/ pastebin.com]. It appears to be the most popular site but it is slow, full of adverts, formats the text badly (it will mess up your code) and many people can not even open the site due to aggressive spam filters.}}<br />
<br />
* [http://pastie.org/8540561 kernel <3.13]<br />
* [http://pastie.org/8763538 kernel 3.13]<br />
* [http://slexy.org/raw/s25RrdzOsQ kernel 3.14.0]<br />
* [http://pastie.org/9074242 kernel 3.14.1/3.14.2]<br />
<br />
If you are running this on a fresh install, you need to install the following packages before running the script.<br />
<br />
$ pacman -S wget sudo patch make gcc<br />
<br />
$ wget <nowiki>http://pastie.org/pastes/9074242/download</nowiki> -O cros-haswell-modules-archlinux.sh<br />
$ chmod +x cros-haswell-modules-archlinux.sh<br />
$ ./cros-haswell-modules-archlinux.sh<br />
<br />
====configuration====<br />
* Edit Xorg touchpad configuration file<br />
Add the Xorg touchpad configuration below for better usability (increases touchpad sensitivity).<br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-cros-touchpad.conf|<br />
Section "InputClass" <br />
Identifier "touchpad peppy cyapa" <br />
MatchIsTouchpad "on" <br />
MatchDevicePath "/dev/input/event*" <br />
MatchProduct "cyapa" <br />
Option "FingerLow" "10" <br />
Option "FingerHigh" "10" <br />
EndSection}}<br />
<br />
If you want to remove the "Right Click" behavior from the touchpad from the bottom right area (you can still right click with two finger clicks), you should comment out the following section from <code>/etc/X11/xorg.conf.d/50-synaptics.conf</code><br />
<br />
{{hc|/etc/X11/xorg.conf.d/50-synaptics.conf|<br />
#Section "InputClass"<br />
# Identifier "Default clickpad buttons"<br />
# MatchDriver "synaptics"<br />
# Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"<br />
# To disable the bottom edge area so the buttons only work as buttons,<br />
# not for movement, set the AreaBottomEdge<br />
# Option "AreaBottomEdge" "82%"<br />
#EndSection<br />
}} <br />
<br />
*Use graphical tool<br />
[[Touchpad_Synaptics#Graphical_tools | Synaptiks]] is a touchpad configuration and management tool for [[KDE]]. It provides a System Settings module to configure basic and advanced features of the touchpad. Although it is said to be currently unmaintained. and seems to crash under KDE 4.11, it works well with this Chromebook, KDE 4.12.2.<br />
Another untility, [https://aur.archlinux.org/packages/kcm_touchpad/ kcm_touchpad], does not work at all.<br />
<br />
Reboot for the touchpad to become operational.<br />
<br />
=== Touchscreen (C720P model) ===<br />
<br />
If you're using a touchscreen-enabled model (such as the C720P), you may use a modified version of the previous script to install patched modules for the touchscreen as well<br />
<br />
It is available here [http://pastie.org/8834223 cros-haswell-modules-archlinux.sh] (tested with Linux 3.13).<br />
For kernel 3.12 or earlier, the earlier script can be found [http://pastie.org/pastes/8581310 here]. For kernel 3.14, a script can be found [http://pastebin.com/hvPR5Hcp here].<br />
<br />
$ wget http://pastebin.com/download.php?i=hvPR5Hcp -O cros-haswell-modules-archlinux.sh && sed -i "s/\r//g" cros-haswell-modules-archlinux.sh<br />
$ chmod +x cros-haswell-modules-archlinux.sh<br />
$ ./cros-haswell-modules-archlinux.sh<br />
<br />
For Kernel 3.15 the above script has moved to a github repository. The script no longer uses the /tmp directory for downloading and compiling, so you'll have to clean up after using.<br />
<br />
$ git clone https://github.com/masmullin2000/arch-c720p.git<br />
$ cd arch-c720p.git<br />
$ sudo sh ./touch.sh<br />
<br />
=== Power Key and Lid Switch Handling ===<br />
<br />
==== Ignore using logind ====<br />
<br />
Out of the box, {{ic|systemd-logind}} will catch power key and lid switch events and handle them: it will do a poweroff on a power key press, and a suspend on a lid close. However, this policy might be a bit harsh given that the power key is an ordinary key at the top right of the keyboard that might be pressed accidentally.<br />
<br />
To configure logind to ignore power key presses and lid switches, add the lines to {{ic|logind.conf}} below.<br />
<br />
{{hc|head=/etc/systemd/logind.conf|<br />
output=HandlePowerKey=ignore<br />
HandleLidSwitch=ignore}}<br />
<br />
Then restart logind for the changes to take effect.<br />
<br />
$ sudo systemctl restart systemd-logind<br />
<br />
Power key and lid switch events will still be logged to journald by logind. See http://www.freedesktop.org/software/systemd/man/logind.conf.html for additional handling options.<br />
<br />
==== Fixing suspend ====<br />
<br />
The following are instructions to fix the suspend functionality. There have been a few [https://bbs.archlinux.org/viewtopic.php?pid=1364376#p1364376 alternatives] [https://bbs.archlinux.org/viewtopic.php?pid=1364521#p1364521 discussed] and those may work better for some.<br />
<br />
Create the following {{ic|cros-acpi-wakeup.conf}} file.<br />
<br />
{{hc|head=/etc/tmpfiles.d/cros-acpi-wakeup.conf|<br />
output=w /proc/acpi/wakeup - - - - EHCI<br />
w /proc/acpi/wakeup - - - - HDEF<br />
w /proc/acpi/wakeup - - - - XHCI<br />
w /proc/acpi/wakeup - - - - LID0<br />
w /proc/acpi/wakeup - - - - TPAD<br />
w /proc/acpi/wakeup - - - - TSCR}}<br />
<br />
Then, create the following {{ic|cros-sound-suspend.sh}} file. Only the ehci binding/unbinding lines are listed below; see the alternatives linked above for additional sound suspend handling if you experience issues.<br />
<br />
{{hc|head=/usr/lib/systemd/system-sleep/cros-sound-suspend.sh|<br />
output=<nowiki>#!/bin/bash<br />
case $1/$2 in<br />
pre/*)<br />
# Unbind ehci.<br />
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/unbind<br />
;;<br />
post/*)<br />
# Bind ehci.<br />
echo -n "0000:00:1d.0" | tee /sys/bus/pci/drivers/ehci-pci/bind<br />
;;<br />
esac</nowiki>}}<br />
<br />
Make sure to make the scrip executable:<br />
<code> # chmod +x /usr/lib/systemd/system-sleep/cros-sound-suspend.sh </code><br />
Then add the following kernel boot parameters. Different combinations have been mentioned, with {{ic|1=tpm_tis.force=1}} being the most important.<br />
<br />
{{hc|head=/etc/default/grub|<br />
output=GRUB_CMDLINE_LINUX_DEFAULT="quiet add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic"}}<br />
<br />
Then [[GRUB#Generating main configuration file|rebuild your grub config]].<br />
<br />
==== Improving WLAN and BT performance ====<br />
<br />
The C720 comes with a AR9462 WLAN+BT chip. Both Bluetooth and WiFi can use 2.4GHz, which can cause interference. You can enable bluetooth coexistence to improve the performance of the card. Additionally, you can enable power savings and antennae diversity to reduce power usage and boost performance:<br />
<br />
{{hc|/etc/modprobe.d/ath9k.conf|<br />
output=options ath9k btcoex_enable=1 ps_enable=1 bt_ant_diversity=1}}<br />
<br />
== Hotkeys == <br />
<br />
The c720 has function keys with [https://support.google.com/chromebook/answer/1047364?hl=en dedicated Chromebook shortcuts] within Chrome OS. By default these work as regular function keys, but they can be mapped to match their appearance.<br />
<br />
=== Sxhkd configuration ===<br />
<br />
Below is an [[Sxhkd]] configuration file that specifies behavior similar to the shortcut defaults in Chrome OS. Besides the sxhkd daemon, this requires [[Advanced Linux Sound Architecture|amixer]], {{Pkg|xorg-xbacklight}}, and {{Pkg|xautomation}}.<br />
<br />
{{hc|~/.config/sxhkd/sxhkdrc|<br />
# Web browser Back/Forward shortcuts<br />
{@F1,@F2}<br />
xte 'keydown Alt_L' 'key {Left,Right}' 'keyup Alt_L'<br />
<br />
# Web browser Refresh shortcut<br />
@F3<br />
xte 'keydown Control_L' 'key r' 'keyup Control_L'<br />
<br />
# Awesome WM maximize current window<br />
# Adjust as necessary for different window managers<br />
@F4<br />
xte 'keydown Super_L' 'key m' 'keyup Super_L'<br />
<br />
# Awesome WM move one desktop right<br />
@F5<br />
xte 'keydown Super_L' 'key Right' 'keyup Super_L'<br />
<br />
{F6,F7}<br />
xbacklight -{dec,inc} 10<br />
<br />
F8<br />
amixer set Master toggle<br />
<br />
{F9,F10}<br />
amixer set Master 10{-,+} unmute<br />
}}<br />
<br />
===xbindkeys configuration===<br />
There is another way to configure hot keys using [[xbindkeys]].Below is an [[xbindkeys]] configuration file that specifies behavior very similar to the shortcut defaults in Chrome OS. This requires [[Advanced Linux Sound Architecture|amixer]] and {{Pkg|xorg-xbacklight}}.Besides, [http://homepage3.nifty.com/tsato/xvkbd/ xvkbd] is needed for sending string (key shortcuts) to focus window. Some of the configuration comes from thread [https://bbs.archlinux.org/viewtopic.php?id=173418&p=3 vilefridge's xbindkeys configuration].<br />
<br />
{{hc|~/.xbindkeysrc|<br />
<br />
# Backward, Forward, Full Screen & Refresh is just for web browser<br />
#Backward<br />
"xvkbd -xsendevent -text "\A\[Left]""<br />
m:0x0 + c:67<br />
F1 <br />
<br />
#Full Screen<br />
"xvkbd -xsendevent -text "\[F11]""<br />
m:0x0 + c:70<br />
F4 <br />
<br />
#Forward<br />
"xvkbd -xsendevent -text "\A\[Right]""<br />
m:0x0 + c:68<br />
F2 <br />
<br />
#Refresh<br />
"xvkbd -xsendevent -text "\Cr""<br />
m:0x0 + c:69<br />
F3 <br />
<br />
# on ChromeBook, it "Enter Overview mode, which shows all windows (F5)", see also https://support.google.com/chromebook/answer/1047364?hl<br />
# here it work at KDE, it "Switch to next focused window", see also http://community.linuxmint.com/tutorial/view/47<br />
#Switch Window<br />
"xvkbd -xsendevent -text "\A\t""<br />
m:0x0 + c:71<br />
F5 <br />
<br />
#Backlight Down<br />
"xbacklight -dec 5"<br />
m:0x0 + c:72<br />
F6 <br />
<br />
#Backlight Up<br />
"xbacklight -inc 5"<br />
m:0x0 + c:73<br />
F7 <br />
<br />
#Mute<br />
"amixer set Master toggle"<br />
m:0x0 + c:74<br />
F8 <br />
<br />
#Decrease Volume<br />
"amixer set Master 5- unmute"<br />
m:0x0 + c:75<br />
F9 <br />
<br />
#Increase Volume<br />
"amixer set Master 5+ unmute"<br />
m:0x0 + c:76<br />
F10 <br />
<br />
# added Home, End, Pg Up, Pg Down, and Del keys using the Alt+arrow key combos<br />
#Delete<br />
"xvkbd -xsendevent -text '\[Delete]'"<br />
m:0x8 + c:22<br />
Alt + BackSpace <br />
<br />
#End<br />
"xvkbd -xsendevent -text '\[End]'"<br />
m:0x8 + c:114<br />
Alt + Right <br />
<br />
#Home<br />
"xvkbd -xsendevent -text '\[Home]'"<br />
m:0x8 + c:113<br />
Alt + Left <br />
<br />
#Page Down<br />
"xvkbd -xsendevent -text '\[Page_Down]'"<br />
m:0x8 + c:116<br />
Alt + Down <br />
<br />
#Page Up<br />
"xvkbd -xsendevent -text '\[Page_Up]'"<br />
m:0x8 + c:111<br />
Alt + Up <br />
<br />
#<br />
# End of xbindkeys configuration}}<br />
<br />
Once you're done configuring xbindkeys, edit your {{ic|~/.xinitrc}} and place <br />
xbindkeys<br />
<br />
before the line that starts your window manager or DE.<br />
<br />
== Audio ==<br />
Getting alsa to work with the C720 is as simple as creating or editing your <code>/etc/modprobe.d/alsa.conf</code> and adding the line<br />
{{hc|/etc/modprobe.d/alsa.conf|<br />
output=options snd_hda_intel index=1}}<br />
<br />
An alternate approach to getting alsa to work is by creating a .asoundrc file and pasting in the following:<br />
<br />
{{hc|~/.asoundrc|<br />
# Standard<br />
pcm.!default {<br />
type hw<br />
card 1<br />
device 0<br />
}<br />
<br />
ctl.!default {<br />
type hw<br />
card 1<br />
}<br />
<br />
pcm_slave.slavej {<br />
pcm "hw:1"<br />
channels 2<br />
rate 44100<br />
}<br />
<br />
pcm.plugj {<br />
type plug<br />
slave slavej<br />
}<br />
<br />
# HDMI<br />
#pcm.!default {<br />
#type hw<br />
#card 1<br />
#device 3<br />
#}<br />
<br />
#ctl.!default {<br />
#type hw<br />
#card 0<br />
#}<br />
<br />
}}<br />
<br />
== Unresolved Issues ==<br />
<br />
* The 64-bit installer in Arch Linux installation ISOs newer than 2013.10.01 causes an immediate system reset<br />
* Syslinux fails to set the bootable flag with {{ic|syslinux-install_update -i -a -m}}. After setting the bootable flag manually in {{ic|fdisk}} and installing Syslinux to the MBR with {{ic|syslinux-install_update -i -m}}, SeaBIOS boots syslinux, but syslinux then complains about a missing OS. Use GRUB for now.</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Pacaur&diff=318617Pacaur2014-06-08T15:04:39Z<p>Reventlov: </p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Arch User Repository]]<br />
'''Pacaur''' is an [[Arch User Repository]] (AUR) [[AUR helpers|helper]] aiming at speed and simplicity, designed to minimize user prompt interaction and to use an uncluttered interface. It is written in Bash and built upon the well designed cower and expac C backends.<br />
<br />
{{note|Pacaur is targeted at '''advanced users''' who want some degree of automation for repetitive tasks. As such, the user is expected to be familiar with the [[Arch User Repository|manual build process]]. }}<br />
<br />
{{warning|The pacaur package in AUR won't receive maintenance apart from critical bugfix, and doesn't support split packages from AUR, which means it can fails to update your AUR packages. Use pacaur-git. See: [https://bbs.archlinux.org/viewtopic.php?pid&#61;1419825#p1419825] }}<br />
<br />
==Philosophy==<br />
<br />
Pacaur's main feature revolves around a ''fast workflow'' idea, that is, '''spending as little time as possible interacting with package management prompts'''. Speed, simplicity and the need for an uncluttered interface were also taken into consideration.<br />
<br />
Pacaur is:<br />
<br />
Fast<br />
* It minimizes user interaction.<br />
* It has very good performance with a small memory footprint.<br />
* It retrieves and edits all PKGBUILDs, solves all conflicts and asks about providers before building anything.<br />
<br />
Simple<br />
* It does not add a lot of features, but simply extends pacman to manage the AUR.<br />
* It is a small bash script using existing tiny libraries.<br />
* It is based on the libalpm C interface directly maintained by a pacman developer.<br />
<br />
Powerful<br />
* It can be used as a separate AUR frontend, or a single tool to manage official and AUR packages.<br />
* It prompts automatically for sudo password.<br />
* It searches with regex support (through cower).<br />
* It shows current and available versions when checking for updates.<br />
* It provides binary and AUR package names completion.<br />
* It detects possible malicious pseudocode in PKGBUILDs, and disposes of an additional full secured mode for paranoid people.<br />
<br />
==Installation==<br />
<!-- Please don't add direct commands to install pacaur. All users should be familiar with the build process. --><br />
<br />
The following binary dependencies need to be installed:<br />
* {{pkg|sudo}} [core]<br />
* {{pkg|expac}} [community]<br />
<br />
You can then install {{AUR|cower}} as a dependency, and then {{AUR|pacaur}} itself. Both of those packages are available in the [[Arch User Repository|AUR]].<br />
<br />
==Usage==<br />
<br />
Invoking pacaur consists of supplying an operation, any applicable options, and usually one or more targets.<br />
<br />
<pre><br />
usage: pacaur <operation> [options] [package(s)]<br />
operations:<br />
pacman extension<br />
-S, -Q extend pacman operations to the AUR<br />
AUR only<br />
-s, --search search AUR repository for matching strings<br />
-i, --info view package information -- pass twice for details<br />
-d, --download download target(s) -- pass twice to download AUR dependencies<br />
-m, --makepkg download and make target(s)<br />
-y, --sync download, make and install target(s)<br />
-k, --check check for AUR update(s)<br />
-u, --update update AUR package(s)<br />
general<br />
-v, --version display version information<br />
-h, --help display help information<br />
--fixbackend quickly rebuild backend<br />
<br />
options:<br />
pacman extension - can be used with the -S, -Ss, -Si, -Sii, -Sw, -Su, -Qu, -Sc, -Scc operations<br />
-a, --aur only search, install or clean packages from the AUR<br />
-r, --repo only search, install or clean packages from the repositories<br />
general<br />
-e, --edit edit target PKGBUILD -- can be combined with the -d, -m, -y, -u flags<br />
-c, --clean clean target(s) build files -- can be combined with the -m, -y, -u flags<br />
-q, --quiet show less information for query and search<br />
--devel consider AUR development packages upgrade<br />
--ignore ignore a package upgrade (can be used more than once)<br />
--noconfirm do not prompt for any confirmation<br />
--noedit do not prompt to edit files<br />
--rebuild always rebuild package<br />
</pre><br />
<br />
===Userbase target===<br />
<br />
Pacaur has two types of users in mind:<br />
* those who prefer to have one single tool to manage AUR and official repositories,<br />
* those who prefer to keep their AUR frontend separate from Pacman.<br />
<br />
As such there are two sets of commands: <br />
* commands that wrap the pacman binary (-S, -Ss, -Si, -Sw. -Su, -Qu, -Sc) and extend its functions to the AUR. This behavior can be disabled with the fallback variable in the config file.<br />
* commands that are AUR specific (-s, -i, -m, -y, -k, -u).<br />
<br />
===Example===<br />
<br />
By default, pacaur -Ss ''package'' will search the repo, then the AUR if necessary.<br />
<br />
$ pacaur -Ss expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
This behavior is optional and can be disabled with the ''fallback'' variable in the config file. When disabled, pacaur -Ss ''package'' will search the repo only.<br />
<br />
Also, pacaur -Ssr ''package'' will be restricted to searching in the repo only, while pacaur -Ssa ''package'' will search the AUR.<br />
<br />
$ pacaur -Ssr expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
<br />
$ pacaur -Ssa expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
pacaur -s ''package'' will search the AUR only.<br />
<br />
$ pacaur -s expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
==Configuration==<br />
<br />
Here are the available options in the config file:<br />
<pre><br />
#<br />
# /etc/xdg/pacaur/config<br />
#<br />
<br />
# The following options are commented out with their default values listed.<br />
# If you wish to use different values, uncomment and update the values.<br />
#builddir="${BUILDDIR:-$tmpdir}" # build directory<br />
#editor="${EDITOR:-vi}" # PKGBUILD editor<br />
#editpkgbuild=true # edit PKGBUILD script<br />
#editinstall=true # edit install script<br />
#fallback=true # pacman fallback to the AUR<br />
#clean=true # clean up after package install<br />
#cleandevel=true # clean up devel package<br />
#secure=false # enhanced security<br />
#sudoloop=false # prevent sudo timeout<br />
</pre><br />
<br />
See also '''man pacaur'''.<br />
<br />
=== Config files ===<br />
Pacaur fully honors pacman and makepkg configuration files, as well as the sudoers and cower config file (if existing).<br />
<br />
In particular, the following options in {{ic|/etc/pacman.conf}} can be used for further configuration:<br />
* '''Colors''' to enable colored output.<br />
* '''VerbosePkgLists''' to display the name, version and size of target packages formatted as a table.<br />
<br />
Note that pacman and makepkg '''environment variables''' ({{ic|$BUILDDIR}}, {{ic|$PKGDEST}}, {{ic|$PACMAN}}, ...) are fully honored.<br />
<br />
=== Sudo configuration ===<br />
Pacaur is designed to be used with [[sudo]] for minimal password prompting and your {{ic|/etc/sudoers}} should be configured accordingly.<br />
<br />
To avoid password prompt timeout (typically if you went grabbing a coffee while waiting the build to finish), disable it in your sudoers:<br />
<pre><br />
Defaults passwd_timeout=0<br />
</pre><br />
<br />
Alternatively, enable the '''sudoloop''' option in the config file.<br />
<br />
==Troubleshooting==<br />
<br />
===Host name error===<br />
When checking AUR packages for updates, pacaur outputs a lot of "Couldn't resolve host name" and "Timeout was reached" messages in spite of the internet line working correctly.<br />
* [[General recommendations#DNS_speed_improvement|Configure your DNS server]] to improve queries speed. Try using Google primary DNS (8.8.8.8 and 8.8.4.4).<br />
* Alternatively, tweak cower's config file to decrease the number of threads used in "MaxThread" variable.<br />
<br />
===Using gvim as editor===<br />
When using gvim as editor, gvim opens but the build continues. In the config file, try:<br />
<br />
<pre><br />
editor="gvim --nofork"<br />
</pre><br />
<br />
==Improving pacaur==<br />
<br />
===Internationalization===<br />
See [https://github.com/Spyhawk/pacaur/blob/master/po/HOWTO Internationalization howto].<br />
<br />
===Bug reports===<br />
When reporting problems, please:<br />
<br />
* check whether "makepkg -si" can build and install a package successfully. As pacaur relies exclusively on makepkg to build and install packages, the PKGBUILD must be corrected by its maintainer if makepkg fails.<br />
* check that the problem is reproducible, and is not caused by a misconfiguration of pacaur/pacman/makepkg/sudoers/etc.<br />
* post the ouput of "bash -x pacaur <your command>" in the [https://bbs.archlinux.org/viewtopic.php?pid=937423 forum thread] or on [https://github.com/Spyhawk/pacaur github] to help me debug the issue.<br />
<br />
===Feature requests===<br />
Pacaur is considered as being "feature complete" and will most probably not include any new features. However, any improvement request or patch will be considered, and might be implemented as long as the objectives of speed, simplicity, fast workflow, uncluttered interface and the Arch way are respected.<br />
<br />
==See also==<br />
* [http://spyhawk.github.com/pacaur/ Project page]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=937423 Forum page]<br />
* [https://github.com/Spyhawk/pacaur pacaur's github page]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Pacaur&diff=318615Pacaur2014-06-08T14:47:01Z<p>Reventlov: </p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Arch User Repository]]<br />
'''Pacaur''' is an [[Arch User Repository]] (AUR) [[AUR helpers|helper]] aiming at speed and simplicity, designed to minimize user prompt interaction and to use an uncluttered interface. It is written in Bash and built upon the well designed cower and expac C backends.<br />
<br />
{{note|Pacaur is targeted at '''advanced users''' who want some degree of automation for repetitive tasks. As such, the user is expected to be familiar with the [[Arch User Repository|manual build process]]. }}<br />
<br />
{{warning|As of today, 08 june 2014, pacaur doesn't support split packages from AUR, which means it can fails to update your AUR packages.<br />
<br />
Example: + note f 'Could not read elementary_test-git PKGBUILD: badly packaged tarball' }}<br />
<br />
==Philosophy==<br />
<br />
Pacaur's main feature revolves around a ''fast workflow'' idea, that is, '''spending as little time as possible interacting with package management prompts'''. Speed, simplicity and the need for an uncluttered interface were also taken into consideration.<br />
<br />
Pacaur is:<br />
<br />
Fast<br />
* It minimizes user interaction.<br />
* It has very good performance with a small memory footprint.<br />
* It retrieves and edits all PKGBUILDs, solves all conflicts and asks about providers before building anything.<br />
<br />
Simple<br />
* It does not add a lot of features, but simply extends pacman to manage the AUR.<br />
* It is a small bash script using existing tiny libraries.<br />
* It is based on the libalpm C interface directly maintained by a pacman developer.<br />
<br />
Powerful<br />
* It can be used as a separate AUR frontend, or a single tool to manage official and AUR packages.<br />
* It prompts automatically for sudo password.<br />
* It searches with regex support (through cower).<br />
* It shows current and available versions when checking for updates.<br />
* It provides binary and AUR package names completion.<br />
* It detects possible malicious pseudocode in PKGBUILDs, and disposes of an additional full secured mode for paranoid people.<br />
<br />
==Installation==<br />
<!-- Please don't add direct commands to install pacaur. All users should be familiar with the build process. --><br />
<br />
The following binary dependencies need to be installed:<br />
* {{pkg|sudo}} [core]<br />
* {{pkg|expac}} [community]<br />
<br />
You can then install {{AUR|cower}} as a dependency, and then {{AUR|pacaur}} itself. Both of those packages are available in the [[Arch User Repository|AUR]].<br />
<br />
==Usage==<br />
<br />
Invoking pacaur consists of supplying an operation, any applicable options, and usually one or more targets.<br />
<br />
<pre><br />
usage: pacaur <operation> [options] [package(s)]<br />
operations:<br />
pacman extension<br />
-S, -Q extend pacman operations to the AUR<br />
AUR only<br />
-s, --search search AUR repository for matching strings<br />
-i, --info view package information -- pass twice for details<br />
-d, --download download target(s) -- pass twice to download AUR dependencies<br />
-m, --makepkg download and make target(s)<br />
-y, --sync download, make and install target(s)<br />
-k, --check check for AUR update(s)<br />
-u, --update update AUR package(s)<br />
general<br />
-v, --version display version information<br />
-h, --help display help information<br />
--fixbackend quickly rebuild backend<br />
<br />
options:<br />
pacman extension - can be used with the -S, -Ss, -Si, -Sii, -Sw, -Su, -Qu, -Sc, -Scc operations<br />
-a, --aur only search, install or clean packages from the AUR<br />
-r, --repo only search, install or clean packages from the repositories<br />
general<br />
-e, --edit edit target PKGBUILD -- can be combined with the -d, -m, -y, -u flags<br />
-c, --clean clean target(s) build files -- can be combined with the -m, -y, -u flags<br />
-q, --quiet show less information for query and search<br />
--devel consider AUR development packages upgrade<br />
--ignore ignore a package upgrade (can be used more than once)<br />
--noconfirm do not prompt for any confirmation<br />
--noedit do not prompt to edit files<br />
--rebuild always rebuild package<br />
</pre><br />
<br />
===Userbase target===<br />
<br />
Pacaur has two types of users in mind:<br />
* those who prefer to have one single tool to manage AUR and official repositories,<br />
* those who prefer to keep their AUR frontend separate from Pacman.<br />
<br />
As such there are two sets of commands: <br />
* commands that wrap the pacman binary (-S, -Ss, -Si, -Sw. -Su, -Qu, -Sc) and extend its functions to the AUR. This behavior can be disabled with the fallback variable in the config file.<br />
* commands that are AUR specific (-s, -i, -m, -y, -k, -u).<br />
<br />
===Example===<br />
<br />
By default, pacaur -Ss ''package'' will search the repo, then the AUR if necessary.<br />
<br />
$ pacaur -Ss expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
This behavior is optional and can be disabled with the ''fallback'' variable in the config file. When disabled, pacaur -Ss ''package'' will search the repo only.<br />
<br />
Also, pacaur -Ssr ''package'' will be restricted to searching in the repo only, while pacaur -Ssa ''package'' will search the AUR.<br />
<br />
$ pacaur -Ssr expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
<br />
$ pacaur -Ssa expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
pacaur -s ''package'' will search the AUR only.<br />
<br />
$ pacaur -s expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
==Configuration==<br />
<br />
Here are the available options in the config file:<br />
<pre><br />
#<br />
# /etc/xdg/pacaur/config<br />
#<br />
<br />
# The following options are commented out with their default values listed.<br />
# If you wish to use different values, uncomment and update the values.<br />
#builddir="${BUILDDIR:-$tmpdir}" # build directory<br />
#editor="${EDITOR:-vi}" # PKGBUILD editor<br />
#editpkgbuild=true # edit PKGBUILD script<br />
#editinstall=true # edit install script<br />
#fallback=true # pacman fallback to the AUR<br />
#clean=true # clean up after package install<br />
#cleandevel=true # clean up devel package<br />
#secure=false # enhanced security<br />
#sudoloop=false # prevent sudo timeout<br />
</pre><br />
<br />
See also '''man pacaur'''.<br />
<br />
=== Config files ===<br />
Pacaur fully honors pacman and makepkg configuration files, as well as the sudoers and cower config file (if existing).<br />
<br />
In particular, the following options in {{ic|/etc/pacman.conf}} can be used for further configuration:<br />
* '''Colors''' to enable colored output.<br />
* '''VerbosePkgLists''' to display the name, version and size of target packages formatted as a table.<br />
<br />
Note that pacman and makepkg '''environment variables''' ({{ic|$BUILDDIR}}, {{ic|$PKGDEST}}, {{ic|$PACMAN}}, ...) are fully honored.<br />
<br />
=== Sudo configuration ===<br />
Pacaur is designed to be used with [[sudo]] for minimal password prompting and your {{ic|/etc/sudoers}} should be configured accordingly.<br />
<br />
To avoid password prompt timeout (typically if you went grabbing a coffee while waiting the build to finish), disable it in your sudoers:<br />
<pre><br />
Defaults passwd_timeout=0<br />
</pre><br />
<br />
Alternatively, enable the '''sudoloop''' option in the config file.<br />
<br />
==Troubleshooting==<br />
<br />
===Host name error===<br />
When checking AUR packages for updates, pacaur outputs a lot of "Couldn't resolve host name" and "Timeout was reached" messages in spite of the internet line working correctly.<br />
* [[General recommendations#DNS_speed_improvement|Configure your DNS server]] to improve queries speed. Try using Google primary DNS (8.8.8.8 and 8.8.4.4).<br />
* Alternatively, tweak cower's config file to decrease the number of threads used in "MaxThread" variable.<br />
<br />
===Using gvim as editor===<br />
When using gvim as editor, gvim opens but the build continues. In the config file, try:<br />
<br />
<pre><br />
editor="gvim --nofork"<br />
</pre><br />
<br />
==Improving pacaur==<br />
<br />
===Internationalization===<br />
See [https://github.com/Spyhawk/pacaur/blob/master/po/HOWTO Internationalization howto].<br />
<br />
===Bug reports===<br />
When reporting problems, please:<br />
<br />
* check whether "makepkg -si" can build and install a package successfully. As pacaur relies exclusively on makepkg to build and install packages, the PKGBUILD must be corrected by its maintainer if makepkg fails.<br />
* check that the problem is reproducible, and is not caused by a misconfiguration of pacaur/pacman/makepkg/sudoers/etc.<br />
* post the ouput of "bash -x pacaur <your command>" in the [https://bbs.archlinux.org/viewtopic.php?pid=937423 forum thread] or on [https://github.com/Spyhawk/pacaur github] to help me debug the issue.<br />
<br />
===Feature requests===<br />
Pacaur is considered as being "feature complete" and will most probably not include any new features. However, any improvement request or patch will be considered, and might be implemented as long as the objectives of speed, simplicity, fast workflow, uncluttered interface and the Arch way are respected.<br />
<br />
==See also==<br />
* [http://spyhawk.github.com/pacaur/ Project page]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=937423 Forum page]<br />
* [https://github.com/Spyhawk/pacaur pacaur's github page]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Pacaur&diff=318614Pacaur2014-06-08T14:46:50Z<p>Reventlov: </p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Arch User Repository]]<br />
'''Pacaur''' is an [[Arch User Repository]] (AUR) [[AUR helpers|helper]] aiming at speed and simplicity, designed to minimize user prompt interaction and to use an uncluttered interface. It is written in Bash and built upon the well designed cower and expac C backends.<br />
<br />
{{note|Pacaur is targeted at '''advanced users''' who want some degree of automation for repetitive tasks. As such, the user is expected to be familiar with the [[Arch User Repository|manual build process]]. }}<br />
<br />
{{warning|As of today, 08 june 2014, pacaur doesn't support split packages from AUR, which means it can fails to update your AUR packages.<br />
Example: + note f 'Could not read elementary_test-git PKGBUILD: badly packaged tarball' }}<br />
<br />
==Philosophy==<br />
<br />
Pacaur's main feature revolves around a ''fast workflow'' idea, that is, '''spending as little time as possible interacting with package management prompts'''. Speed, simplicity and the need for an uncluttered interface were also taken into consideration.<br />
<br />
Pacaur is:<br />
<br />
Fast<br />
* It minimizes user interaction.<br />
* It has very good performance with a small memory footprint.<br />
* It retrieves and edits all PKGBUILDs, solves all conflicts and asks about providers before building anything.<br />
<br />
Simple<br />
* It does not add a lot of features, but simply extends pacman to manage the AUR.<br />
* It is a small bash script using existing tiny libraries.<br />
* It is based on the libalpm C interface directly maintained by a pacman developer.<br />
<br />
Powerful<br />
* It can be used as a separate AUR frontend, or a single tool to manage official and AUR packages.<br />
* It prompts automatically for sudo password.<br />
* It searches with regex support (through cower).<br />
* It shows current and available versions when checking for updates.<br />
* It provides binary and AUR package names completion.<br />
* It detects possible malicious pseudocode in PKGBUILDs, and disposes of an additional full secured mode for paranoid people.<br />
<br />
==Installation==<br />
<!-- Please don't add direct commands to install pacaur. All users should be familiar with the build process. --><br />
<br />
The following binary dependencies need to be installed:<br />
* {{pkg|sudo}} [core]<br />
* {{pkg|expac}} [community]<br />
<br />
You can then install {{AUR|cower}} as a dependency, and then {{AUR|pacaur}} itself. Both of those packages are available in the [[Arch User Repository|AUR]].<br />
<br />
==Usage==<br />
<br />
Invoking pacaur consists of supplying an operation, any applicable options, and usually one or more targets.<br />
<br />
<pre><br />
usage: pacaur <operation> [options] [package(s)]<br />
operations:<br />
pacman extension<br />
-S, -Q extend pacman operations to the AUR<br />
AUR only<br />
-s, --search search AUR repository for matching strings<br />
-i, --info view package information -- pass twice for details<br />
-d, --download download target(s) -- pass twice to download AUR dependencies<br />
-m, --makepkg download and make target(s)<br />
-y, --sync download, make and install target(s)<br />
-k, --check check for AUR update(s)<br />
-u, --update update AUR package(s)<br />
general<br />
-v, --version display version information<br />
-h, --help display help information<br />
--fixbackend quickly rebuild backend<br />
<br />
options:<br />
pacman extension - can be used with the -S, -Ss, -Si, -Sii, -Sw, -Su, -Qu, -Sc, -Scc operations<br />
-a, --aur only search, install or clean packages from the AUR<br />
-r, --repo only search, install or clean packages from the repositories<br />
general<br />
-e, --edit edit target PKGBUILD -- can be combined with the -d, -m, -y, -u flags<br />
-c, --clean clean target(s) build files -- can be combined with the -m, -y, -u flags<br />
-q, --quiet show less information for query and search<br />
--devel consider AUR development packages upgrade<br />
--ignore ignore a package upgrade (can be used more than once)<br />
--noconfirm do not prompt for any confirmation<br />
--noedit do not prompt to edit files<br />
--rebuild always rebuild package<br />
</pre><br />
<br />
===Userbase target===<br />
<br />
Pacaur has two types of users in mind:<br />
* those who prefer to have one single tool to manage AUR and official repositories,<br />
* those who prefer to keep their AUR frontend separate from Pacman.<br />
<br />
As such there are two sets of commands: <br />
* commands that wrap the pacman binary (-S, -Ss, -Si, -Sw. -Su, -Qu, -Sc) and extend its functions to the AUR. This behavior can be disabled with the fallback variable in the config file.<br />
* commands that are AUR specific (-s, -i, -m, -y, -k, -u).<br />
<br />
===Example===<br />
<br />
By default, pacaur -Ss ''package'' will search the repo, then the AUR if necessary.<br />
<br />
$ pacaur -Ss expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
This behavior is optional and can be disabled with the ''fallback'' variable in the config file. When disabled, pacaur -Ss ''package'' will search the repo only.<br />
<br />
Also, pacaur -Ssr ''package'' will be restricted to searching in the repo only, while pacaur -Ssa ''package'' will search the AUR.<br />
<br />
$ pacaur -Ssr expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
<br />
$ pacaur -Ssa expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
pacaur -s ''package'' will search the AUR only.<br />
<br />
$ pacaur -s expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
==Configuration==<br />
<br />
Here are the available options in the config file:<br />
<pre><br />
#<br />
# /etc/xdg/pacaur/config<br />
#<br />
<br />
# The following options are commented out with their default values listed.<br />
# If you wish to use different values, uncomment and update the values.<br />
#builddir="${BUILDDIR:-$tmpdir}" # build directory<br />
#editor="${EDITOR:-vi}" # PKGBUILD editor<br />
#editpkgbuild=true # edit PKGBUILD script<br />
#editinstall=true # edit install script<br />
#fallback=true # pacman fallback to the AUR<br />
#clean=true # clean up after package install<br />
#cleandevel=true # clean up devel package<br />
#secure=false # enhanced security<br />
#sudoloop=false # prevent sudo timeout<br />
</pre><br />
<br />
See also '''man pacaur'''.<br />
<br />
=== Config files ===<br />
Pacaur fully honors pacman and makepkg configuration files, as well as the sudoers and cower config file (if existing).<br />
<br />
In particular, the following options in {{ic|/etc/pacman.conf}} can be used for further configuration:<br />
* '''Colors''' to enable colored output.<br />
* '''VerbosePkgLists''' to display the name, version and size of target packages formatted as a table.<br />
<br />
Note that pacman and makepkg '''environment variables''' ({{ic|$BUILDDIR}}, {{ic|$PKGDEST}}, {{ic|$PACMAN}}, ...) are fully honored.<br />
<br />
=== Sudo configuration ===<br />
Pacaur is designed to be used with [[sudo]] for minimal password prompting and your {{ic|/etc/sudoers}} should be configured accordingly.<br />
<br />
To avoid password prompt timeout (typically if you went grabbing a coffee while waiting the build to finish), disable it in your sudoers:<br />
<pre><br />
Defaults passwd_timeout=0<br />
</pre><br />
<br />
Alternatively, enable the '''sudoloop''' option in the config file.<br />
<br />
==Troubleshooting==<br />
<br />
===Host name error===<br />
When checking AUR packages for updates, pacaur outputs a lot of "Couldn't resolve host name" and "Timeout was reached" messages in spite of the internet line working correctly.<br />
* [[General recommendations#DNS_speed_improvement|Configure your DNS server]] to improve queries speed. Try using Google primary DNS (8.8.8.8 and 8.8.4.4).<br />
* Alternatively, tweak cower's config file to decrease the number of threads used in "MaxThread" variable.<br />
<br />
===Using gvim as editor===<br />
When using gvim as editor, gvim opens but the build continues. In the config file, try:<br />
<br />
<pre><br />
editor="gvim --nofork"<br />
</pre><br />
<br />
==Improving pacaur==<br />
<br />
===Internationalization===<br />
See [https://github.com/Spyhawk/pacaur/blob/master/po/HOWTO Internationalization howto].<br />
<br />
===Bug reports===<br />
When reporting problems, please:<br />
<br />
* check whether "makepkg -si" can build and install a package successfully. As pacaur relies exclusively on makepkg to build and install packages, the PKGBUILD must be corrected by its maintainer if makepkg fails.<br />
* check that the problem is reproducible, and is not caused by a misconfiguration of pacaur/pacman/makepkg/sudoers/etc.<br />
* post the ouput of "bash -x pacaur <your command>" in the [https://bbs.archlinux.org/viewtopic.php?pid=937423 forum thread] or on [https://github.com/Spyhawk/pacaur github] to help me debug the issue.<br />
<br />
===Feature requests===<br />
Pacaur is considered as being "feature complete" and will most probably not include any new features. However, any improvement request or patch will be considered, and might be implemented as long as the objectives of speed, simplicity, fast workflow, uncluttered interface and the Arch way are respected.<br />
<br />
==See also==<br />
* [http://spyhawk.github.com/pacaur/ Project page]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=937423 Forum page]<br />
* [https://github.com/Spyhawk/pacaur pacaur's github page]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Systemd-networkd&diff=317587Systemd-networkd2014-06-01T16:35:55Z<p>Reventlov: </p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[Category:Virtualization]]<br />
[[ja:systemd-networkd]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd-nspawn}}<br />
{{Related|Network configuration}}<br />
{{Related|netctl}}<br />
{{Related|Bridge with netctl}}<br />
{{Related articles end}}<br />
<br />
As of version 210, systemd now includes support for basic network configuration through [[udev]] and networkd.<br />
<br />
''systemd-networkd'' is a system daemon that manages network configuration. It detects and configures network devices as they appear, as well as creates virtual network devices. This service can run alongside your usual network management tool like [[netctl]] or even replace it for some configurations when it comes to virtualization. This service can especially be very useful to setup basic or more complex network settings (static IP, bridge,vlan...) for a container managed by [[systemd-nspawn]].<br />
<br />
It is not intended to configure low-level settings of network interfaces as this remains [[udev]]'s job.<br />
<br />
networkd is intended for simple setups such as VMs or containers, but also works fine on Ethernet connections. It has no support for WiFi but can be used with wpa_supplicant to manage wireless connection.<br />
<br />
== Installation ==<br />
<br />
The service is available with {{Pkg|systemd}} >= 210. You will want to [[systemd#Basic systemctl usage|enable and start]] the {{ic|systemd-networkd.service}} on the host and container.<br />
<br />
For debugging purposes, it is strongly advised to [[pacman|install]] the {{Pkg|bridge-utils}}, {{Pkg|net-tools}} and {{Pkg|iproute2}} packages.<br />
<br />
Depending on your networking set-up, you will need to modify the {{ic|systemd-nspawn@.service}} and append to the {{ic|ExecStart}} line some boot options. Please refer to {{ic|systemd-nspawn(1)}} for an exhaustive list of options.<br />
<br />
== Configuration files ==<br />
<br />
Configuration files will be read from {{ic|/usr/lib/systemd/network}}, the volatile runtime network directory {{ic|/run/systemd/network}} and the local administration network directory {{ic|/etc/systemd/network}}. Files in {{ic|/etc/systemd/network}} have the highest priority.<br />
<br />
There are three types of configuration files. <br />
<br />
* '''.network''' files. They will apply a network configuration for a ''matching'' device<br />
* '''.netdev''' files. They will create a ''virtual network device'' for a ''matching'' environment<br />
* '''.link''' files. When a network device appears, [[udev]] will look for the first ''matching'' '''.link''' file<br />
<br />
They all follow the same rules: <br />
<br />
* If '''all''' conditions in the {{ic|[Match]}} section are matched, the profile will be activated<br />
* an empty {{ic|[Match]}} section means the profile will apply in any case (can be compared to the {{ic|*}} joker)<br />
* each entry is a key with the {{ic|1=NAME=VALUE}} syntax <br />
* all configuration files are collectively sorted and processed in lexical order, regardless of the directory in which they live<br />
* files with identical name replace each other<br />
<br />
{{Tip|<br />
* to override a system-supplied file in {{ic|/usr/lib/systemd/network}} in a permanent manner (i.e even after upgrade), place a file with same name in {{ic|/etc/systemd/network}} and symlink it to {{ic|/dev/null}}<br />
* the {{ic|*}} joker can be used in {{ic|VALUE}} (e.g {{ic|en*}} will match any Ethernet device)<br />
* following this [https://mailman.archlinux.org/pipermail/arch-general/2014-March/035381.html Arch-general thread], the best practice is to setup specific container network settings ''inside the container'' with '''networkd''' configuration files.<br />
}}<br />
<br />
=== network files ===<br />
<br />
These files are aimed at setting network configuration variables, especially for servers and containers.<br />
<br />
Below is a basic structure of a ''MyProfile''.network file:<br />
<br />
{{hc|/etc/systemd/network/''MyProfile''.network|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Network]<br />
''a vertical list of keys''<br />
<br />
[Address]<br />
''a vertical list of keys''<br />
<br />
[Route]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} the device name (e.g Br0, enp4s0)<br />
* {{ic|1=Host=}} the machine hostname<br />
* {{ic|1=Virtualization=}} check whether the system is executed in a virtualized environment or not. A {{ic|1=Virtualization=no}} key will only apply on your host machine, while {{ic|1=Virtualization=yes}} apply to any container or VM.<br />
<br />
==== [Network] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=DHCP=}} is a Boolean. When set to {{ic|true}} it enables a basic [[Wikipedia:Dynamic Host Configuration Protocol|DHCPv4]] support.<br />
* {{ic|1=DNS=}} is a [[Wikipedia:Domain Name System|DNS]] server address. You can specify this option more than once<br />
* {{ic|1=Bridge=}} is the name of the bridge to add the link to<br />
<br />
Most common key in the {{ic|[Address]}} section is:<br />
<br />
* {{ic|1=Address=}} is a static '''IPv4''' or '''IPv6''' address and its prefix length, separated by a {{ic|/}} character (e.g {{ic|192.168.1.90/24}}). This option is '''mandatory'''<br />
<br />
Most common key in the {{ic|[Route]}} section is:<br />
<br />
* {{ic|1=Gateway=}} is the address of your machine gateway. This option is '''mandatory'''<br />
For an exhaustive key list, please refer to {{ic|systemd.network(5)}}<br />
<br />
{{Tip|you can put the {{ic|1=Address=}} and {{ic|1=Gateway=}} keys in the {{ic|[Network]}} section as a short-hand if {{ic|1=Address=}} contains only an Address key and {{ic|1=Gateway=}} section contains only a Gateway key<br />
}}<br />
<br />
=== netdev files ===<br />
<br />
These files will create virtual network devices.<br />
<br />
Below is a basic structure of a ''Mydevice''.netdev file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.netdev|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Netdev]<br />
''a vertical list of keys''<br />
}}<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=Host=}} and {{ic|1=Virtualization=}}<br />
<br />
==== [Netdev] section ====<br />
<br />
Most common keys are:<br />
<br />
* {{ic|1=Name=}} is the interface name used when creating the netdev. This option is '''compulsory'''<br />
* {{ic|1=Kind=}} is the netdev kind. Currently, ''bridge'', ''bond'', ''vlan'' and ''macvlan'' are supported. This option is '''compulsory'''<br />
<br />
For an exhaustive key list, please refer to {{ic|systemd.netdev(5)}}<br />
<br />
=== link files ===<br />
<br />
These files are an alternative to custom udev rules and will be applied by [[udev]] as the device appears.<br />
<br />
Below is a basic structure of a ''Mydevice''.link file:<br />
<br />
{{hc|/etc/systemd/network/''MyDevice''.link|<br />
[Match]<br />
''a vertical list of keys''<br />
<br />
[Link]<br />
''a vertical list of keys''<br />
}}<br />
<br />
The {{ic|[Match]}} section will determine if a given link file may be applied to a given device, when the {{ic|[Link]}} section specifies the device configuration.<br />
<br />
==== [Match] section ====<br />
<br />
Most common keys are {{ic|1=MACADRESS=}}, {{ic|1=Host=}} and {{ic|1=Virtualization=}}.<br />
<br />
{{ic|1=Type=}} is the device type (e.g. vlan)<br />
<br />
==== [Link] section ====<br />
<br />
Most common keys are:<br />
<br />
{{ic|1=MACAddressPolicy=}} is either ''persistent'' when the hardware has a persistent MAC address (as most hardware should) or ''random'' , which allows to give a random MAC address when the device appears.<br />
<br />
{{ic|1=MACAddress=}} shall be used when no {{ic|1=MACAddressPoicy=}} is specified.<br />
<br />
{{Note|the system {{ic|/usr/lib/systemd/network/99-default.link}} is generally sufficient for most of the basic cases.}}<br />
<br />
== Usage ==<br />
<br />
{{Tip|before you start to configure your container network, it is useful to:<br />
* disable all your [[netctl]] services. This will avoid any potential conflicts with '''systemd-networkd''' and make all your configurations easier to test. Furthermore, odds are high you will end with few or even no [[netctl]] activated profiles. The {{ic|$ netctl list}} command will output a list of all your profiles, with the activated one being starred.<br />
* disable {{ic|systemd-nspawn@.service}} and use the {{ic|# systemd-nspawn -bD /path_to/your_container/}} command with some more options to boot the container. To log off and shutdown, run inside the container {{ic|# systemctl poweroff}}. Once your network setting met your requirements, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-nspawn@.service}}<br />
* disable {{ic|dhcpcd.service}} if enabled on your system. This service apply dhcpcd on '''all''' interfaces<br />
* make sure you have no [[netctl]] profiles activated on your container, nor the {{ic|systemd-networkd.service}} enabled and started<br />
* make sure you don't have any [[iptables]] rules which can block traffic<br />
* make sure ''packet forwarding'' is [[Internet sharing|enabled]] if you plan to set up a ''private network'' on your container<br />
* after any configuration files, reload the networkd daemon when running {{ic|# systemctl restart systemd-networkd}}<br />
}}<br />
<br />
{{Note|For the set-up described below, <br />
* we will limit the output of the {{ic|$ ip a}} command to the concerned interfaces<br />
* we assume the ''host'' is your main OS you are booting to and the ''container'' is your guest virtual machine<br />
* all interface names and IP adresses are only examples<br />
}}<br />
<br />
=== Basic DHCP network ===<br />
<br />
This set up will enable a DHCP IP for host and container. In this case, both systems will share the same IP as they share the same interfaces.<br />
<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
DHCP=yes<br />
</nowiki>}}<br />
<br />
You can of course replace {{ic|en*}} by the full name of your Ethernet device given by the output of the {{ic|$ ip link}} command.<br />
<br />
* on host and container:<br />
<br />
{{hc|$ ip a|<br />
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.72/24 brd 192.168.1.255 scope global enp7s0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
By default hostname received from the DHCP server will be used as the transient hostname.<br />
<br />
To change it add {{ic|1=UseHostname=false}} in section {{ic|[DHCPv4]}}<br />
{{hc|/etc/systemd/network/''MyDhcp''.network|<nowiki><br />
[DHCPv4]<br />
UseHostname=false<br />
</nowiki>}}<br />
<br />
=== DHCP with two distinct IP ===<br />
<br />
==== Bridge interface ====<br />
<br />
Create a virtual bridge interface <br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.netdev|<nowiki><br />
[NetDev]<br />
Name=br0<br />
Kind=bridge<br />
</nowiki>}}<br />
<br />
* on host and container:<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default <br />
link/ether ae:bd:35:ea:0c:c9 brd ff:ff:ff:ff:ff:ff<br />
}}<br />
<br />
Note that the interface br0 is listed but is DOWN.<br />
<br />
==== Bind Ethernet to Bridge ====<br />
<br />
Modify the {{ic|/etc/systemd/network/''MyDhcp''.network}} to remove the DHCP, as the bridge requires an interface to bind to with no IP, and add a key to bind this device to br0. Let's change its name to a more relevant one.<br />
<br />
{{hc|/etc/systemd/network/''MyEth''.network|<nowiki><br />
[Match]<br />
Name=en*<br />
<br />
[Network]<br />
Bridge=br0<br />
</nowiki>}}<br />
<br />
==== Bridge network ====<br />
<br />
Create a network profile for the Bridge<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DHCP=yes<br />
</nowiki>}}<br />
<br />
==== Add option to boot the container ====<br />
<br />
As we want to give a separate IP for host and container, we need to ''Disconnect'' networking of the container from the host. To do this, add this option {{ic|1=--network-bridge=br0}} to your container boot command.<br />
<br />
# systemd-nspawn --network-bridge&#61;br0 -bd /path_to/my_container<br />
<br />
==== Result ====<br />
<br />
* on host<br />
<br />
{{hc|$ ip a|<br />
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default <br />
link/ether 14:da:e9:b5:7a:88 brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.87/24 brd 192.168.1.255 scope global br0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::16da:e9ff:feb5:7a88/64 scope link <br />
valid_lft forever preferred_lft forever<br />
6: vb-''MyContainer'': <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000<br />
link/ether d2:7c:97:97:37:25 brd ff:ff:ff:ff:ff:ff<br />
inet6 fe80::d07c:97ff:fe97:3725/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip a|<br />
2: host0: <BROADCAST,MULTICAST,ALLMULTI,AUTOMEDIA,NOTRAILERS,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br />
link/ether 5e:96:85:83:a8:5d brd ff:ff:ff:ff:ff:ff<br />
inet 192.168.1.73/24 brd 192.168.1.255 scope global host0<br />
valid_lft forever preferred_lft forever<br />
inet6 fe80::5c96:85ff:fe83:a85d/64 scope link <br />
valid_lft forever preferred_lft forever<br />
}}<br />
<br />
==== Notice ====<br />
<br />
* we have now one IP address for Br0 on the host, and one for host0 in the container<br />
* two new interfaces have appeared: {{ic|vb-''MyContainer''}} in the host and {{ic|host0}} in the container. This comes as a result of the {{ic|1=--network-bridge=br0}} option. This option ''implies'' another option, {{ic|--network-veth}}. This means a ''virtual Ethernet link'' has been created between host and container.<br />
* the DHCP address on {{ic|host0}} comes from the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file.<br />
* on host<br />
<br />
{{hc|$ brctl show|<br />
bridge name bridge id STP enabled interfaces<br />
br0 8000.14dae9b57a88 no enp7s0<br />
vb-''MyContainer''<br />
}}<br />
<br />
the above command output confirms we have a bridge with two interfaces binded to.<br />
<br />
* on host<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev br0 <br />
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.87<br />
}}<br />
<br />
* on container<br />
<br />
{{hc|$ ip route|<br />
default via 192.168.1.254 dev host0 <br />
192.168.1.0/24 dev host0 proto kernel scope link src 192.168.1.73<br />
}}<br />
<br />
the above command outputs confirm we have activated {{ic|br0}} and {{ic|host0}} interfaces with an IP address and Gateway 192.168.1.254. The gateway address has been automatically grabbed by ''systemd-networkd''<br />
<br />
{{hc|$ cat /run/systemd/network/resolv.conf|<br />
nameserver 192.168.1.254<br />
}}<br />
<br />
=== Static IP network ===<br />
<br />
Setting a static IP for each device can be helpful in case of deployed web services (e.g FTP, http, SSH). Each device will keep the same MAC address across reboots if your system {{ic|/usr/lib/systemd/network/99-default.link}} file has the {{ic|1=MACAdressPolicy=persistent}} option (it has by default). Thus, you will easily route any service on your Gateway to the desired device.<br />
First, we shall get rid of the system {{ic|/usr/lib/systemd/network/80-container-host0.network}} file. To do it in a permanent way (e.g even after upgrades), do the following on '''both''' host and container.<br />
<br />
# cp /usr/lib/systemd/network/80-container-host0.network /etc/systemd/network<br />
# ln -sf /dev/null /etc/systemd/network/80-container-host0.network<br />
<br />
Then, [[systemd#Basic systemctl usage|enable and start]] {{ic|systemd-networkd}} on your container.<br />
<br />
The needed configuration files:<br />
<br />
* on host <br />
<br />
/etc/systemd/network/''MyBridge''.netdev<br />
/etc/systemd/network/''MyEth''.network<br />
<br />
A modified ''MyBridge''.network<br />
<br />
{{hc|/etc/systemd/network/''MyBridge''.network|<nowiki><br />
[Match]<br />
Name=br0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.87/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
* on container<br />
<br />
{{hc|/etc/systemd/network/''MyVeth''.network|<nowiki><br />
[Match]<br />
Name=host0<br />
<br />
[Network]<br />
DNS=192.168.1.254<br />
Address=192.168.1.94/24<br />
Gateway=192.168.1.254<br />
</nowiki>}}<br />
<br />
Et voila!<br />
<br />
== See also ==<br />
<br />
* [http://www.freedesktop.org/software/systemd/man/systemd-networkd.service.html systemd.networkd man page]<br />
* [https://plus.google.com/u/0/+TomGundersen/posts Tom Gundersen, main systemd-networkd developer, G+ home page]<br />
* [https://coreos.com/blog/intro-to-systemd-networkd/ Tom Gundersen posts on Core OS blog]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Arch_based_distributions_(active)&diff=311859Arch based distributions (active)2014-04-26T07:49:26Z<p>Reventlov: /* Manjaro Linux */ Manjaro is not "compatible" with arch at all</p>
<hr />
<div>[[Category:About Arch]]<br />
[[es:Arch Based Distributions (Active)]]<br />
[[fr:LiveCD]]<br />
[[it:ArchBang]]<br />
[[ja:Arch Based Distributions (Active)]]<br />
[[ru:Arch Based Distributions (Active)]]<br />
[[zh-CN:Arch Based Distributions (Active)]]<br />
See [[Arch based distributions (inactive)|Inactive distributions]] for distributions which are no longer maintained.<br />
<br />
==Specialty Distributions==<br />
=== alphaOS ===<br />
alphaOS is a simple and minimalistic Linux distribution for the x86-64 architecture, built using Linux Live Kit set of scripts developed by Tomas M. It is based on Arch Linux and uses pacman as the default package manager. This operating system features highly configurable and lightweight Openbox window manager. Modular by design, alphaOS makes it easy to add desired functionality.<br />
<br />
*Homepage: http://alphaos.tuxfamily.org<br />
*Forums: http://alphaos.tuxfamily.org/forum<br />
*Wiki: http://alphaos.tuxfamily.org/wiki<br />
*Screenshots: [http://alphaos.tuxfamily.org/forum/viewtopic.php?f=13&t=705 forum thread]<br />
*Softpedia Entry: [http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/ArchPup-96404.shtml http://linux.softpedia.com]<br />
<br />
=== Antergos ===<br />
Antergos is an elegant and very customizable system for desktop. It started life under the name of Cinnarch, combining the Cinnamon desktop with the Arch Linux distribution, but the project has moved on from its original goals and now offers a choice of several desktops, including GNOME 3 (default), Cinnamon, Razor-qt and Xfce.<br />
<br />
*Homepage: http://www.antergos.com/<br />
*Screenshots: http://antergos.com/gallery/screenshots-2/<br />
*About: http://antergos.com/about/<br />
*Forums: http://forum.antergos.com/<br />
*DistroWatch Entry: http://distrowatch.com/table.php?distribution=antergos<br />
<br />
=== ArchAssault ===<br />
ArchAssault, everything you love about Arch Linux but with the security professional and hackers in mind. Currently supporting i686, x86_64, armv6h, armv7h. You can use the installer ISO or just add the repo to your existing Arch Linux install. It is simple to add and remove the repo as you need and get back to a clean Vanilla Arch install. There is an ever growing list of tools and follow the Arch standards.<br />
<br />
The ARM line is to help you build the security devices of your dreams with many Open Source devices on the market. The project also supports some of the Open Source AutoPilot hardware out there. This will allow you to add a payload brain to your drones with ease and add capabilities.<br />
<br />
*Homepage: https://archassault.org<br />
*ISOs: https://sourceforge.net/projects/archassault/files/iso/<br />
*Wiki: http://wiki.archassault.org<br />
*Bug Tracker: https://bugs.archassault.org<br />
*GitHub: https://github.com/ArchAssault-Project<br />
*IRC: irc://irc.freenode.net/#ArchAssault<br />
<br />
=== ArchBang ===<br />
ArchBang LIVE CD = Arch Linux w/ Openbox (the name is inspired by CrunchBang Linux, which is Debian Linux w/ Openbox)<br />
<br />
*Homepage: http://www.archbang.org/<br />
*Forums: http://bbs.archbang.org/<br />
*Screenshot: http://archbang.org/wp-content/uploads/2011/10/2011-10-01-192203_1024x768_scrot.png<br />
*Wiki: http://wiki.archbang.org/<br />
*DistroWatch Entry: http://distrowatch.com/table.php?distribution=archbang<br />
<br />
=== ArchEX ===<br />
<br />
ArchEX, based on Arch Linux, is one of the Linux Live DVDs created by C.A. Exton, the desktop environment of which is LXDE. The latest release is ArchEX 2013 (130207) 64bit/32bit dual DVD.<br />
*Homepage: http://archex.exton.net/<br />
*Forums:<br />
*Screenshot: http://archex.exton.net/archex-2013/archex-2013-desktop.jpg<br />
*Wiki: <br />
*DistroWatch Entry: <br />
<br />
=== Arch Linux ARM ===<br />
<br />
[https://bbs.archlinux.org/viewtopic.php?id=117251 Arch Linux ARM is the new unified effort from PlugApps & ArchMobile].<br />
<br />
*Homepage: http://archlinuxarm.org/<br />
*Forums: http://archlinuxarm.org/forum/<br />
*Documentation: http://archlinuxarm.org/support<br />
*Screenshots:<br />
*DistroWatch Entry:<br />
<br />
=== archboot ===<br />
<br />
Archboot is designed for installation or rescue operations. It provides both the i686 and x86_64 architectures on one CD. It uses hwdetect and a different install script from the official Arch Linux install images. It runs in RAM using iniramfs, without any special filesystems like squashfs,<br />
thus it is limited to the RAM which is installed in your system.<br />
<br />
*Homepage: https://projects.archlinux.org/?p=archboot.git;a=summary<br />
*Forums: https://bbs.archlinux.org/<br />
*Documentation: ftp://ftp.archlinux.org/iso/archboot/Readme.txt<br />
*Screenshots: <br />
*DistroWatch Entry: <br />
<br />
=== BBQLinux ===<br />
<br />
BBQLinux is a user-friendly Linux distribution made for Android developers and everyone who prefers a ready-to-use system. It has everything on board to build AOSP or AOSP-based Distributions like OmniROM or CyanogenMod.<br />
The default desktop environment is "MATE". It is using vanilla Arch repos, the AUR and a BBQLinux specific repo.<br />
BBQLinux can be installed by booting the Live DVD and using our graphical Installer called "BBQLinux Installer". <br />
<br />
*Homepage: http://www.bbqlinux.org<br />
*Screenshots: http://bbqlinux.org/screenshots<br />
*Google+: https://plus.google.com/u/0/communities/106642342159578225975<br />
*DistroWatch Entry: -<br />
*IRC: #bbqlinux on freenode<br />
<br />
=== BlackArch Linux ===<br />
<br />
BlackArch Linux is a distribution for pentesters and security researchers. It<br />
sports over 600 tools and a live ISO with multiple window managers. The<br />
BlackArch package repository is compatible with normal/existing/your Arch<br />
installations.<br />
<br />
*Homepage http://blackarch.org/index.html<br />
*Github https://github.com/BlackArch/blackarch<br />
*Twitter https://twitter.com/blackarchlinux<br />
*IRC irc://irc.freenode.net/blackarch<br />
<br />
=== Bluestar Linux ===<br />
<br />
Bluestar Linux is targeted at the desktop and is mainly focused on providing a user-friendly KDE environment with a full suite of graphical tools and applications. Out-of-the-box, both editions provide multilingual support that spans the globe. The Bluestar Full Edition provides a complete development environment and an augmented multimedia, networking, graphics and office tool-set. Both editions also have correlated versions supporting the Intel GMA3600 (GMA500) GPU at a 1024x600 native resolution by default, and other resolutions via configuration. Although still under development, Bluestar Linux easily supports everyday use, and changes and updates are documented on a regular basis. Fixes are always incorporated into subsequent releases which occur at least twice a month.<br />
<br />
*Homepage: http://bluestarlinux.org/<br />
*Forums: http://bluestarlinux.org/index.php?action=forum<br />
*Documentation: http://bluestarlinux.org/index.php?action=articles<br />
*Screenshots: http://bluestarlinux.org/index.php?action=gallery<br />
*DistroWatch Entry: TBA<br />
<br />
=== Bridge Linux ===<br />
<br />
Bridge Linux is an Arch-based distro providing a workable OS out-of-the-box, while still using vanilla Arch repos and the AUR. Possible desktop environments at this time are LXDE, Openbox, GNOME, Cinnamon, Xfce, and KDE.<br />
<br />
*Homepage: http://millertechnologies.net<br />
*Forums: http://millertechnologies.net/forum<br />
*Screenshots: https://sourceforge.net/projects/bridgelinux/<br />
<br />
=== CDN Linux ===<br />
<br />
CDN Linux is a system based on Arch GNU/Linux. CDN is designed to servers and routers. It is developed by Polish Freesco Group.<br />
<br />
*Homepage: http://cdn.freesco.pl {{Dead link|2014|03|17}}<br />
*Forums: http://forum.freesco.pl<br />
*Documentation: http://cdn.freesco.pl {{Dead link|2014|03|17}}<br />
*Screenshots: http://cdn.freesco.pl {{Dead link|2014|03|17}}<br />
<br />
=== Chakra ===<br />
<br />
"''Our goal with Chakra is to provide an operating system for desktops that is easy to use, but still has all the functionality, clarity, power and speediness of a KISS operating system. In the long term, we want to build an operating system based on Arch Linux that meets most requirements desktop users have today, like easy installation of software, graphical system administration, configuring power management on mobile devices, or sharing an internet connection.''"<br><br />
:<small>Source: [http://chakraos.org/about.html The Chakra Project - About]</small><br />
<br />
Chakra is a distribution heavily geared towards KDE4. The fresh install is GTK-free. All GTK apps are installed in a sandbox-like environment known as [http://chakra-linux.org/bundles.html bundles]. The project seeks for ease of use, using several home-grown graphical utilites for installing and maintanence. Warning: it is still under heavy development, nevertheless it is already suitable for everyday use. Expect some changes in the base system in the near future, like switching from Pacman to Akabei.<br />
<br />
*Homepage: http://chakraos.org/<br />
*Forums: http://chakraos.org/forum/<br />
*Documentation: http://chakraos.org/wiki/<br />
*Screenshots: http://chakraos.org/ {{Dead link|2014|03|17}}<br />
*DistroWatch Entry: http://distrowatch.com/table.php?distribution=chakra<br />
<br />
=== DidJiX ===<br />
<br />
DidJiX is the free and open source digital DJ software Mixxx (http://www.mixxx.org/) powered by the simple and lightweight distribution Linux ArchLinux (https://www.archlinux.org/) on a usb live system! DidJiX is build with the Archiso project ([[Archiso]])<br />
*Homepage: http://didjix.blogspot.com/<br />
*Forums: <br />
*Documentation: http://didjix.blogspot.com/ or https://bitbucket.org/patatetom/didjix/wiki<br />
*Screenshots: http://didjix.blogspot.com/<br />
*DistroWatch Entry:<br />
<br />
=== LinHES ===<br />
<br />
LinHES ('''Lin'''ux '''H'''ome '''E'''ntertainment '''S'''ystem) is a distro based heavily on Arch and centered around [http://mythtv.org MythTV], with the expressed goal of being a HES-appliance. Utilizing open source software and off the shelf hardware, you'll be able to assemble a box that can serve as a PVR, Jukebox, Image Viewer, and Game Station. Users can go from a blank hard drive to fully functional MythTV system in literally 15-20 min. For more information, please see the [[LinHES]] wikipage.<br />
<br />
*Homepage: http://www.linhes.org/<br />
*Forums: http://forum.linhes.org/<br />
*Documentation: http://www.linhes.org/<br />
*Screenshots: <br />
*DistroWatch Entry: http://distrowatch.com/table.php?distribution=linhes<br />
<br />
=== Manjaro Linux ===<br />
<br />
Manjaro Linux is a user friendly distribution based on the Xfce, KDE, and Openbox environments. The LXDE, Cinnamon, GNOME, i3, MATE and e17 environments are supported by the Community. It comes with a custom installer and additional scripts to install a preconfigured and out of the box working system.<br />
<br />
*Homepage: http://manjaro.org/<br />
*Forums: http://forum.manjaro.org/<br />
*Documentation: http://wiki.manjaro.org/<br />
*DistroWatch Entry: http://distrowatch.com/table.php?distribution=manjaro<br />
<br />
=== Mesk Linux ===<br />
<br />
Mesk Linux is a project aiming at showcasing Arch to Arabic-speaking users . The project is also working on localizing Arch tools and documentation, providing a varitey of installable live mediums (usb, dvds ... ). The distro is using OpenRC. <br />
<br />
*Homepage: http://www.mesklinux.org/<br />
*Forums: http://www.forum.mesklinux.org/<br />
*Documentation:<br />
*Screenshots:<br />
*DistroWatch Entry:<br />
<br />
=== Parabola GNU/Linux ===<br />
<br />
'''Parabola GNU/Linux''' is a fully free (as in freedom) rolling release distribution. It is approved by the [http://fsf.org FSF] and uses a Linux-libre kernel. The Parabola distro uses the Arch Repos and fully free replacements from the Libre Repo.<br />
<br />
*Homepage: http://parabolagnulinux.org<br />
*Wiki: http://wiki.parabolagnulinux.org<br />
*IRC: #parabola in Freenode<br />
<br />
== Meta Distributions ==<br />
<br />
=== archiso ===<br />
<br />
[[archiso]] is a very simple set of bash scripts that allow for building live bootable CD/DVD/USB images based on Arch Linux. It uses a small uncomplicated code base and is actively developed. archiso is the tool used by Arch Linux to generate the official CD/USB images. It is a very generic tool, so it could potentially be used to generate anything from rescue systems, to install disks, to special interest live systems, and who knows what else. Simply put, if it involves Arch on a shiny coaster, it can do it. <br />
<br />
*Homepage: https://projects.archlinux.org/?p=archiso.git;a=summary<br />
*Forums https://bbs.archlinux.org/viewtopic.php?id=73878<br />
*Documentation: [[archiso|wiki article on archlinux.org]]<br />
<br />
== Arch Influenced Distros ==<br />
<br />
===Alpine Linux===<br />
<br />
Alpine Linux is a run-from-RAM linux distribution. Its original target was small appliances like routers, VPN gateways, or embedded x86 devices. However, it supports hosting other Linux guest OSes under VServer control, making it an attractive hosting solution as well. Though Alpine Linux may not actually be based on Arch, its [http://git.alpinelinux.org/cgit/aports/tree/main/abuild/APKBUILD build system] is undoubtably inspired by Arch. [http://lists.busybox.net/pipermail/busybox/2009-January/068280.html 2][http://wiki.alpinelinux.org/w/index.php?title=Creating_an_Alpine_package&oldid=2701#depends_.26_makedepends 3]<br />
<br />
*Homepage: http://alpinelinux.org<br />
*Documentation: http://wiki.alpinelinux.org/w/index.php?title=Documentation<br />
<br />
=== Frugalware ===<br />
<br />
''"Frugalware Linux is a general-purpose Linux distribution designed for intermediate users who are familiar with command-line operations. It is based on Slackware, but uses a different package management system, Pacman."''<br><br />
:<small>Source: [[Wikipedia:Frugalware|Wikipedia]]</small><br />
<br />
*Homepage: http://frugalware.org<br />
*Forums: http://forums.frugalware.org<br />
*Documentation: http://frugalware.org/docs<br />
*Screenshots: http://frugalware.org/screenshots<br />
*DistroWatch Entry: http://distrowatch.com/frugalware<br />
<br />
=== KaOS ===<br />
<br />
''"The idea behind KaOS is to create a tightly integrated rolling and transparent distribution for the modern desktop, build from scratch with a very specific focus. Focus on one DE (KDE), one toolkit (Qt), one architecture (x86_64) plus a focus on evaluating and selecting the most suitable tools and applications. All work is geared toward packaging, not developing new tools or applications."''<br><br />
:<small>Source: [http://kaosx.us/ KaOS A lean KDE distribution]</small><br />
*Homepage: http://kaosx.us/<br />
*Forums: http://kaosx.us/phpBB3/<br />
*Documentation: http://kaosx.us/faq/<br />
*DistroWatch Entry: none yet<br />
<br />
== Recovery Distributions ==<br />
<br />
=== PoliArch ===<br />
''"PoliArch is an Italian distribution and live CD featuring a number of system rescue and data recovery tools. "''<br />
*Homepage: http://www.poliarch.org</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Install_bundled_32-bit_system_in_64-bit_system&diff=218950Install bundled 32-bit system in 64-bit system2012-08-21T17:31:35Z<p>Reventlov: </p>
<hr />
<div>[[Category:Arch64]]<br />
[[cs:32bit chroot]]<br />
[[fr:Install environnement 32 sur un systeme 64]]<br />
[[zh-CN:Install bundled 32-bit system in Arch64]]<br />
{{Article summary start}}<br />
{{Article summary text|<br />
This article presents one way of running 32-bit applications, which may be of use to those who do not wish to install the lib32-* libraries from the multilib repository and instead prefer to isolate 32bit applications. The approach involves creating a "chroot jail" to handle 32-bit apps.}}<br />
{{Article summary end}}<br />
<br />
==Install the Base 32-bit System==<br />
1. Create the directory:<br />
{{bc|mkdir /opt/arch32}}<br />
<br />
2. Generate temporary [[pacman]] configuration files for chroot:<br />
{{bc|sed -e 's/\$arch/i686/g' /etc/pacman.d/mirrorlist > /opt/arch32/mirrorlist<br />
sed -e 's@/etc/pacman.d/mirrorlist@/opt/arch32/mirrorlist@g' /etc/pacman.conf > /opt/arch32/pacman.conf}}<br />
These files would conflict with the normal pacman files, which will be installed in the later steps. For this reason they must be put ''into'' a temporary location ({{ic|/opt/arch32}} is used here). Remember to delete/comment the multilib repo, if you have enable it, in the {{ic|/opt/arch32/pacman.conf}} file<br />
<br />
The {{ic|--root}} switch in the pacman command below will create {{ic|/var/log/pacman.log}} and {{ic|/var/lib/pacman/db.lck}} inside {{ic|/opt/arch32}}. The pacman log will be {{ic|/opt/arch32/var/log/pacman.log}} and will ''not'' interfere with the native 64-bit installation. There is no need for a {{ic|LogFile}} directive in {{ic|/etc/pacman.conf}} or a {{ic|--logfile}} switch.<br />
<br />
The {{ic|--cachedir}} switch is for the package to be cached in {{ic|/opt/arch32/var/cache/pacman/pkg}} instead of {{ic|/var/cache/pacman/pkg}}.<br />
<br />
Use the {{ic|--config}} switch to tell pacman to use the configuration file generated above, rather than {{ic|/etc/pacman.conf}}.<br />
<br />
3. Create the directory, just to be sure:<br />
mkdir -p /opt/arch32/var/{cache/pacman/pkg,lib/pacman}<br />
<br />
3b. Edit 'Architecture' for pacman >= 3.4<br />
<br />
# In /opt/arch32/pacman.conf<br />
# Architecture=auto<br />
Architecture=i686<br />
<br />
3c. Users following the Arch installer method will have a line at the top of {{ic|/etc/pacman.d/mirrorlist}} similar to:<br />
{{bc|1=# Mirror used during installation<br />
Server = http://mirror.rit.edu/archlinux/$repo/os/x86_64}}<br />
<br />
The 'sed' command above searches for instances of '$arch' and replaces them with 'i686'. Unfortunately, since this installation mirror is explicitly set as x86_64, it is not replaced and will cause issues. Either comment it out or change it like so:<br />
{{bc|1=Server = http://mirror.rit.edu/archlinux/$repo/os/i686}}<br />
<br />
4. Sync pacman:<br />
pacman --root /opt/arch32 --cachedir /opt/arch32/var/cache/pacman/pkg --config /opt/arch32/pacman.conf -Sy<br />
<br />
5. Install the base and optionally base-devel groups:<br />
pacman --root /opt/arch32 --cachedir /opt/arch32/var/cache/pacman/pkg --config /opt/arch32/pacman.conf -S base base-devel<br />
{{Note|For minimal arch32 chroot installation following packages are sufficient: bash, coreutils, filesystem, grep, gzip, licenses, sed, pacman and file.}}<br />
<br />
<br />
Optionally remove the temporary pacman configuration files.<br />
<br />
rm /opt/arch32/{mirrorlist,pacman.conf}<br />
<br />
6. To use the newly installed pacman, uncomment some mirrors in {{ic|/opt/arch32/etc/pacman.d/mirrorlist}} and make any other desired changes to the new pacman installation. <br />
<br />
7. Edit your /opt/arch32/etc/pacman.conf and change that Architecture from auto back to i686.<br />
<br />
== Create an Arch32 Daemon Init Script ==<br />
<br />
{{Warning|This included script does not change anything outside the 32-bit directory. However, you will be creating hard links to your base system's configuration files and also mounting your home and other directories inside the 32-bit install directory. Thus, mistaken settings in the linked configuration files or carelessly removing all or part of the locally mounted directories can inflict catastrophic damage to your base system.}}<br />
<br />
To initiate the 32-bit environment at startup, create the following init script {{ic|/etc/rc.d/arch32}}:<br />
<br />
{{bc|<nowiki>#!/bin/bash<br />
<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
# Add '/var/run /var/lib/dbus' to the list to enable pulseaudio.<br />
dirs=(/dev /dev/pts /dev/shm /tmp /home)<br />
<br />
case $1 in<br />
start)<br />
stat_busy "Starting Arch32 chroot"<br />
for d in "${dirs[@]}"; do<br />
mount -o bind $d /opt/arch32$d<br />
done<br />
mount -t proc none /opt/arch32/proc<br />
mount -t sysfs none /opt/arch32/sys<br />
add_daemon arch32<br />
stat_done<br />
;;<br />
stop)<br />
stat_busy "Stopping Arch32 chroot"<br />
for (( i = ${#dirs[@]} - 1; i >= 0; i-- )); do<br />
umount "/opt/arch32${dirs[i]}"<br />
done<br />
umount /opt/arch32/{proc,sys}<br />
rm_daemon arch32<br />
stat_done<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
echo "usage: $0 {start|stop|restart}"<br />
esac<br />
exit 0</nowiki>}}<br />
A version of the script for Gentoo Linux (OpenRC) is available here: http://pastebin.com/kHt3440j<br />
<br />
Then allow execution of the script:<br />
chmod +x /etc/rc.d/arch32<br />
<br />
And add it to {{ic|/etc/rc.conf}}:<br />
DAEMONS=(syslog-ng network netfs '''arch32''' crond)<br />
<br />
==Configure the new system==<br />
===Configuration files===<br />
Key configuration files should be copied over:<br />
<br />
cd /opt/arch32/etc<br />
<br />
cp /etc/passwd* .<br />
cp /etc/shadow* .<br />
cp /etc/group* .<br />
cp /etc/sudoers . # note: you'll need to install sudo before creating this entry, or sudo will refuse to install<br />
<br />
cp /etc/rc.conf .<br />
cp /etc/resolv.conf .<br />
<br />
cp /etc/localtime .<br />
cp /etc/locale.gen .<br />
cp /etc/profile.d/locale.sh profile.d<br />
<br />
cp /etc/vimrc .<br />
cp /etc/mtab .<br />
cp /etc/sudoers .<br />
Be sure to include the "." character.<br />
<br />
=== Configure the chroot ===<br />
Chroot into the new system:<br />
/etc/rc.d/arch32 start<br />
xhost +SI:localuser:usernametogiveaccesstogoeshere <br />
chroot /opt/arch32<br />
<br />
It is recommended to use a custom bash prompt inside the 32-bit chroot installation in order to differentiate from the regular system. You can, for example, add a ''ARCH32'' string to the ''PS1'' variable defined in {{ic|~/.bashrc}}. In fact, the default Debian .bashrc prompt string contains appropriate logic to report whether the working directory is within a chroot.<br />
<br />
Before continuing, keep in mind that the file {{ic|/etc/pacman.conf}} from the 32-bit environment is the default one. Make sure to uncomment some mirrors in {{ic|/etc/pacman.d/mirrorlist}}.<br />
<br />
Fix possible locale issues:<br />
/usr/sbin/locale-gen<br />
<br />
Install the needed packages including apps, fonts, etc. for example:<br />
<br />
pacman -S acroread opera<br />
pacman -S firefox<br />
pacman -S flashplugin<br />
pacman -S mplayer-plugin<br />
<br />
Regain space by removing some unnecessary packages.<br />
<br />
{{Warning| This cleanup is for the '''32-bit''' root environment and must then be done inside it NOT the native 64-bit environment!}}<br />
<br />
The following shows recommended packages for removal:<br />
<br />
pacman -Rd linux mkinitcpio<br />
pacman -R dhcpcd ppp xfsprogs reiserfsprogs jfsutils syslog-ng logrotate lvm2 wpa_supplicant pcmciautils<br />
<br />
Also consider regularly clearing out pacman's cache:<br />
pacman -Scc<br />
<br />
== Install and Configure Schroot ==<br />
<br />
Install "schroot" to the native '''64-bit''' installation:<br />
pacman -S schroot<br />
<br />
Edit {{ic|/etc/schroot/schroot.conf}}, and create an ''[Arch32]'' section.<br />
<br />
[Arch32]<br />
type=directory<br />
script-config=arch32/config<br />
description=Arch32<br />
directory=/opt/arch32<br />
users=user1,user2,user3<br />
groups=users<br />
root-groups=root<br />
personality=linux32<br />
aliases=32,default<br />
<br />
Optionally edit {{ic|/etc/schroot/arch32/mount}} to match the mounts created within {{ic|/etc/rc.d/arch32}}.<br />
<br />
== Using Schroot to run a 32-bit application ==<br />
<br />
The general syntax for calling an application ''inside'' the chroot is:<br />
<br />
schroot -p -- htop<br />
<br />
In this example, htop is called from within the 32-bit environment.<br />
<br />
==Troubleshooting==<br />
<br />
===Compilation and installing===<br />
Ensure the desired options are set in the local {{ic|/etc/makepkg.conf}}.<br />
<br />
Some packages may require a {{ic|--host}} flag be added to the ./configure script in the PKBUILD:<br />
./configure --host="i686-pc-linux" ...<br />
This is the case when the build makes use of values (for example, the output of the {{ic|uname}} command) inherited from your base system.<br />
<br />
You may need to give users write access to your chroot's /dev/null to stop some scripts from failing:<br />
chmod 666 /dev/null<br />
<br />
===Video issues===<br />
If you get:<br />
X Error of failed request: BadLength (poly request too large or internal Xlib length error)<br />
while trying to run an application that requires video acceleration, make sure you have installed appropriate video drivers in your chroot. For example,<br />
pacman -S nvidia<br />
<br />
===Sound in flash (youtube, etc.)===<br />
<br />
To get sound from the flash player in Firefox, open a terminal and chroot inside the 32-bit system:<br />
chroot /opt/arch32<br />
<br />
From there, install alsa-oss:<br />
pacman -S alsa-oss<br />
<br />
Then type:<br />
export FIREFOX_DSP="aoss"<br />
<br />
Every chroot into the 32-bit system will require this export command to be entered so it may be best to incorporate it into a script.<br />
<br />
Finally, launch Firefox.<br />
<br />
For [[Wine]] this works the same way. The package alsa-oss will also install the alsa libs required by [[Wine]] to output sound.<br />
<br />
==Tips and tricks==<br />
===Java in a chroot===<br />
See [[Java]] for installation instructions.<br />
<br />
After installing, adjust the path to get Java working:<br />
export PATH="/opt/java/bin/:$PATH"<br />
===arch32-light===<br />
Xyne has created a package that installs a minimalist 32-bit chroot as described above. More information can be found [http://bbs.archlinux.org/viewtopic.php?id=97629 on the forum] and [http://xyne.archlinux.ca/projects/arch32-light on the project page].<br />
<br />
===Allowing 32-bit applications access to 64-bit Pulseaudio===<br />
<br />
Add these lines in {{ic|/etc/rc.d/arch32}}, above {{ic|add_daemon arch32}}:<br />
mount --bind /var/run /opt/arch32/var/run<br />
mount --bind /var/lib/dbus /opt/arch32/var/lib/dbus<br />
<br />
And above {{ic|rm_daemon arch32}}:<br />
umount /opt/arch32/var/run<br />
umount /opt/arch32/var/lib/dbus<br />
<br />
More information is available at the [[Pulseaudio]] article, especially the section on [http://wiki.archlinux.org/index.php/PulseAudio#Pulseaudio_from_within_a_chroot_.28ex._32-bit_chroot_in_64-bit_install.29 Pulseaudio from within a chroot].<br />
<br />
===Enabling sound in Firefox===<br />
Open a text editor and save the following in {{ic|/usr/bin/firefox32}} as root:<br />
#!/bin/sh<br />
schroot -p firefox $1;export FIREFOX_DSP="aoss"<br />
<br />
Make it executable:<br />
sudo chmod +x /usr/bin/firefox32<br />
<br />
Now you can make an alias for Firefox, if desired:<br />
alias firefox="firefox32"<br />
<br />
Add this to the end of file {{ic|~/.bashrc}} and source it to enable its usage. Or you can just change all your desktop environment's launchers to firefox32 if you still want 64-bit Firefox to be available.<br />
<br />
===Enabling 3D acceleration===<br />
In case you want to run any 32 bit application under your chroot with 3D acceleration (e.g. WINE, native 32 bit games) you simply need to install the corresponding libs as under your "native" arch. <br />
<br />
For an ATI card using the radeon driver this could be:<br />
pacman -S xf86-video-ati libgl ati-dri<br />
<br />
For more informations on how to set up your graphic adapter refer to:<br />
<br />
[[ATI]]<br />
<br />
[[Intel]]<br />
<br />
[[NVIDIA]]<br />
<br />
Your can easily check if you have 3D rendering within the 32 bit chroot by installing mesa-demos and running the following command:<br />
glxinfo | grep renderer<br />
<br />
If you have no 3D acceleration you'll get some output like this:<br />
[joe@arch64]$ OpenGL renderer string: Software Rasterizer<br />
<br />
If 3D acceleration is enabled you'll get a message like this:<br />
[joe@arch64]$ OpenGL renderer string: Mesa DRI R600 (RV730 9490) 20090101 x86/MMX+/3DNow!+/SSE2 TCL DRI2<br />
<br />
===Script for wine===<br />
In order to compile wine, you need a 32-bit system installed. Compiling wine is needed for applying patches in order to get [http://art.ified.ca/?page_id=40 PulseAudio] working. See also [https://aur.archlinux.org/packages.php?ID=19675 wine-hacks] from AUR.<br />
<br />
Add the following alias to {{ic|~/.bashrc}}:<br />
alias wine='schroot -pqd "$(pwd)" -- wine'<br />
The {{ic|-q}} switch makes schroot operate in quiet mode, so it works like "regular" wine does. Also note that If you still use dchroot instead of schroot, you should use switch {{ic|-d}} instead of {{ic|-s}}.</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Input_Leap&diff=211094Input Leap2012-06-24T19:40:50Z<p>Reventlov: /* Arch Linux */</p>
<hr />
<div>[[Category:Input devices]]<br />
[[it:Synergy]]<br />
[http://synergy-foss.org/ Synergy] lets you easily share a single mouse and keyboard between multiple computers (even with different operating systems) without the need for special hardware. It is intended for users with multiple computers on their desk since each system uses its own monitor(s).<br />
<br />
Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen. Synergy also merges the clipboards of all the systems into one, allowing cut-and-paste between systems. Furthermore, it synchronizes screen savers so they all start and stop together and, if screen locking is enabled, only one screen requires a password to unlock them all. <br />
<br />
==Installation==<br />
<br />
===Arch Linux===<br />
You can [[pacman|install]] the {{pkg|synergy}} package from the [[Official Repositories|official repositories]].<br />
<br />
===Windows and Mac OS X===<br />
Download and run [http://synergy-foss.org/download the newest installer] from the official website.<br />
<br />
===Compiling from source===<br />
First download and compile the source code to create the binaries synergyc and synergys from the [http://synergy-foss.org/pm/projects/synergy/tabs/source svn repo].<br />
<br />
{{hc|$ <nowiki>svn co http://synergy-plus.googlecode.com/svn/trunk/ synergy-trunk && cd synergy-trunk && cmake . && make</nowiki>|<nowiki>...<br />
[ 0%] Built target gtest<br />
[ 94%] Built target synergy<br />
Linking CXX executable synergyc<br />
[ 96%] Built target synergyc<br />
Linking CXX executable synergys<br />
[ 98%] Built target synergys<br />
[100%] Built target tests</nowiki>}}<br />
<br />
Now change the owner:group to {{ic|root:root}} then copy the created bins to your {{ic|$PATH}}, such as to {{ic|/usr/local/bin}}.<br />
{{hc|$ <nowiki>sudo chown root:root synergyc synergys && sudo cp -v synerygyc synergys /usr/local/bin</nowiki>|<nowiki>changed ownership of `synergyc' to root:root<br />
changed ownership of `synergys' to root:root<br />
`synergyc' -> `/usr/local/bin/synergyc'<br />
`synergys' -> `/usr/local/bin/synergys'</nowiki>}}<br />
<br />
{{Tip|You can also try the BETA versions of Synergy.}}<br />
<br />
*Read [http://synergy-foss.org/pm/projects/synergy/wiki/Compiling the official compiling help].<br />
<br />
==Pre-configuration==<br />
First determine the IP addresses and [[Configuring_Network#Set_the_host_name|host names]] for each machine and make sure each has a correct hosts file.<br />
<br />
* Arch Linux - {{ic|/etc/hosts}}<br />
* Windows - {{ic|C:\WINDOWS\system32\drivers\etc\hosts}}<br />
* Mac OS X - [http://support.apple.com/kb/TA27291?viewlocale=en_US How to Add Hosts to Local Hosts File].<br />
<br />
{{hc|/etc/hosts|<br />
10.10.66.1 archserver.localdomain archserver<br />
10.10.66.100 archleft.localdomain archleft<br />
10.10.66.105 archright.localdomain archright}}<br />
<br />
{{Note|Check that the clients can reach the server.}}<br />
<br />
==Server configuration==<br />
<br />
See [http://synergy2.sourceforge.net/configuration.html Synergy Configuration File Format] for a detailed description of all available sections and options.<br />
<br />
===Arch Linux===<br />
<br />
The configuration file for Arch Linux is {{ic|/etc/synergy.conf}}. If it does not exist, create it using {{ic|/etc/synergy.conf.example}}, whose comments should give you enough information for a basic configuration; if you need further reference, read the guide mentioned above.<br />
{{Tip|1=You may also use either {{AUR|quicksynergy}} from the [[Arch User Repository|AUR]] or {{AUR|qsynergy}} from [community] which provides a GUI to simplify the configuration process.}}<br />
<br />
To start the server daemon, run:<br />
# rc.d start synergys<br />
<br />
If you experience problems and you wish to run the server in the foreground, you can run the following command instead:<br />
# synergys -f<br />
<br />
If you want to run the synergy server daemon every time Arch Linux boots up, you can add {{ic|synergys}} to the daemons array in {{ic|/etc/rc.conf}}:<br />
<br />
{{hc|/etc/rc.conf|2=...<br />
DAEMONS=(... synergys ...)}}<br />
<br />
===Windows===<br />
<br />
# Open the Synergy program<br />
# Select the option ''Server (share this computer's mouse and keyboard)''<br />
# Select ''Configure interactively''<br />
# Click the ''Configure Server...'' button<br />
# This opens a window in which you can add screens depending on how many computers/screens you have: just drag the screen icon in the top-right corner to the screens area, and double-click it to edit its settings<br />
# Click ''OK'' to close the screens window when you are ready, then click on ''Start'' to start the server<br />
<br />
On Windows, configuration is saved by default in a {{ic|synergy.sgc}} file, but its name and location can of course be changed at pleasure.<br />
<br />
If you want to start the Synergy server everytime Windows starts, you have to launch the program '''as administrator''', then go to ''Edit -> Services'' and select ''Install'' in the ''Server'' section; note that at the following reboot Synergy will indeed automatically start, but the tray icon will not display automatically (at least for version 1.4.2 beta on Windows 7). To uninstall the service, do the same thing but obviously select ''Uninstall''.<br />
<br />
If you want to start the server from the command-line, here is a Windows command you can place in a {{ic|.bat}} file or just run from {{ic|cmd.exe}}:<br />
<br />
{{bc|C:\Program Files\Synergy+\bin\synergys.exe -f --debug ERROR --name left --log c:\windows\synergy.log -c C:/windows/synergy.sgc --address 10.66.66.2:24800}}<br />
<br />
===Mac OS X===<br />
<br />
Mac OS X has a similar configuration as Unix: check [http://synergy-foss.org/docs the official documentation] for more information.<br />
<br />
===Configuration examples===<br />
<br />
This is an example for a basic 3-computers setup:<br />
<br />
{{hc|/etc/synergy.conf|<nowiki><br />
section: screens<br />
server-fire:<br />
archright-fire:<br />
archleft-fire:<br />
end<br />
<br />
section: links<br />
archleft-fire:<br />
right = server-fire<br />
server-fire:<br />
right = archright-fire<br />
left = archleft-fire<br />
archright-fire:<br />
left = server-fire<br />
end<br />
</nowiki>}}<br />
<br />
This should be the example bundled with the Arch Linux package:<br />
<br />
{{hc|/etc/synergy.conf|2=<br />
section: screens<br />
# three hosts named: moe, larry, and curly<br />
moe:<br />
larry:<br />
curly:<br />
end<br />
<br />
section: links<br />
# larry is to the right of moe and curly is above moe<br />
moe:<br />
right = larry<br />
up = curly<br />
<br />
# moe is to the left of larry and curly is above larry.<br />
# note that curly is above both moe and larry and moe<br />
# and larry have a symmetric connection (they're in<br />
# opposite directions of each other).<br />
larry:<br />
left = moe<br />
up = curly<br />
<br />
# larry is below curly. if you move up from moe and then<br />
# down, you'll end up on larry.<br />
curly:<br />
down = larry<br />
end<br />
<br />
section: aliases<br />
# curly is also known as shemp<br />
curly:<br />
shemp<br />
end<br />
<br />
}}<br />
<br />
The following is a more customized example:<br />
<br />
{{hc|synergy.sgc|2=<br />
section: screens<br />
leftpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
rightpc:<br />
halfDuplexCapsLock = false<br />
halfDuplexNumLock = false<br />
halfDuplexScrollLock = false<br />
xtestIsXineramaUnaware = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 0<br />
end<br />
<br />
section: aliases<br />
leftpc:<br />
10.66.66.2<br />
rightpc:<br />
10.66.66.1<br />
end<br />
<br />
section: links<br />
leftpc:<br />
right = rightpc<br />
rightpc:<br />
left = leftpc<br />
end<br />
<br />
section: options<br />
heartbeat = 1000<br />
relativeMouseMoves = false<br />
screenSaverSync = false<br />
win32KeepForeground = false<br />
switchCorners = none +top-left +top-right +bottom-left +bottom-right <br />
switchCornerSize = 4<br />
end<br />
}}<br />
<br />
==Clients configuration==<br />
<br />
{{Note|This assumes a server has been set up and configured '''properly'''. Make sure the server is already configured to accept the client(s) before continuing.}}<br />
<br />
===Arch Linux===<br />
In a console window, type:<br />
$ synergyc server-host-name<br />
<br />
Or, to run synergy in the foreground:<br />
$ synergyc -f server-host-name<br />
<br />
Here, {{ic|server-host-name}} is the host name of the server.<br />
<br />
====Autostart====<br />
<br />
There exist several ways to automatically start the Synergy client, and they are actually the same that can be used for every other application.<br />
<br />
{{Note|In all of the following examples, you always have to substitute {{ic|server-host-name}} with the real server host name.}}<br />
<br />
* You can add the next line to your [[xinitrc|{{ic|~/.xinitrc}}]]:<br />
<br />
{{hc|~/.xinitrc|<br />
...<br />
<br />
#replace server-host-name with the real name<br />
synergyc server-host-name<br />
<br />
...}}<br />
<br />
The following is an alternative:<br />
<br />
{{hc|~/.xinitrc|<nowiki>XINIT_CMD='/usr/bin/synergyc -d FATAL -n galileo-fire 10.66.66.2:24800'<br />
/usr/bin/pgrep -lxf "$XINIT_CMD" || ( ( $XINIT_CMD ) & )</nowiki>}}<br />
<br />
* Otherwise, if you are using a [[Display Manager|display manager]] (kdm, gdm, [[SLiM]], ...), or a stand-alone [[Window Manager|window manager]] (Openbox, ...), you could exploit its start-up script and add the following:<br />
synergyc server-host-name<br />
<br />
or, in case you have created the ''synergyc'' daemon (see below):<br />
/etc/rc.d/synergyc stop #verify synergy is closed<br />
/etc/rc.d/synergyc start<br />
<br />
For example, using ''kdm'' you should edit {{ic|/usr/share/config/kdm/Xsetup}}.<br />
<br />
* You can even start ''synergyc'' in the init chain by adding the following to {{ic|/etc/rc.local}}:<br />
<br />
{{hc|/etc/rc.local|<br />
...<br />
<br />
echo "Starting Synergy client"<br />
#replace server-host-name with the real name<br />
synergyc server-host-name}}<br />
<br />
* A similar result can be obtained by creating a daemon and adding it to the daemons array in {{ic|/etc/rc.conf}}; just create a file {{ic|/etc/rc.d/synergyc}} with the following content, making sure to set its permissions to {{ic|chmod 755}}:<br />
<br />
{{hc|/etc/rc.d/synergyc|2=<br />
#!/bin/bash<br />
. /etc/rc.conf<br />
. /etc/rc.d/functions<br />
<br />
#Put the server host name in the following line<br />
SERVERALIAS="server-host-name"<br />
<br />
PID=`pidof -o %PPID /usr/bin/synergyc`<br />
case "$1" in<br />
start)<br />
stat_busy "Starting Synergy Client"<br />
[ -z "$PID" ] && /usr/bin/synergyc "$SERVERALIAS"<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
/usr/bin/xset r on<br />
add_daemon synergyc<br />
stat_done<br />
fi<br />
;;<br />
stop)<br />
stat_busy "Stopping Synergy Client"<br />
[ ! -z "$PID" ] && kill -9 $PID<br />
if [ $? -gt 0 ]; then<br />
stat_fail<br />
else<br />
rm_daemon synergyc<br />
stat_done<br />
fi<br />
;;<br />
restart)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
;;<br />
*)<br />
<nowiki> echo "usage: $0 {start|stop|restart}"</nowiki><br />
esac<br />
exit 0}}<br />
<br />
Automatically starting Synergy is also documented in its [http://synergy2.sourceforge.net/autostart.html official reference page].<br />
<br />
===Windows===<br />
<br />
After installation, open the Synergy program, select the option ''Client (use another computer's keyboard and mouse)'' and type the host name of the server computer in the text box, then click ''Start'' to start the client.<br />
{{Note|You can use the tray icon to stop the client.}}<br />
<br />
If you want to start the Synergy client every time Windows starts, you have to launch the program '''as an administrator''', then go to ''Edit -> Services'' and select ''Install'' in the ''Client'' section.<br />
<br />
If you want to start the client from the command-line, here is a Windows command you can place in a {{ic|.bat}} file or just run from {{ic|cmd.exe}}. This points to a configuration file in {{ic|C:\synergy.sgc}} and runs in the background like a service.<br />
<br />
{{bc|<nowiki>START /MIN /D"C:\Program Files\Synergy+\bin" synergys.exe -d ERROR -n m6300 -c C:\synergy.sgc -a 10.66.66.2:24800</nowiki>}}<br />
<br />
===Mac OS X===<br />
<br />
Locate the synergyc program in the synergyc folder and drag it onto the terminal window: the full path will appear in the terminal.<br />
Now append the host name of the server, so that the complete command will look like this:<br />
<br />
{{bc|/path/to/synergyc/synergyc server-host-name}}<br />
<br />
Then press {{Keypress|Enter}}.<br />
<br />
==Known Issues==<br />
If Arch is being used as a client in a Synergy installation, the server may not be able to wake the client monitor. There are some workarounds, such as executing the following via [[Secure Shell|SSH]], if ACPI is enabled (see: [[Display_Power_Management_Signaling#Modifing_DPMS_and_screensaver_settings_using_xset|Modifying DPMS and ScreenSaver settings with xset]]):<br />
{{bc|# xset dpms force on}}<br />
<br />
==Troubleshooting==<br />
The official documentation has a [http://synergy-foss.org/pm/projects/synergy/wiki/UserFAQ FAQ] and also a [http://synergy2.sourceforge.net/trouble.html troubleshooting page].<br />
<br />
===Keyboard repeat===<br />
If you experience problems with your keyboard repeat on the client machine (Linux host), simply type:<br />
{{bc|# /usr/bin/xset r on}}<br />
in any console.<br />
<br />
===Keyboard mapping===<br />
If you experience problems with the keyboard mapping when using the server's keyboard in a client window (e.g a terminal) then re-setting the X key map after starting synergyc may help. The following command sets the keymap to its current value:<br />
<br />
# setxkbmap $(setxkbmap -query | grep "^layout:" | awk -F ": *" '{print $2}')<br />
<br />
===messages.log being spammed with by synergyc===<br />
If you run ''synergyc'' as described above then your {{ic|/var/log/messages.log}} file will get spammed with messages like these:<br />
<br />
May 26 22:30:46 localhost Synergy 1.4.6: 2012-05-26T22:30:46 INFO: entering screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,103<br />
May 26 22:30:47 localhost Synergy 1.4.6: 2012-05-26T22:30:47 INFO: leaving screen<br />
/build/src/synergy-1.4.6-Source/src/lib/synergy/CScreen.cpp,121<br />
<br />
To prevent this run ''synergyc'' with the {{ic|-d WARNING}} option. This ''debug level'' option tells synergy to only log messages if they are level ''WARNING'' or above.<br />
<br />
synergyc -d WARNING server-host-name<br />
<br />
You can also edit the line that calls ''synergyc'' if you use a {{ic|/etc/rc.d/synergyc}} file.<br />
<br />
[ -z "$PID" ] && /usr/bin/synergyc -d WARNING "$SERVERALIAS"<br />
<br />
==External Links==<br />
* Synergy website: http://synergy-foss.org<br />
* Official documentation: http://synergy-foss.org/docs<br />
* Gentoo Wiki Synergy Setup: http://en.gentoo-wiki.com/wiki/Synergy</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Music_Player_Daemon&diff=203622Music Player Daemon2012-06-04T18:58:27Z<p>Reventlov: /* Creating the required files */ tmpfiles</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[Category:Daemons and system services]]<br />
[[de:Music Player Daemon]]<br />
[[fr:MPD]]<br />
[[tr:Music_Player_Daemon]]<br />
{{i18n|Music Player Daemon}}<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Installation, configuration and basic troubleshooting of MPD.}}<br />
{{Article summary heading|Required software}}<br />
{{Article summary link|Music Player Daemon|http://mpd.wikia.com}}<br />
{{Article summary heading|Related Articles}}<br />
{{Article summary wiki|MPD/Tips and Tricks}}<br />
{{Article summary wiki|MPD/Troubleshooting}}<br />
{{Article summary heading|Other sources}}<br />
{{Article summary text|[[Wikipedia:MPD|Wikipedia article]]}}<br />
{{Article summary end}}<br />
<br />
'''MPD''' ('''m'''usic '''p'''layer '''d'''aemon) is an audio player that has a server-client architecture. It plays audio files, organizes playlists and maintains a music database all while using very few resources. In order to interface with it, a separate [[#Clients|client]] is needed.<br />
<br />
== Installation ==<br />
[[pacman|Install]] {{Pkg|mpd}}, available in the [[official repositories]].<br />
<br />
== Setup ==<br />
MPD is able to run globally (settings apply to all users), locally (per user settings), and in multiple instances.<br />
The way of setting up mpd depends on the way it is supposed to be used.<br />
A local configuration may prove more useful on a desktop system than on a system that is used by several people simultaneously.<br />
<br />
For a comfortable use, it is sensible to provide MPD access to the following files and directories:<br />
mpd.db # The music database<br />
mpd.pid # The file where mpd stores its process ID<br />
mpd.log # mpd logs here<br />
mpdstate # mpd's current state is noted here<br />
playlists # the folder where playlists are saved into<br />
<br />
In order for MPD to be able to play back audio, [[ALSA]] or [[PulseAudio]] needs to be setup and working.<br />
<br />
=== Global Configuration ===<br />
{{Note|For a user-specific permissions, change the "user" line above to reflect one of the system users.}}<br />
{{Warning|Users making use of PulseAudio will not be able to correctly use mpd when the daemon is set to run as its own user!}}<br />
<br />
MPD comes with an example configuration file, available at {{ic|/usr/share/doc/mpd/mpdconf.example}}. This file holds an abundance of information on MPD configuration, and holds default mixer values.<br />
<br />
Copy the included example file to {{ic|/etc/mpd.conf}}.<br />
# cp /usr/share/doc/mpd/mpdconf.example /etc/mpd.conf<br />
<br />
==== Editing mpd.conf ====<br />
The default Arch install keeps the setup in {{ic|/var}} and uses "mpd" as default user.<br />
<br />
Edit {{ic|/etc/mpd.conf}} to reflect as such:<br />
{{hc|/etc/mpd.conf|<br />
music_directory "/home/user/music"<br />
playlist_directory "/var/lib/mpd/playlists"<br />
db_file "/var/lib/mpd/mpd.db"<br />
log_file "/var/log/mpd/mpd.log"<br />
pid_file "/run/mpd/mpd.pid"<br />
state_file "/var/lib/mpd/mpdstate"<br />
user "mpd"<br />
# bind_to_address "127.0.0.1"<br />
# port "6600"<br />
}}<br />
<br />
To change the volume of audio from mpd independent of other programs, uncomment or add the switch in mpd.conf:<br />
<br />
{{hc|/etc/mpd.conf|<br />
mixer_type "software"<br />
}}<br />
<br />
Users of [[PulseAudio]] will need to make the following modification:<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "pulse"<br />
name "pulse audio"<br />
}<br />
}}<br />
<br />
Users of [[ALSA]] will want to have the following device definition, which allows the software volume control in your MPD client to control the volume separately from other applications.<br />
{{hc|/etc/mpd.conf|2=<br />
audio_output {<br />
type "alsa"<br />
name "My Sound Card"<br />
mixer_type "software" # optional<br />
}<br />
}}<br />
Note that if you change the group that MPD runs as, you will get errors like "output: Failed to open "My ALSA Device"" "[alsa]: Failed to open ALSA device "default": No such file or directory" "player_thread: problems opening audio device while playing "Song Name.mp3""<br />
<br />
This is because by default MPD runs as member of '''audio''' group and the sound devices under {{Ic|/dev/snd/}} are owned by this group.<br />
<br />
===== Music directory =====<br />
MPD needs to have {{ic|+x}} permissions on ''all'' parent directories to the music collection (ie. if it's located outside of "mpd" home directory {{ic|/var/lib/mpd}}). By default useradd sets permissions on home directories to {{ic|1700 drwx------}}. Thus users will most likely need to remount the music directory under a directory that mpd has access to -- this only applies if running as the 'mpd' user.<br />
<br />
# mkdir /var/lib/mpd/music<br />
# echo "/home/$USER/music /var/lib/mpd/music none bind" >> /etc/fstab<br />
# mount -a<br />
# rc.d restart mpd<br />
See also [https://bbs.archlinux.org/viewtopic.php?id=86449 the forum thread.]<br />
<br />
An additional solution would be to just create a symbolic link into {{ic|/var/lib/mpd/music}}.<br />
# mkdir /var/lib/mpd/music<br />
# ln -s MUSIC_FOLDER /var/lib/mpd/music/<br />
# rc.d restart mpd<br />
<br />
If the music collection is contained under multiple directories, create symbolic links under the main music directory in {{ic|/var/lib/mpd}}. Remember to set permissions accordingly on the directories being linked.<br />
<br />
==== Creating the required files ====<br />
Now, having finished configuring MPD, the files and directories for MPD to write in need to be created:<br />
<br />
Create the directories and files specified in {{ic|/etc/mpd.conf}}:<br />
# mkdir -p /var/lib/mpd/playlists <br />
# touch /var/lib/mpd/{mpd.db,mpdstate} <br />
<br />
Usually the init-script should properly create {{ic|/run/mpd/}} when starting. The deamon will use this directory to create {{ic|mpd.pid}} in it. However: If you are running mpd as a different user, you will have to fix the tmpfiles.d: In {{ic|/usr/lib/tmpfiles.d/mpd.conf}} change the line<br />
d /run/mpd 0755 mpd mpd<br />
to:<br />
d /run/mpd 0755 ''username'' ''groupname''<br />
<br />
Change the file's permissions so that the daemon can modify them.<br />
# chown -R mpd /var/lib/mpd<br />
<br />
==== Create database ====<br />
Creating the database is now accomplished via the update feature of the client, for example {{ic|mpc update}}. <br />
{{Box RED | Note: | Creating the MPD database as root using {{ic|# mpd --create-db}} is deprecated.}}<br />
<br />
==== Timeline of MPD startup ====<br />
To depict when MPD drops its superuser privileges and assumes those of the user set in the configuration, the timeline of a normal MPD startup is listed here:<br />
<br />
# MPD is started on boot by {{ic|/etc/rc.conf}}, by including it in the {{ic|DAEMONS}} array. (Or, this can be done manually each session by running {{ic|rc.d start mpd}} with root privileges).<br />
# Since MPD is now started as root, it first reads the {{ic|/etc/mpd.conf}} file.<br />
# MPD reads the user variable in the {{ic|/etc/mpd.conf}} file, and changes from root to this user.<br />
# MPD then reads the contents of the {{ic|/etc/mpd.conf}} file and configures itself accordingly.<br />
<br />
Notice that MPD changes the running user from root to the one named in the {{ic|/etc/mpd.conf}} file. <br />
This way, uses of {{ic|~}} in the configuration file point correctly to the home user's directory, and not root's directory. <br />
It may be worthwhile to change all uses of {{ic|~}} to {{ic|/home/username}} to avoid any confusion over this aspect of MPD's behavior.<br />
<br />
=== Local Configuration (per user) ===<br />
MPD does not need to be run globally as a daemon and can rather work per user. <br />
The usual method to configure MPD globally is because the listed files and folders in the default configuration file point to directories owned by root (the {{ic|/var}} directory). <br />
A less used (but perhaps more sensible) method is to make MPD work with files and directories owned by a normal user.<br />
Running MPD as a normal user has the benefits of:<br />
<br />
# A single directory {{ic|~/.mpd}} (or any other directory under {{ic|/home/username}}) that will contain all the MPD configuration files.<br />
# Easier to avoid unforeseen read/write permission errors.<br />
{{Note|This approach will not work with multiple users to having access to MPD at the same time.}}<br />
<br />
Begin the setup by creating a directory for the required files and the playlists:<br />
<br />
{{bc|mkdir -p ~/.mpd/playlists}}<br />
<br />
Copy the contents of the default MPD configuration file in {{ic|/usr/share/mpd/mpd.conf.example}} to the target user's home directory:<br />
<br />
{{bc|cp /usr/share/doc/mpd/mpdconf.example ~/.mpdconf}}<br />
<br />
Create all of the requisite files:<br />
<br />
{{bc|<nowiki>touch ~/.mpd/{mpd.db,mpd.log,mpd.pid,mpdstate}</nowiki>}}<br />
<br />
Edit {{ic|~/.mpdconf}} to specify these files:<br />
<br />
{{hc|~/.mpdconf|<br />
music_directory "/home/USER/music" # Keep commented if your XDG directory already points to it<br />
playlist_directory "/home/USER/.mpd/playlists"<br />
db_file "/home/USER/.mpd/mpd.db"<br />
log_file "/home/USER/.mpd/mpd.log"<br />
pid_file "/home/USER/.mpd/mpd.pid"<br />
state_file "/home/USER/.mpd/mpdstate"<br />
}}<br />
<br />
MPD can now be started by typing {{ic|mpd}} on the command line.<br />
To have MPD start with the X server add it to {{ic|~/.xinitrc}} or create a {{ic|.desktop}} if using a common desktop and save it to {{ic|~/.config/autostart/mpd.desktop}}:<br />
<br />
{{hc|mpd.desktop|2=<br />
[Desktop Entry]<br />
Encoding=UTF-8<br />
Version=0.9.4<br />
Type=Application<br />
Name=Music Player Daemon<br />
Comment=<br />
Exec=mpd<br />
StartupNotify=false<br />
Terminal=false<br />
Hidden=false<br />
}}<br />
<br />
==== Scripted Configuration ====<br />
Rasi has written a script that will create the proper directory structure, configuration files and prompt for the location of the user's Music directory; it can be downloaded [http://karif.server-speed.net/~carnager/mpdsetup.tar here].<br />
<br />
=== Multi-mpd setup ===<br />
'''Useful if running an icecast server.'''<br />
<br />
For a second MPD (e.g., with icecast output to share music over the network) using the same music and playlist as the one above, simply copy the above configuration file and make a new file (e.g., {{ic|/home/username/.mpd/config-icecast}}), and only change the log_file, error_file, pid_file, and state_file parameters (e.g., {{ic|mpd-icecast.log}}, {{ic|mpd-icecast.error}}, and so on); using the same directory paths for the music and playlist directories would ensure that this second mpd would use the same music collection as the first one e.g., creating and editing a playlist under the first daemon would affect the second daemon as well. Users do not have to create the same playlists all over again for the second daemon. Call this second daemon the same way from {{ic|~/.xinitrc}} above. (Just be sure to have a different port number, so as to not conflict with the first mpd daemon).<br />
<br />
== Clients ==<br />
A separate client is needed to control mpd. Popular options are:<br />
<br />
=== Console ===<br />
*{{App|mpc|Simple KISS client. All basic functionality available|http://mpd.wikia.com/wiki/Client:Mpc|{{Pkg|mpc}}}}<br />
*{{App|ncmpc|A NCurses client for mpd|http://mpd.wikia.com/wiki/Client:Ncmpc|{{Pkg|ncmpc}}}}<br />
*{{App|ncmpcpp|An almost exact clone of ncmpc with some new features written in C++ (tag editor, search engine)|http://unkart.ovh.org/ncmpcpp/|{{Pkg|ncmpcpp}}}}<br />
*{{App|pms|Highly configurable and accessible ncurses client|http://pms.sourceforge.net/|{{AUR|pmus}}}}<br />
=== Graphical ===<br />
*{{App|Ario|A very feature-rich GTK2 GUI client for mpd, inspired by Rhythmbox|http://ario-player.sourceforge.net/|{{Pkg|ario}}}}<br />
*{{App|QmpdClient|A GUI client written with Qt 4.x|http://bitcheese.net/wiki/QMPDClient|{{Pkg|qmpdclient}}}}<br />
*{{App|Sonata|An elegant Python GTK+ client|http://sonata.berlios.de/|{{Pkg|sonata}}}}<br />
*{{App|gmpc|GNOME Client|http://gmpc.wikia.com/wiki/Gnome_Music_Player_Client|{{Pkg|gmpc}}}}<br />
*{{App|Dpmc|Dmenu-based MPC client with a playlist manager and state-saving on playlist changes|http://wintervenom.mine.nu/|{{AUR|dmpc}}}}<br />
<br />
=== Web ===<br />
*{{App|Patchfork|web client for MPD written in PHP and Ajax|http://mpd.wikia.com/wiki/Client:Pitchfork|{{AUR|patchfork-git}}}}.<br />
<br />
See a long list of clients at the [http://mpd.wikia.com/wiki/Clients mpd wiki].<br />
<br />
== External links ==<br />
* [http://mpd.wikia.com/wiki/Clients Sorted List of MPD Clients]<br />
* [http://www.musicpd.org/forum/ MPD forum]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=LightDM&diff=202810LightDM2012-05-25T11:33:55Z<p>Reventlov: /* Enabling Lightdm */</p>
<hr />
<div>[[Category:Display managers]]<br />
{{i18n|LightDM}}<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides an overview and setup of the Light Display Manager.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Display Manager}}<br />
{{Article summary end}}<br />
<br />
[http://www.freedesktop.org/wiki/Software/LightDM Lightdm] LightDM is a cross-desktop display manager that aims to be the standard display manager for the X.org X server.<br />
<br />
== Installation ==<br />
<br />
Currently, {{AUR|lightdm}} resides in the [[AUR]]. Install it like any other AUR package.<br />
<br />
=== Greeter===<br />
You will also need {{AUR|lightdm-gtk-greeter}} from the [[AUR]].<br />
<br />
Other greeters can be installed: <br />
* {{AUR|lightdm-webkit-greeter}}<br />
* {{AUR|lightdm-crowd-greeter}}<br />
* {{AUR|lightdm-kde-greeter}}<br />
* {{AUR|lightdm-unity-greeter}}<br />
<br />
To change the default greeter ({{pkg|lightdm-gtk-greeter}}) edit the lightdm PKGBUILD and change the line<br />
--with-greeter-session=lightdm-gtk-greeter<br />
to<br />
--with-greeter-session=lightdm-yourgreeter-greeter<br />
<br />
== Enabling Lightdm ==<br />
Lightdm can be loaded on startup by entering it in the daemons array in {{ic|rc.conf}}, or by modifying {{ic|inittab}} so it points to lightdm:<br />
[…]<br />
x:5:respawn:/usr/sbin/lightdm >/dev/null 2>&1<br />
[…]<br />
{{Note|The 'inittab' method is the preferred method to use a graphical greeter. See [[Display_Manager#inittab_method]].}}<br />
<br />
{{Note|Lightdm needs [[dbus]] to be running. If you get an error about "respawing too fast" you may have forgotten this. Ensure that dbus is in your [[DAEMONS]] array in {{ic|rc.conf}}.}}<br />
<br />
For systems using systemd, Lightdm also has a systemd service file, start it with {{ic|systemctl start lightdm.service}} or enable it for boot with {{ic|systemctl enable lightdm.service}}.<br />
<br />
See [[Display Manager]] for detailed instructions.<br />
<br />
== Optional Configuration and Tweaks ==<br />
=== Changing Background Images/Colors ===<br />
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''background''' variable.<br />
<br />
Example:<br />
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg<br />
<br />
{{Note|It is recommended to place png or jpg files in /usr/share/pixmaps since the lightdm user needs read access to the wallpaper file.}}<br />
<br />
Users wishing to have a flat color (no image) may simply set the '''background''' variable to a hex color.<br />
<br />
Example:<br />
background=#000000<br />
<br />
=== Changing the Icon ===<br />
Users wishing to customize the icon (by default, the 'computer' graphic) should follow this 3-step procedure:<br />
<br />
# Copy a 64x64 image to {{ic|/usr/share/icons/hicolor/64x64/devices}}<br />
# Run {{ic|gtk-update-icon-cache /usr/share/icons/hicolor}}<br />
# Edit {{ic|/usr/share/lightdm-gtk-greeter/greeter.ui}}<br />
Search for 'image1' and edit the 'property' xml to be the filename (less the extension). By default it should be 'computer' by default.<br />
<br />
==== Sources of Arch-centric 64x64 Icons ====<br />
The archlinux-artwork package in [extra] contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:<br />
<br />
# find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;<br />
<br />
After copying, the archlinux-artwork package can be removed.<br />
<br />
=== Enabling Autologin ===<br />
Edit {{ic|/etc/lightdm/lightdm.conf}} and change these lines to:<br />
<br />
[SeatDefaults]<br />
autologin-user=your_user<br />
autologin-user-timeout=0<br />
pam-service=lightdm-autologin<br />
<br />
=== NumLock ON ===<br />
Install the {{ic|numlockx}} package and the edit {{ic| /etc/lightdm/lightdm.conf}} adding the following line:<br />
greeter-setup-script=/usr/bin/numlockx on<br />
<br />
=== User switching under xfce4 ===<br />
With the release of xfce4 v4.10, user switching is supported natively. To use it with lightdm, users need only to create a symlink:<br />
<br />
# ln -s /usr/lib/lightdm/lightdm/gdmflexiserver /usr/bin/gdmflexiserver</div>Reventlovhttps://wiki.archlinux.org/index.php?title=LightDM&diff=202809LightDM2012-05-25T11:31:27Z<p>Reventlov: /* Enabling Lightdm */</p>
<hr />
<div>[[Category:Display managers]]<br />
{{i18n|LightDM}}<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Provides an overview and setup of the Light Display Manager.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Display Manager}}<br />
{{Article summary end}}<br />
<br />
[http://www.freedesktop.org/wiki/Software/LightDM Lightdm] LightDM is a cross-desktop display manager that aims to be the standard display manager for the X.org X server.<br />
<br />
== Installation ==<br />
<br />
Currently, {{AUR|lightdm}} resides in the [[AUR]]. Install it like any other AUR package.<br />
<br />
=== Greeter===<br />
You will also need {{AUR|lightdm-gtk-greeter}} from the [[AUR]].<br />
<br />
Other greeters can be installed: <br />
* {{AUR|lightdm-webkit-greeter}}<br />
* {{AUR|lightdm-crowd-greeter}}<br />
* {{AUR|lightdm-kde-greeter}}<br />
* {{AUR|lightdm-unity-greeter}}<br />
<br />
To change the default greeter ({{pkg|lightdm-gtk-greeter}}) edit the lightdm PKGBUILD and change the line<br />
--with-greeter-session=lightdm-gtk-greeter<br />
to<br />
--with-greeter-session=lightdm-yourgreeter-greeter<br />
<br />
== Enabling Lightdm ==<br />
Lightdm can be loaded on startup by entering it in the daemons array in {{ic|rc.conf}}, or by modifying {{ic|inittab}} so it points to lightdm:<br />
x:5:respawn:/usr/sbin/lightdm >/dev/null 2>&1<br />
<br />
{{Note|The 'inittab' method is the preferred method to use a graphical greeter.}}<br />
<br />
{{Note|Lightdm needs [[dbus]] to be running. If you get an error about "respawing too fast" you may have forgotten this. Ensure that dbus is in your [[DAEMONS]] array in {{ic|rc.conf}}.}}<br />
<br />
For systems using systemd, Lightdm also has a systemd service file, start it with {{ic|systemctl start lightdm.service}} or enable it for boot with {{ic|systemctl enable lightdm.service}}.<br />
<br />
See [[Display Manager]] for detailed instructions.<br />
<br />
== Optional Configuration and Tweaks ==<br />
=== Changing Background Images/Colors ===<br />
Users wishing to customize the wallpaper on the greeter screen need to edit {{ic|/etc/lightdm/lightdm-gtk-greeter.conf}} defining the '''background''' variable.<br />
<br />
Example:<br />
background=/usr/share/pixmaps/black_and_white_photography-wallpaper-1920x1080.jpg<br />
<br />
{{Note|It is recommended to place png or jpg files in /usr/share/pixmaps since the lightdm user needs read access to the wallpaper file.}}<br />
<br />
Users wishing to have a flat color (no image) may simply set the '''background''' variable to a hex color.<br />
<br />
Example:<br />
background=#000000<br />
<br />
=== Changing the Icon ===<br />
Users wishing to customize the icon (by default, the 'computer' graphic) should follow this 3-step procedure:<br />
<br />
# Copy a 64x64 image to {{ic|/usr/share/icons/hicolor/64x64/devices}}<br />
# Run {{ic|gtk-update-icon-cache /usr/share/icons/hicolor}}<br />
# Edit {{ic|/usr/share/lightdm-gtk-greeter/greeter.ui}}<br />
Search for 'image1' and edit the 'property' xml to be the filename (less the extension). By default it should be 'computer' by default.<br />
<br />
==== Sources of Arch-centric 64x64 Icons ====<br />
The archlinux-artwork package in [extra] contains some nice examples that install to {{ic|/usr/share/archlinux/icons}} and that can be copied to {{ic|/usr/share/icons/hicolor/64x64/devices}} as follows:<br />
<br />
# find /usr/share/archlinux/icons -name "*64*" -exec cp {} /usr/share/icons/hicolor/64x64/devices \;<br />
<br />
After copying, the archlinux-artwork package can be removed.<br />
<br />
=== Enabling Autologin ===<br />
Edit {{ic|/etc/lightdm/lightdm.conf}} and change these lines to:<br />
<br />
[SeatDefaults]<br />
autologin-user=your_user<br />
autologin-user-timeout=0<br />
pam-service=lightdm-autologin<br />
<br />
=== NumLock ON ===<br />
Install the {{ic|numlockx}} package and the edit {{ic| /etc/lightdm/lightdm.conf}} adding the following line:<br />
greeter-setup-script=/usr/bin/numlockx on<br />
<br />
=== User switching under xfce4 ===<br />
With the release of xfce4 v4.10, user switching is supported natively. To use it with lightdm, users need only to create a symlink:<br />
<br />
# ln -s /usr/lib/lightdm/lightdm/gdmflexiserver /usr/bin/gdmflexiserver</div>Reventlovhttps://wiki.archlinux.org/index.php?title=System_backup&diff=198836System backup2012-04-24T10:45:05Z<p>Reventlov: /* Configure bootloader */ s/sudo/su -c/</p>
<hr />
<div>[[Category:System recovery]]<br />
{{i18n|Full System Backup with rsync}}<br />
<br />
This [[rsync]] script allows creating a full backup copy across filesystems. 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.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<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 {{ic|rbackup.sh}} and make it executable:<br />
{{hc|rbackup.sh|2=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
su -c sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{ic|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{ic|$}}1<br />
:Passed as an argument to the script; e.g. {{ic|/media/backup}}<br />
<br />
;Include/exclude list; {{ic|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{ic|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 do not need to be backed up, such as the vast majority of {{ic|/dev}}. Note that specifying every desired file or directory in {{ic|Include}} is not needed; this section only acts as a filter for statements in {{ic|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{ic|backup.lst}}:<br />
{{hc|backup.lst|<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 />
- lost+found/<br />
- /media/backup/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{ic|/dev}}, {{ic|/proc}}, {{ic|/sys}} and {{ic|/tmp}} are excluded because they are created by the system at runtime, while the directories themselves need to be preserved since they are ''not'' regenerated at boot. Lastly, all {{ic|lost+found}} instances are skipped since they are partition-specific. For Archlinux {{ic|/var/lib/pacman/sync/*}} can also be excluded. This can save a lot of time on every backup since the directory contains many small files that tend to change quite often. These are description files for every package from the repositories. These files can be regenerated with {{ic|pacman -Syu}}.<br />
<br />
{{Warning|don't forget to also exclude the mounted directory where you'll put the backup to avoid an infinite loop (in this example {{ic|'''/media/backup/'''}}).}}<br />
<br />
;Include: Even though {{ic|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{ic|console}}, {{ic|initctl}}, {{ic|null}} and {{ic|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{ic|/media/'''backup'''}} as appropriate, and mount the destination device:<br />
# mount /dev/sdb1 /media/backup<br />
{{tip|if the ability to boot the backup isn't important, omit the previous step and simply backup to an arbitrary directory.}}<br />
<br />
Run the backup script (note that the trailing "{{ic|/}}" character is necessary):<br />
# ./rbackup.sh /media/backup/<br />
<br />
==Boot setup==<br />
After the sync is finished, the backup destination's {{ic|/etc/fstab}} has to be modified, a boot loader needs to be installed on the backup destination, and configuration in the destination's {{ic|/boot/grub/menu.lst}} requires to reflect the new location. <br />
<br />
===Modify fstab===<br />
Edit the backup destination's fstab:<br />
{{hc|$ nano /media/backup/etc/fstab|<br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
<br />
<i>/dev/sda1 /boot ext4 defaults 0 1<br />
/dev/sda5 /var ext4 defaults 0 1<br />
/dev/sda6 /usr ext4 defaults 0 1<br />
/dev/sda7 / ext4 defaults 0 1<br />
/dev/sda8 /home ext4 defaults 0 1<br />
/dev/sda9 swap swap defaults 0 0</i><br />
}}<br />
<br />
Because rsync has performed a recursive copy of the ''entire'' root filesystem, all of the {{ic|sda}} mounpoints are problematic and will cause the backup boot to fail. In this example, all of the offending entries are replaced with a single one:<br />
{{hc|$ nano /media/backup/etc/fstab|<br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
<br />
/dev/'''sdb1''' / '''ext4''' defaults 0 1<br />
}}<br />
<br />
As before, remember to use the proper device name and filesystem type.<br />
<br />
===Install bootloader===<br />
While these instructions assume [[GRUB]] is being employed, they could easily be adapted to other bootloaders, such as [[LILO]].<br />
<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 />
;root; {{ic|hd 1,0}}<br />
:This should point to where the GRUB files are located--in this case, "{{ic|hd 1}}" means the second storage device ({{ic|/dev/sdb}}) and "{{ic|0}}" is the first partition ({{ic|/dev/sdb''1''}}).<br />
<br />
;setup; {{ic|hd 1}}<br />
:The command specifies 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 {{ic|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{ic|rbackup.sh}} so that it copies a custom {{ic|menu.lst}}:<br />
{{hc|rbackup.sh|2=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
su -c 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 {{ic|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>Reventlovhttps://wiki.archlinux.org/index.php?title=System_backup&diff=198834System backup2012-04-24T10:44:03Z<p>Reventlov: s/sudo/su -c/</p>
<hr />
<div>[[Category:System recovery]]<br />
{{i18n|Full System Backup with rsync}}<br />
<br />
This [[rsync]] script allows creating a full backup copy across filesystems. 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.<br />
<br />
Instructions were converted from [http://bbs.archlinux.org/viewtopic.php?id=83071 this forum post].<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 {{ic|rbackup.sh}} and make it executable:<br />
{{hc|rbackup.sh|2=<br />
#!/bin/sh<br />
# rsync backup script<br />
<br />
su -c sh -c "<br />
rsync -av --delete-excluded --exclude-from=backup.lst / $1;<br />
touch $1/BACKUP<br />
"<br />
}}<br />
<br />
;Backup source; {{ic|/}}<br />
:In this case it's performing a backup on the whole root.<br />
<br />
;Backup destination; {{ic|$}}1<br />
:Passed as an argument to the script; e.g. {{ic|/media/backup}}<br />
<br />
;Include/exclude list; {{ic|<nowiki>--exclude-from=backup.lst</nowiki>}}<br />
:This example uses {{ic|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 do not need to be backed up, such as the vast majority of {{ic|/dev}}. Note that specifying every desired file or directory in {{ic|Include}} is not needed; this section only acts as a filter for statements in {{ic|Exclude}}. This file is in the traditional include/exclude rsync format.<br />
<br />
Save the following as {{ic|backup.lst}}:<br />
{{hc|backup.lst|<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 />
- lost+found/<br />
- /media/backup/*<br />
}}<br />
<br />
;Exclude: Content in system directories; {{ic|/dev}}, {{ic|/proc}}, {{ic|/sys}} and {{ic|/tmp}} are excluded because they are created by the system at runtime, while the directories themselves need to be preserved since they are ''not'' regenerated at boot. Lastly, all {{ic|lost+found}} instances are skipped since they are partition-specific. For Archlinux {{ic|/var/lib/pacman/sync/*}} can also be excluded. This can save a lot of time on every backup since the directory contains many small files that tend to change quite often. These are description files for every package from the repositories. These files can be regenerated with {{ic|pacman -Syu}}.<br />
<br />
{{Warning|don't forget to also exclude the mounted directory where you'll put the backup to avoid an infinite loop (in this example {{ic|'''/media/backup/'''}}).}}<br />
<br />
;Include: Even though {{ic|/dev}} is excluded, 4 files that are not dynamically created by [[udev]] need to be preserved. These are {{ic|console}}, {{ic|initctl}}, {{ic|null}} and {{ic|zero}}.<br />
<br />
==Backing up==<br />
Substitute {{ic|/media/'''backup'''}} as appropriate, and mount the destination device:<br />
# mount /dev/sdb1 /media/backup<br />
{{tip|if the ability to boot the backup isn't important, omit the previous step and simply backup to an arbitrary directory.}}<br />
<br />
Run the backup script (note that the trailing "{{ic|/}}" character is necessary):<br />
# ./rbackup.sh /media/backup/<br />
<br />
==Boot setup==<br />
After the sync is finished, the backup destination's {{ic|/etc/fstab}} has to be modified, a boot loader needs to be installed on the backup destination, and configuration in the destination's {{ic|/boot/grub/menu.lst}} requires to reflect the new location. <br />
<br />
===Modify fstab===<br />
Edit the backup destination's fstab:<br />
{{hc|$ nano /media/backup/etc/fstab|<br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
<br />
<i>/dev/sda1 /boot ext4 defaults 0 1<br />
/dev/sda5 /var ext4 defaults 0 1<br />
/dev/sda6 /usr ext4 defaults 0 1<br />
/dev/sda7 / ext4 defaults 0 1<br />
/dev/sda8 /home ext4 defaults 0 1<br />
/dev/sda9 swap swap defaults 0 0</i><br />
}}<br />
<br />
Because rsync has performed a recursive copy of the ''entire'' root filesystem, all of the {{ic|sda}} mounpoints are problematic and will cause the backup boot to fail. In this example, all of the offending entries are replaced with a single one:<br />
{{hc|$ nano /media/backup/etc/fstab|<br />
none /dev/pts devpts defaults 0 0<br />
none /dev/shm tmpfs defaults 0 0<br />
<br />
/dev/'''sdb1''' / '''ext4''' defaults 0 1<br />
}}<br />
<br />
As before, remember to use the proper device name and filesystem type.<br />
<br />
===Install bootloader===<br />
While these instructions assume [[GRUB]] is being employed, they could easily be adapted to other bootloaders, such as [[LILO]].<br />
<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 />
;root; {{ic|hd 1,0}}<br />
:This should point to where the GRUB files are located--in this case, "{{ic|hd 1}}" means the second storage device ({{ic|/dev/sdb}}) and "{{ic|0}}" is the first partition ({{ic|/dev/sdb''1''}}).<br />
<br />
;setup; {{ic|hd 1}}<br />
:The command specifies 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 {{ic|/boot/grub/menu.lst}} for the backup destination. In order to do this, modify {{ic|rbackup.sh}} so that it copies a custom {{ic|menu.lst}}:<br />
{{hc|rbackup.sh|2=<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 {{ic|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>Reventlovhttps://wiki.archlinux.org/index.php?title=PCManFM&diff=148326PCManFM2011-07-05T15:34:31Z<p>Reventlov: /* Volume handling */</p>
<hr />
<div>[[Category: Utilities (English)]]<br />
[[Category: File systems (English)]]<br />
[[Category: File managers (English)]]<br />
{{i18n|PCManFM}}<br />
[[pl:PCManFM]]<br />
[[fr:PCManFM]]<br />
<br />
'''PCManFM''' is "an extremly fast, lightweight, yet feature-rich file manager with tabbed browsing". Source: [http://pcmanfm.sourceforge.net/ PCManFM on sourceforge]. PCManFM is the default file manager of the [[LXDE]] (Lightweight X11 Desktop Environment).<br />
<br />
==Installation==<br />
Run the following command to install:<br />
# pacman -S pcmanfm<br />
<br />
You will also require gamin (a replacement for fam, which required a daemon) to pick up events such as file and directories changes:<br />
<br />
# pacman -S gamin<br />
<br />
<br />
==Volume handling==<br />
PCManFM is able to mount and unmount devices, both manually and automatically. This feature is offered as an alternative to CLI tools such as [[pmount]]. There are various 'up-to-date' versions of PCManFM (see below), and different volume handling strategies can be chosen.<br />
{{Note|You must have a /media folder.}}<br />
===Mounting with udisks===<br />
The current release of PCManFM is able to handle volumes through udisks. If you want to use this feature, make sure the D-Bus daemon is installed and running. See the [[D-Bus]] page for details. Note that you will most likely need to start dbus-launch from your .xinitrc or the autostart script of your window manager. Instructions how to do so can be found on the [[D-Bus]] page or the page for your window manager.<br />
<br />
===Mounting with gvfs===<br />
If you prefer to use the Gnome Virtual FileSystem, the procedure is the same as before but requires additional packages:<br />
<br />
* [[gvfs]] (and dependencies);<br />
* (optional) gvfs-smb, gvfs-obexftp, gvfs-afc, etc. in order to support additional features.<br />
<br />
===Mounting as normal user===<br />
To be able to mount devices like removeable USB harddisks, flashdrives or DVDs as a normal user, the PolicyKit toolkit needs to be configured accordingly. The configuration files can be found in the subdirectories of {{Filename|/etc/polkit-1}}. The rest of this section will show you how to configure PolicyKit to allow users belonging to the "storage" group to mount and umount temporary devices.<br />
{{ Note | Many users experience trouble mounting with lightweight windows manager and [[SLiM]], adding '''''ck-launch-session dbus-launch''''' after exec in login_cmd option usually help}}<br />
{{Note | Currently PolicyKit is configured to allow (un)mounting for users in group ''storage'' by default. Therefore this step is not necessary}}<br />
First off, start a terminal and make yourself root:<br />
su<br />
Then switch to the right directory:<br />
cd /etc/polkit-1/localauthority/50-local.d<br />
Fire up your favourite text editor and create a file:<br />
nano 55-myconf.pkla<br />
Note that you can name the file anything you want, as long as the name ends with .pkla. Type in or copy/paste the following lines:<br />
[Storage Permissions]<br />
Identity=unix-group:storage<br />
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown<br />
ResultAny=yes<br />
ResultActive=yes<br />
ResultInactive=no<br />
Do not forget to save the file. PolicyKit will notice the changes in the file and update its behaviour without any action from you. Last thing to do is making every user that should have the ability to mount drives a member of the storage group:<br />
usermod -a -G storage USERNAME<br />
Get back to your existence as a humble user and enjoy your ability to mount your USB Drives:<br />
exit<br />
<br />
If you want to grant other permissions instead of granting them to members of the storage group, or simply want to know what you were just doing, check out the manpage:<br />
man pklocalauthority<br />
<br />
==Tips & troubleshooting==<br />
===No "Applications"===<br />
# pacman -S gnome-menus<br />
<br />
===Trashcan not working?===<br />
# pacman -S gvfs consolekit<br />
Make sure that you also add "ck-launch-session dbus-launch"(in this order) to .xinitrc. gvfs requires many gnome dependencies.<br />
<br />
===Not able to mount USB or other devices?===<br />
# pacman -S consolekit<br />
Make sure that you also add "ck-launch-session dbus-launch"(in this order) to .xinitrc.<br />
<br />
===No icons?===<br />
If you are using a window manager over a desktop environment and notice you have no icons for folders and files, install an icon theme:<br />
# pacman -S tango-icon-theme<br />
<br />
Then edit {{Filename|~/.gtkrc-2.0}} '''or''' {{Filename|/etc/gtk-2.0/gtkrc}} and add the following line:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
===NTFS Read/Write Support===<br />
Install ntfs-3g:<br />
# pacman -S ntfs-3g<br />
<br />
===gnome-open opens "Find" dialog instead of the directory===<br />
Remove or rename the file {{Filename|/usr/share/applications/pcmanfm-find.desktop}}. If you're running pcmanfm-mod from AUR, remove or rename the file {{Filename|/usr/share/applications/pcmanfm-mod-find.desktop}}.<br />
<br />
===No "Previous/Next Folder" functionality with mouse buttons===<br />
A method to fix this is with [[Xbindkeys]]:<br />
<br />
Install xbindkeys:<br />
# pacman -S xbindkeys<br />
Edit ~/.xbindkeysrc to contain the following:<br />
# Sample .xbindkeysrc for a G9x mouse.<br />
"/usr/bin/xvkbd -text '\[Alt_L]\[Left]'"<br />
b:8<br />
"/usr/bin/xvkbd -text '\[Alt_L]\[Right]'"<br />
b:9<br />
Actual button codes can be obtained with xev[http://www.archlinux.org/packages/extra/i686/xorg-xev/].<br />
<br />
Add<br />
xbindkeys &<br />
to your ~/.xinitrc to execute xbindkeys on log-in.<br />
<br />
==Available Versions==<br />
There are several versions of PCManFM currently available:<br />
<br />
===PCManFM2===<br />
This is the package in Arch's extra repository as "pcmanfm". The current git test version of it is available in the AUR as [http://aur.archlinux.org/packages.php?ID=33601 pcmanfm-git]. More information is available on the [http://forum.lxde.org/viewforum.php?f=22 LXDE Forum].<br />
<br />
===PCManFM 0.5.2===<br />
The legacy PCManFM (version 0.5.2, which is currently "pcmanfm-gtk220" in the AUR repository) is frozen and is no longer being maintained by the original author. This version uses HAL for mounting. More information is available on the [http://pcmanfm.sourceforge.net/intro.html project page].<br />
<br />
===PCManFM-Mod===<br />
PCManFM-Mod adds user-definable commands, other features, and bugfixes to the legacy version of the PCManFM file manager v0.5.2. This version builds and installs as "pcmanfm-mod" and will run independently of other versions of PCManFM you have installed on your system. This legacy version is still desired by some due to more stability than the newer 0.9.x rewrite in progress, less Gnome dependencies, and the use of HAL rather than gnome-vfs. PCManFM-Mod is available in the [http://aur.archlinux.org/packages.php?ID=34819 AUR as pcmanfm-mod] and as [http://aur.archlinux.org/packages.php?ID=39547 pcmanfm-mod-prov] (latter provides pcmanfm). More information is available at [http://igurublog.wordpress.com/downloads/mod-pcmanfm/ IgnorantGuru's Blog].</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Network_configuration/Wireless&diff=147745Network configuration/Wireless2011-06-30T11:52:07Z<p>Reventlov: /* ndiswrapper */ Remove Ndiswrapper is included on the Arch Linux installation CD. (ndiwrapper is not in core anymore)</p>
<hr />
<div>{{i18n|Wireless Setup}}<br />
[[Category:Wireless Networking (English)]]<br />
[[fr:Wifi]]<br />
<br />
{{Article summary start}}<br />
{{Article summary text|A complete guide to enabling and configuring wireless networking.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
Configuring wireless is a two-part process; the first part is to identify and ensure the correct driver for your wireless device is installed, (they are available on the installation media, so make sure you install them) and to configure the interface. The second is choosing a method of managing wireless connections. This article covers both parts, and provides additional links to wireless management tools.<br />
<br />
'''About new Arch systems:''' The wireless drivers and tools are available during Arch set-up under the ''base-devel'' category. Be sure to install the proper driver for your card. Udev will usually load the appropriate module, thereby creating the wireless interface, in the initial live system of the installer, as well as the newly installed system on your hard drive. If you are configuring your wireless functionality after, and not during, Arch installation, simply ensure the required packages are installed with pacman, (driver, firmware if needed, wireless_tools, wpa_supplicant, etc.) and follow the guidelines below.<br />
<br />
== Part I: Identify Card/Install Driver ==<br />
<br />
=== Identify and Discover if Supported ===<br />
<br />
First you will need to check and see if the Linux kernel has support for your card or if a user-space driver is available for it.<br />
<br />
; Identify your card<br />
<br />
:* You can find your card type by running <br />
lspci | grep -i net<br />
from the command line.<br />
:* Or, if you have a USB device, run<br />
lsusb<br />
<br />
{{Note| The internal Wi-Fi card in some laptops may actually be a USB device, so make sure you check both commands.}}<br />
<br />
; Discover if card is supported<br />
<br />
:* The [https://help.ubuntu.com/community/WifiDocs/WirelessCardsSupported Ubuntu Wiki] has a good list of wireless cards and whether or not they are supported either in the Linux kernel or by a user-space driver (includes driver name).<br />
:* [http://linux-wless.passys.nl/ Linux Wireless Support] and The Linux Questions' [http://www.linuxquestions.org/hcl/index.php?cat=10 Hardware Compatibility List] (HCL) also have a good database of kernel-friendly hardware. <br />
:* The [http://wireless.kernel.org/en/users/Devices kernel page] additionally has a matrix of supported hardware.<br />
<br />
; If your card is not listed<br />
<br />
:* If your wireless hardware isn't listed above, likely it is supported only under Windows (some Broadcom, 3com, etc). For these you will need to use [http://ndiswrapper.sourceforge.net/wiki/index.php/List ndiswrapper]. Ndiswrapper is a wrapper script that allows you to use some Windows drivers in Linux. See the compatibility list [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List here]. You will need the {{Filename|.inf}} and {{Filename|.sys}} files from your Windows install. If you have a newer card, or a more exotic card, you might want to look up your exact model name and 'linux' and search the Internet before doing this step.<br />
<br />
===How it works===<br />
The default Arch kernel is ''modular'', meaning many of the drivers for machine hardware reside on the hard drive and are available as ''modules''. At boot, udev takes an inventory of your hardware. Udev will load appropriate modules (drivers) for your corresponding hardware, and the driver, in turn, will allow creation of a kernel ''interface''. <br />
<br />
The interface name for different drivers and chipsets will vary. Some examples are wlan0, eth1, and ath0.<br />
<br />
* Note: Udev is not perfect. If the proper module is not loaded by udev on boot, simply modprobe it and add the module name to {{Filename|/etc/rc.conf}} on the '''MODULES''' line. Note also that udev may occasionally load more than one driver for a device, and the resulting conflict will prevent successful configuration. Be sure to blacklist the unwanted module in [[Kernel modules|{{Filename|/etc/modprobe.d/modprobe.conf}}]].<br />
<br />
===Installation===<br />
<br />
====If you have wired internet available====<br />
If you have wired ethernet available, and are simply adding wireless functionality to an existing system, and did not include wireless_tools during initial installation, use pacman to install:<br />
# pacman -S wireless_tools<br />
The drivers' corresponding package names are all highlighted in '''bold''' on this page. The packages can be installed during initial package selection on the Arch installation media and can also be installed later with pacman, e.g.:<br />
# pacman -S madwifi<br />
<br />
====If you have only wireless internet available====<br />
The '''wireless_tools''' package is now available as part of the base system and is also on the live installation media (CD/USB stick image) under the '''base-devel''' category. <br />
<br />
You cannot initialize wireless hardware without these user-space tools, so ensure they are installed from the installer media, (during package selection), especially if you have no means of networking other than wirelessly. Otherwise, you will be stuck in a recursion when you reboot your newly installed Arch system; you will need wireless_tools and drivers, but in order to get them, you will need wireless_tools and drivers.<br />
<br />
===Drivers and firmware===<br />
Methods and procedures for installing drivers for various chip-sets are covered below. In addition, certain chip-sets require the installation of corresponding ''firmware'' (also covered below).<br />
<br />
====wlan-ng (obsolete)====<br />
<br />
Packages: '''wlan-ng26-utils'''<br />
<br />
This driver supports PRISM based cards, which are hard to find now. The PRISM card is an IEEE 802.11 compliant 2.4 GHz DSSS WLAN network interface card that uses the Intersil PRISM chip-set for its radio functions and the AMD PCNet-Mobile chip (AM79C930) for its Media Access Controller (MAC) function. The supported adapters can be found from here: http://www.linux-wlan.org/docs/wlan_adapters.html.gz<br />
<br />
For wlan-ng you do not need the wireless_tools package as mentioned above. Instead you will need to learn the tools in the wlan-ng26-utils package: '''wlancfg and wlanctl-ng'''.<br />
<br />
See http://www.linux-wlan.org/<br />
<br />
====rt2860 and rt2870====<br />
In kernel since 2.6.29 and requires no extra packages. It can be configured using the standard wpa_supplicant and iwconfig tools. Unfortunately this does not go for Arch. In order to get it to work, disabling the following modules in {{Filename|/etc/rc.conf}} has proven to be successful:<br />
<br />
MODULES=(!rt2800pci !rt61pci !rt2x00pci !rt2800usb !rt2800lib !rt2x00usb !rt2x00lib)<br />
<br />
It has a wide range of options that can be configured with iwpriv. These are documented in the [http://web.ralinktech.com/ralink/Home/Support/Linux.html source tarballs] available from Ralink.<br />
<br />
For rt2870sta, also see [[Rt2870]]<br />
<br />
====w322u====<br />
Treat this Tenda card as an rt2870sta. See: [[Rt2870]]<br />
<br />
====rtl8180====<br />
Realtek rtl8180 PCI/Cardbus 802.11b now fully supported in the kernel. It can be configured using the standard wpa_supplicant and iwconfig tools.<br />
<br />
====rtl8192e====<br />
<br />
The driver is part of the current kernel package. It can be configured using the standard wpa_supplicant and iwconfig tools.<br />
<br />
Note: [[wicd]] may cause excessive dropped connections with this driver, while [[NetworkManager]] appears to work better.<br />
<br />
====rtl8192s====<br />
<br />
The driver is part of the current kernel package. Firmware may need to be added manually if /lib/firmware/RTL8192SU/rtl8192sfw.bin does not exist. (dmesg will report ''"rtl819xU:FirmwareRequest92S(): failed"'' if the firmware is missing)<br />
<br />
To download and install firmware:<br />
<pre>$ wget http://launchpadlibrarian.net/33927923/rtl8192se_linux_2.6.0010.1012.2009.tar.gz<br />
# mkdir /lib/firmware/RTL8192SU<br />
# tar -xzOf rtl8192se_linux_2.6.0010.1012.2009.tar.gz \<br />
rtl8192se_linux_2.6.0010.1012.2009/firmware/RTL8192SE/rtl8192sfw.bin > \<br />
/lib/firmware/RTL8192SU/rtl8192sfw.bin</pre><br />
<br />
Note: An alternate version of the firmware may be found [http://launchpadlibrarian.net/37387612/rtl8192sfw.bin.gz here], but this version may cause dropped connections.<br />
<br />
Note: [[wicd]] may cause excessive dropped connections with this driver, while [[NetworkManager]] appears to work better.<br />
<br />
====rt2x00====<br />
Unified driver for Ralink chip-sets (replaces rt2500,rt61,rt73 etc). In kernel since 2.6.24, some devices require extra firmware. It can be configured using the standard wpa_supplicant and iwconfig tools.<br />
<br />
Some chips require a firmware file, which is installed by default in Arch (linux-firmware).<br />
<br />
See: [[Using the new rt2x00 beta driver]]<br />
<br />
====rt2500, rt61, rt73 (obsolete)====<br />
For Ralink <br />
* PCI/PCMCIA based rt2500 series chip-sets.<br />
* PCI/PCMCIA based rt61 series chip-sets<br />
* USB based rt73 series chip-sets. <br />
<br />
Drivers are now '''obsolete''' and '''unsupported'''. The rt2x00 driver family is stable and to be used instead.<br />
<br />
Support standard iwconfig tools for unencrypted and WEP connections, although it can be quite sensitive to the order of commands.<br />
The driver does support WPA (using hardware encryption), but in a non-standard way. wpa_supplicant appears to include special support for this driver, and it is also possible to negotiate a WPA connection manually using iwpriv commands.<br />
See [http://rt2400.cvs.sourceforge.net/*checkout*/rt2400/source/rt2500/Module/iwpriv_usage.txt these instructions] for details.<br />
<br />
====madwifi-ng====<br />
Package: '''madwifi''' (and optionaly '''madwifi-utils''')<br />
<br />
The module is called <tt>ath_pci</tt>.<br />
<br />
Note there are newer modules maintained by the MadWifi team:<br />
* [[#ath5k|ath5k]] will eventually phase out ath_pci. Currently a better choice for some chipsets.<br />
* [[#ath9k|ath9k]] is the new, official, superior driver for newer Atheros hardware (see below).<br />
<br />
modprobe ath_pci<br />
for the older driver, or:<br />
modprobe ath5k<br />
for the development version. Note that not all cards work with ath5k yet.<br />
<br />
If using ath_pci, you may need to blacklist ath5k by adding it to the MODULES=array in {{Filename|/etc/rc.conf}}, and subsequently prefixing it with a bang (!):<br />
MODULES=(!ath5k forcedeth snd_intel8x0 ... ...)<br />
<br />
Some users '''may need''' to use the 'countrycode' option when loading the MadWifi driver in order to use channels and transmit power settings that are legal in their country/region. In the Netherlands, for example, you would load the module like this:<br />
<br />
modprobe ath_pci countrycode=528<br />
<br />
You can verify the settings with the <tt>iwlist</tt> command. See <tt>man iwlist</tt> and the [http://madwifi-project.org/wiki/UserDocs/CountryCode CountryCode page on the MadWifi wiki]. To have this setting automatically applied during boot, add the following to {{Filename|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
{{Note| The new module-init-tools 3.8 package changes the location of the configuration file: {{Filename|/etc/modprobe.conf}} is no longer read, instead {{Filename|/etc/modprobe.d/modprobe.conf}} is used. [http://www.archlinux.org/news/450/ link]}}<br />
<br />
options ath_pci countrycode=528<br />
<br />
{{Note|A user had to remove the countrycode option completely or else the ath0 device was not created (kernel 2.6.21).}}<br />
<br />
====ath5k====<br />
ath5k is the preferred driver for AR5xxx chipsets including those which are already working with madwifi-ng and for some chipsets older than AR5xxx. <br />
<br />
If ath5k is conflicting with ath_pci on your system, blacklist (and unload using rmmod or reboot) the following drivers...<br />
MODULES=(<br />
...<br />
!ath_hal !ath_pci !ath_rate_amrr !ath_rate_onoe !ath_rate_sample !wlan !wlan_acl !wlan_ccmp !wlan_scan_ap !wlan_scan_sta !wlan_tkip !wlan_wep !wlan_xauth<br />
...<br />
)<br />
<br />
then modprobe ath5k manualy or reboot. wlan0 (or wlanX) in sta mode should spawn and become ready to use.<br />
<br />
Info:<br />
* http://wireless.kernel.org/en/users/Drivers/ath5k<br />
* http://wiki.debian.org/ath5k<br />
<br />
{{Note|Some laptop have problem of Wireless LED indicator flickers red and blue. To solve this problem do :<br />
echo none > "/sys/class/leds/ath5k-phy0::tx/trigger"<br />
echo none > "/sys/class/leds/ath5k-phy0::rx/trigger"<br />
For alternative look {{[https://bugzilla.redhat.com/show_bug.cgi?id=618232 here]}}}}<br />
<br />
====ath9k====<br />
ath9k is Atheros' officially supported driver for the newer 11n chip-sets. All of the chips with 11n capabilities are supported, with a maximum throughput around 180 Mbps. To see a complete list of supported hardware, check this [http://wireless.kernel.org/en/users/Drivers/ath9k page].<br />
<br />
Working modes: Station, AP and Adhoc.<br />
<br />
ath9k has been part of the kernel as of 2.6.27. Support seems acceptable as of 2.6.32 (see [http://linuxwireless.org/en/users/Drivers/ath9k/bugs#Minimal_kernel_requirements details on linuxwireless.org]). (In the unlikely event that you have stability issues that trouble you, you could try using the [http://wireless.kernel.org/en/users/Download compat-wireless] package.<br />
An [https://lists.ath9k.org/mailman/listinfo/ath9k-devel ath9k mailing list] exists for support and development related discussions.)<br />
<br />
Info:<br />
* http://wireless.kernel.org/en/users/Drivers/ath9k<br />
* http://wiki.debian.org/ath9k<br />
<br />
====ath9k_htc====<br />
ath9k_htc is Atheros' officially supported driver for 802.11n USB devices. Station and Ad-Hoc modes are supported. Since 2.6.35, the driver has been included in the kernel. For more information, see http://wireless.kernel.org/en/users/Drivers/ath9k_htc .<br />
<br />
====ipw2100 and ipw2200====<br />
Fully supported in the kernel, but requires additional firmware. It can be configured using the standard wpa_supplicant and iwconfig tools.<br />
<br />
Depending on which of the chips you have, use either:<br />
<br />
'''ipw2100-fw'''<br />
pacman -S ipw2100-fw<br />
<br />
or:<br />
<br />
'''ipw2200-fw'''<br />
pacman -S ipw2200-fw<br />
<br />
If installing after initial Arch installation, the module may need to be reloaded for the firmware to be loaded; run the following as root:<br />
<br />
rmmod ipw2200<br />
modprobe ipw2200<br />
<br />
=====Enabling the radiotap interface=====<br />
Launch the following (as root):<br />
<br />
rmmod ipw2200<br />
modprobe ipw2200 rtap_iface=1<br />
<br />
=====Enabling the LED=====<br />
Most laptops will have a front LED to indicate when the wireless is connected (or not). Run the following (as root) to enable this feature:<br />
<br />
echo "options ipw2200 led=1" >> /etc/modprobe.d/ipw2200.conf<br />
<br />
or if using sudo:<br />
<br />
echo "options ipw2200 led=1" | sudo tee -a /etc/modprobe.d/ipw2200.conf<br />
<br />
====iwl3945, iwl4965 and iwl5000-series====<br />
'''I'''ntel's open source '''W'''i-Fi drivers for '''L'''inux (See [http://intellinuxwireless.org iwlwifi]) will work for both the 3945 and 4965 chipsets since kernel 2.6.24. And iwl5000-series chipsets (including 5100BG, 5100ABG, 5100AGN, 5300AGN and 5350AGN) module has been supported since '''kernel 2.6.27''', by the intree driver '''iwlagn'''.<br />
<br />
=====Installing Firmware (Microcode)=====<br />
'''Important:''' Installing these firmware packages is not required since the 2.6.34 kernel update, when the firmware files were moved to the linux-firmware package.<br />
<br />
If you need wireless connectivity to access pacman's repositories, the firmware files are also available direct from Intel. See [http://intellinuxwireless.org/?n=downloads this ] page, select and download the archive.<br />
$ wget http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-XXXX-ucode-XXX.XX.X.XX.tgz<br />
<br />
After downloading, you must extract and copy the *.ucode file to the firmware directory, commonly {{Filename|/lib/firmware}}<br />
# tar zxvf iwlwifi-XXXX-ucode-XXX.XX.X.XX.tgz<br />
# cd iwlwifi-XXXX-ucode-XXX.XX.X.XX/<br />
# cp iwlwifi-XXXX-X.ucode /lib/firmware/<br />
<br />
=====Loading the Driver=====<br />
If MOD_AUTOLOAD is set to yes in {{Filename|/etc/rc.conf}} (it is by default) that should be all that is required. Simply check for the presence of the drivers by running '''ifconfig -a''' from a terminal. There should be a listing for wlan0.<br />
<br />
{{Note|MOD_AUTOLOAD is deprecated as of initscripts 2011.06.1-1 and has no effect. You can use [[udev]] rules to achieve the same effect. For more info, see [[Rc.conf#Hardware]]}}<br />
<br />
Do this ONLY if MOD_AUTOLOAD is not set: to manually load the driver at startup, edit {{Filename|/etc/rc.conf}} as root and add '''iwl3945''' or '''iwl4965''' respectively to the MODULES array. For example:<br />
<br />
MODULES=( ... b44 mii '''iwl3945''' snd-mixer-oss ...)<br />
<br />
The drivers should now load after a reboot, and running '''ifconfig -a''' from a terminal should report '''wlan0''' as a new network interface.<br />
<br />
=====Disabling LED blink=====<br />
<br />
The default settings on the module are to have the LED blink on activity. Some people like myself find this extremely annoying. To have the LED on solid when Wi-Fi is active:<br />
<br />
# echo "options iwlcore led_mode=1" >> /etc/modprobe.d/modprobe.conf<br />
# rmmod iwlagn<br />
# rmmod iwlcore<br />
# modprobe iwlcore<br />
# modprobe iwlagn<br />
<br />
On Linux 2.6.39.1-1 and up, the iwlcore module was deprecated. Use "options iwlagn led_mode=1" or "options iwl_legacy led_mode=1" instead (find out what module is loaded with lsmod).<br />
<br />
=====Other Notes=====<br />
* The MS Windows NETw4x32 driver can be used with ndiswrapper as an alternative to the iwl3945 and ipw3945 drivers<br />
* In some cases (specifically a [[Dell Latitude D620]] with Arch 2008.06, though it could happen elsewhere) after installation you may have both iwl3945 and ipw3945 in your <tt>MODULES=()</tt> section of {{Filename|/etc/rc.conf}}. The card will not work with both modules loaded, so you will have to ! out the ipw3945 module and then reboot or remove the module manually before you can use your wireless card.<br />
* By default iwl3945 is configured to only work with networks on channels 1-11. Higher frequency bands are not allowed in some parts of the world (e.g. the US). In the EU however, channels 12 and 13 are used quite commonly (and Japan allows for channel 14). To make iwl3945 scan for all channels, add "options cfg80211 ieee80211_regdom=EU" to {{Filename|/etc/modprobe.d/modprobe.conf}}. With "iwlist f" you can check which channels are allowed.<br />
* If you want to enable more channels on Intel Wifi 5100 (and quite possible other cards too) you can do that with the crda package. After install, edit {{Filename|/etc/conf.d/wireless-regdom}} and uncomment the line where your country code is found. Add wireless-regdom to your DAEMONS in {{Filename|rc.conf}} and restart (which is the easiest thing to do). You should now, when writing sudo iwlist wlan0 channel, have access to more channels (depending on your location).<br />
* Wi-Fi power management can be enabled by adding:<br />
iwconfig wlan0(change as appropriate) power on<br />
to {{Filename|/etc/rc.local}}.<br />
<br />
====ipw3945 (obsolete)====<br />
{{Note| ''The ipw3945 driver is no longer actively developed, and the iwlwifi driver (described above) should work perfectly, but may conflict with the former one. Therefore only one of them should be installed. If you choose to use the iwlwifi driver, the '''ipw3945-ucode''' package is still required.''}}<br />
# pacman -S ipw3945 ipw3945-ucode ipw3945d<br />
To initialize the driver on startup, edit <tt>/etc/rc.conf</tt> as root and add '''ipw3945''' to the MODULES array and '''ipw3945d''' to the DAEMONS array. For example:<br />
<br />
MODULES=(... mii '''ipw3945''' snd-mixer-oss ...)<br />
<br />
DAEMONS=(syslog-ng '''ipw3945d''' network ...)<br />
<br />
'''Note:''' The '''ipw3945d''' daemon ''must'' be inserted BEFORE all other network daemons in the array.<br />
<br />
====orinoco====<br />
This should be part of the kernel package and be installed already.<br />
<br />
Note: Some orinoco chipsets are Hermes I/II. You can use http://aur.archlinux.org/packages.php?ID=9637 to replace the orinoco driver and gain WPA support. See http://ubuntuforums.org/showthread.php?p=2154534#post2154534 for more information.<br />
<br />
To use the driver, blacklist orinoco_cs in <tt>/etc/rc.conf</tt> (!orinoco_cs in the MODULES array) and add wlags49_h1_cs. Example:<br />
MODULES=(!eepro100 ''!orinoco_cs'' '''wlags49_h1_cs''')<br />
<br />
====ndiswrapper====<br />
Ndiswrapper is not a real driver, but you can use it when there are no native Linux kernel drivers for your wireless chips. So it is very useful in some situations. To use it you need the *.inf file from your Windows driver (the *.sys file must also be present in the same directory). Be sure to use drivers appropriate to your architecture (i.e. 32/64bit). If you need to extract these files from an *.exe file, you can use either cabextract or wine.<br />
<br />
Follow these steps to configure ndiswrapper.<br />
<pre><br />
#Install the driver to /etc/ndiswrapper/*<br />
ndiswrapper -i filename.inf<br />
#List all installed driver for ndiswrapper<br />
ndiswrapper -l<br />
#Write configuration file in /etc/modprobe.d/ndiswrapper.conf<br />
ndiswrapper -m<br />
depmod -a</pre><br />
<br />
Now the ndiswrapper install is almost finished; you just have to update /etc/rc.conf to load the module at boot (below is a sample of my config; yours might look slightly different):<br />
<br />
<pre>MODULES=(ndiswrapper snd-intel8x0 !usbserial)</pre><br />
<br />
The important part is making sure that ndiswrapper exists on this line, so just add it alongside the other modules. It would be best to test that ndiswrapper will load now, so:<br />
<br />
<pre>modprobe ndiswrapper<br />
iwconfig</pre><br />
<br />
and wlan0 should exist. Check this page if you're having problems:<br />
[http://ndiswrapper.sourceforge.net/joomla/index.php?/component/option,com_openwiki/Itemid,33/id,installation/ Ndiswrapper installation wiki].<br />
<br />
====prism54====<br />
Download the firmware driver for your appropriate card from [http://linuxwireless.org/en/users/Drivers/p54 this site]. Rename the firmware file to 'isl3890'.<br />
If nonexistent, create the directory /lib/firmware and place the file 'isl3890' in it. This should do the trick. [http://bbs.archlinux.org/viewtopic.php?t=16569&start=0&postdays=0&postorder=asc&highlight=siocsifflags+such+file++directory]<br />
<br />
If that did not work, try this:<br />
<br />
*Reload the prism module (modprobe p54usb or modprobe p54pci, depending on your hardware)<br />
alternatively remove your wifi card and then reconnect it<br />
*Use the "dmesg" command, and look at the end of the output it prints out.<br />
Look for a section looking like this: <br />
firmware: requesting '''isl3887usb_bare'''<br />
p54: LM86 firmware<br />
p54: FW rev 2.5.8.0 - Softmac protocol 3.0<br />
and try renaming the firmware file to the name corresponding to the part bolded here.<br />
<br />
If you get message <br />
SIOCSIFFLAGS: Operation not permitted<br />
when performing 'ifconfig wlan0 up' OR <br />
prism54: Your card/socket may be faulty, or IRQ line too busy :(<br />
appears in dmesg this may be because you have both the deprecated kernel module "prism54" and the newer kernel module "p54pci" or "p54usb" loaded at the same time and they are fighting over ownership of the IRQ. Use command "lsmod | grep prism54" to see if indeed the deprecated module is being loaded. If so you need to stop "prism54" loading by [[blacklisting]] it (there are several ways to do this which are described elsewhere). Once blacklisted, you may find you have to rename the firmware as prism54 and p54pci/p54usb look for different firmware filenames (i.e. recheck the dmesg output after performing ifconfig wlan0 up).<br />
<br />
====ACX100/111====<br />
packages: tiacx tiacx-firmware<br />
<br />
The driver should tell you which firmware it needs; check /var/log/messages.log or use the dmesg command.<br />
<br />
Link the appropriate firmware to '/lib/firmware':<br />
ln -s /usr/share/tiacx/acx111_2.3.1.31/tiacx111c16 /lib/firmware<br />
<br />
For another way to determine which firmware revision number to use, see the [http://acx100.sourceforge.net/wiki/Firmware "Which firmware" section] of the acx100.sourceforge wiki. For ACX100, you can follow the links provided there, to a table of card model number vs. "firmware files known to work"; you can figure out the rev. number you need, by looking at the suffix there. E.g. a dlink_dwl650+ uses "1.9.8.b", in which case you'd do this:<br />
ln -s /usr/share/tiacx/acx100_1.9.8.b/* /lib/firmware<br />
<br />
If you find that the driver is spamming your kernel log, for example because you're running Kismet with channel-hopping, you could put this in /etc/modprobe.d/modprobe.conf:<br />
options acx debug=0<br />
<br />
{{Note|The open-source acx driver does not support WPA/RSN encryption. Ndiswrapper will have to be used with the windows driver to enable the enhanced encryption. See ndiswrapper, this page, for more details.}}<br />
<br />
==== b43 ====<br />
See the [[Broadcom_wireless|Broadcom wireless]] page.<br />
<br />
====broadcom-wl====<br />
See the [[Broadcom_wireless|Broadcom wireless]] page.<br />
<br />
====brcm80211====<br />
See the [[Broadcom_wireless|Broadcom wireless]] page.<br />
<br />
====rtl8187====<br />
See: [[Rtl8187_wireless|rtl8187]]<br />
<br />
====zd1211rw====<br />
[http://zd1211.wiki.sourceforge.net/ zd1211rw] is a driver for the ZyDAS ZD1211 802.11b/g USB WLAN chipset and it is included in recent versions of the Linux kernel. See [http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices] for a list of supported devices. You only need to install the firmware for the device: <pre>pacman -S zd1211-firmware</pre><br />
<br />
====carl9170====<br />
[http://wireless.kernel.org/en/users/Drivers/carl9170/ carl9170] is the 802.11n USB driver with GPLv2 firmware for Atheros USB AR9170 devices. It support these [http://wireless.kernel.org/en/users/Drivers/carl9170#available_devices devices]. The '''firmware''' is not yet part of the linux-firmware package, it is available in [https://aur.archlinux.org/packages.php?ID=44102/ AUR]. The '''driver''' is part of '''kernel 2.6.37''', for older kernel use the driver package from [https://aur.archlinux.org/packages.php?ID=44100/ AUR]. <br />
In order to use this driver, the older ar9170usb driver module must be blocked by adding the following lines to /etc/modprobe.d/modprobe.conf:<br />
<pre>blacklist arusb_lnx <br />
blacklist ar9170usb</pre><br />
<br />
===Test installation===<br />
After loading your driver run<br />
iwconfig<br />
to ensure a wireless interface (wlan''x'', eth''x'', ath''x'') is created.<br />
<br />
If no such interface is visible, modprobing it might work. To start your driver, use the '''rmmod''' and '''modprobe''' commands (if rmmod fails, continue with modprobe).<br />
<br />
Example: if your driver is called "driverXXX", you would run the following commands:<br />
# rmmod driverXXX<br />
# modprobe driverXXX<br />
<br />
Bring the interface up with <code>ifconfig <interface> up</code>. e.g. assuming the interface is <code>wlan0</code>:<br />
# ifconfig wlan0 up<br />
If you get this error message: <code>SIOCSIFFLAGS: No such file or directory</code> it most certainly means your wireless chipset requires a firmware to function, which you need to install as explained above.<br />
<br />
{{Note|net-tools has been deprecated as of 2011-06-08, and the ''ifconfig'' command may not be available on your system. Try using <code>ip link set wlan0 up</code> instead.}}<br />
<br />
==Part II: Wireless management==<br />
Assuming that your drivers are installed and working properly, you will need to choose a method for managing your wireless connections. The following subsections will help you decide the best way to do just that.<br />
<br />
Procedure and tools required will depend on several factors:<br />
* The desired nature of configuration management; from a completely manual command line setup procedure repeated at each boot to a software-managed, automated solution<br />
* The encryption type (or lack thereof) which protects the wireless network<br />
* The need for network profiles, if the computer will frequently change networks (such as a laptop)<br />
<br />
===Management methods===<br />
This table shows the different methods that can be used to activate and manage a wireless network connection, depending on the encryption and management types, and the various tools that are required. Although there may be other possibilities, these are the most frequently used:<br />
{| border="1"<br />
! Management || No encryption/WEP || WPA/WPA2 PSK<br />
|-<br />
| Manual, need to repeat at each computer reboot || <code>ifconfig + iwconfig + dhcpcd/ifconfig</code> || <code>ifconfig + iwconfig + wpa_supplicant + dhcpcd/ifconfig</code><br />
|-<br />
| Automatically managed, centralized without network profile support || define interface in <code>/etc/rc.conf</code> || not covered<br />
|-<br />
| Automatically managed, with network profiles support || colspan="2" align="center" | <code>Netcfg, newlan (AUR), wicd, NetworkManager, etc…</code><br />
|}<br />
<br />
More choice guide: <br />
<br />
{| border="1"<br />
! - || Netcfg+Newlan(AUR) || Wicd ||NetworkManager+network-manager-applet<br />
|-<br />
| auto connect at boot || with net-profiles daemon config in rc.conf || yes || yes<br />
|-<br />
| auto connect if dropped <br>or changed location || with net-auto-wireless daemon config in rc.conf || yes || yes<br />
|-<br />
| support 3G Modem || || || yes<br />
|-<br />
| GUI (proposes to manage and connect/disconnect<br> profiles from a systray icon. <br>Automatic wireless detection is also available) || with ArchAssitant || yes || yes<br />
|-<br />
| console tools || with wifi-select || wicd-curses(part of wicd package) || nmcli<br />
|-<br />
| connect speed || slow || || fast<br />
|}<br />
<br />
Whatever your choice, you should try to connect using the manual method first. This will help you understand the different steps that are required and debug them in case a problem arose. Another tip: if possible (e.g. if you manage your wifi access point), try connecting with no encryption, to check everything works. Then try using encryption, either WEP (simpler to configure -- but crackable in a matter of minutes, so it's hardly more secure than an unencrypted connection) or WPA.<br />
<br />
When it comes to ease of use, NetworkManager (with Gnome network-manager-applet) and wicd have good GUIs and can provide a list of available networks to connect, they prompt for passwords, which is straightforward and highly recommended. (Note Gnome network-manager-applet also works under xfce4 if you install xfce4-xfapplet-plugin first, also there are applet available for KDE.) <br />
<br />
====Manual setup====<br />
The programs provided by the package '''wireless_tools''' are the basic set of tools to set up a wireless network. Moreover, if you use WPA/WPA2 encryption, you will need the package '''wpa_supplicant'''. These powerful userspace console tools work extremely well and allow complete, manual control from the shell.<br />
<br />
These examples assume your wireless device is <code>wlan0</code>. Replace <code>wlan0</code> with the appropriate device name.<br />
{{Note| Depending on your hardware and encryption type, some of these steps may not be necessary. Some cards are known to require interface activation and/or access point scanning before being associated to an access point and being given an IP address. Some experimentation may be required. For instance, WPA/WPA2 users may directly try to activate their wireless network from step 3.}}<br />
<br />
'''Step 0.''' ''(Optional, may be required)'' At this step you may need to set the proper operating mode of the wireless card. More specifically, if you're going to connect an ad-hoc network, you might need to set the operating mode to ''ad-hoc:''<br />
# iwconfig wlan0 mode ad-hoc<br />
<br />
{{Note| Ideally, you should a priori know, which type of network you are going to connect. If you don't, scan the network as described in step 2 below, then, if necessary, return back to this step and change the mode. Also, please, bear in mind that changing the operating mode might require the wlan interface to be ''down'' (<code>ifconfig wlan0 down</code>).}}<br />
<br />
'''Step 1.''' ''(Also optional, may be required)'' Some cards require that the kernel interface be activated before you can use the wireless_tools:<br />
# ifconfig wlan0 up<br />
<br />
'''Step 2.''' See what access points are available:<br />
# iwlist wlan0 scan<br />
<br />
{{Note| If it displays "''Interface does not support scanning''" then you probably forgot to install the firmware. You can also try bringing up the interface first as shown in point 1.}}<br />
<br />
'''Step 3.''' Depending on the encryption, you need to associate your wireless device with the access point to use and pass the encryption key.<br />
<br />
Assuming you want to use the ESSID named <code>MyEssid</code>:<br />
* ''No encryption''<br />
# iwconfig wlan0 essid "MyEssid"<br />
* ''WEP''<br />
using an hexadecimal key:<br />
# iwconfig wlan0 essid "MyEssid" key 1234567890<br />
using an ascii key:<br />
# iwconfig wlan0 essid "MyEssid" key s:asciikey<br />
* ''WPA/WPA2''<br />
<br />
You need to edit the <code>/etc/wpa_supplicant.conf</code> file as described in [[WPA_Supplicant]]. Then, issue this command:<br />
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf<br />
<br />
This is assuming your device uses the <code>wext</code> driver. If this does not work, you may need to adjust these options. <br />
If connected successfully, continue in a new terminal (or quit wpa_supplicant with CTRL+C and add the -B switch to above command to run it in the background). [[WPA_Supplicant]] contains more information and troubleshooting.<br />
<br />
Regardless of the method used, you can check if you have associated successfully as follows:<br />
# iwconfig wlan0<br />
Note: In some setups it may still display "Access Point: Not-Associated", continue onto the next step.<br />
<br />
<br />
'''Step 4.''' Finally, provide an IP address to the network interface. Simple examples are:<br />
# dhcpcd wlan0<br />
for DHCP, or<br />
# ifconfig wlan0 192.168.0.2<br />
# route add default gw 192.168.0.1<br />
for static IP.<br />
<br />
Note: If you get an timeout error due to a ''waiting for carrier'' problem then you might have to set channel mode to auto for the specific device.<br />
<br />
# iwconfig wlan0 channel auto <br />
<br />
{{Note| Although the manual configuration method will help troubleshoot wireless problems, you will have to retype every command each time you reboot.}}<br />
<br />
====Automatic setup====<br />
There are many solutions to choose from, but remember that all of them are mutually exclusive; you should not run two daemons simultaneously.<br />
<br />
=====Standard network daemon=====<br />
{{Note| This method and configuration examples are only valid for unencrypted or WEP-encrypted networks, which are particularly unsecure. To use WPA/WPA2, you will need to use other solutions such as '''[[netcfg]]''' or '''[[wicd]]'''. Also, avoid mixing these methods as they may create a conflict and prevent the wireless card from functioning.}}<br />
<br />
* The '''/etc/rc.conf''' file is sourced by the network script. Therefore, you may define and configure a simple wireless setup within /etc/rc.conf for a centralized approach with '''wlan_<interface>="<interface> essid <essid>"''' and '''INTERFACES=(<interface1> <interface2>)'''. The name of the network goes in place of '''MyEssid'''.<br />
<br />
For example:<br />
# /etc/rc.conf<br />
eth0="dhcp"<br />
wlan0="dhcp"<br />
wlan_wlan0="wlan0 essid MyEssid" # Unencrypted<br />
#wlan_wlan0="wlan0 essid MyEssid key 1234567890" # hex WEP key<br />
#wlan_wlan0="wlan0 essid MyEssid key s:asciikey" # ascii WEP key<br />
INTERFACES=(eth0 wlan0)<br />
<br />
Not all wireless cards are <code>wlan0</code>. Determine your wireless interface with ifconfig -a. <br />
Atheros-based cards, for example, are typically <code>ath0</code>, so change <code>wlan_wlan0</code> to:<br />
wlan_ath0="ath0 essid MyEssid key 12345678" <br />
Also define ath0 in the INTERFACES=line.)<br />
<br />
* Alternatively, you may define wlan_<interface> within /etc/conf.d/wireless, (which is also sourced by the network script), for a de-centralized approach:<br />
# /etc/conf.d/wireless<br />
wlan_wlan0="wlan0 essid MyEssid"<br />
<br />
These solutions are limited for a laptop which is always on the move. It would be good to have multiple [[Network Profiles]] and be able to easily switch from one to another. That is the aim of network managers, such as netcfg.<br />
<br />
=====Netcfg=====<br />
'''netcfg''' provides a ''versatile, robust and fast'' solution to networking on Arch.<br />
<br />
It uses a profile based setup and is capable of detection and connection to a wide range of network types. This is no harder than using graphical tools. Following the directions above, you can get a list of wireless networks. Then, as with graphical tools, you will need a password.<br />
<br />
See: [[Netcfg]]<br />
<br />
=====Netcfg Easy Wireless LAN (newlan)=====<br />
newlan is a mono console application that starts a user-friendly wizard to create netcfg profiles, it supports also wired connections.<br />
<br />
Install from [[AUR]]: http://aur.archlinux.org/packages.php?ID=33649<br />
<br />
Or use the [[AUR]] helper of your choice.<br />
<br />
newlan must be run with root privileges:<br />
# sudo newlan -n mynewprofile<br />
<br />
=====Wicd=====<br />
Wicd is a network manager that can handle both wireless and wired connections. It is written in Python and Gtk with fewer dependencies than NetworkManager, making it an ideal solution for lightweight desktop users. Wicd is now available in the extra repository for both i686 and x86_64.<br />
<br />
See: [[Wicd]]<br />
<br />
=====NetworkManager=====<br />
NetworkManager is an advanced network management tool that is enabled by default in most popular GNU/Linux distributions. In addition to managing wired connections, NetworkManager provides worry-free wireless roaming with an easy-to-use GUI program for selecting your desired network. <br />
<br />
See: [[NetworkManager]]<br />
<br />
=====WiFi Radar=====<br />
WiFi Radar is a Python/PyGTK2 utility for managing wireless profiles (and ''only'' wireless). It enables you to scan for available networks and create profiles for your preferred networks.<br />
<br />
See: [[Wifi Radar]]<br />
<br />
=====Wlassistant=====<br />
Wlassistant is a very intuitive and straightforward GUI application for managing your wireless connections. <br />
<br />
Install from AUR: http://aur.archlinux.org/packages.php?ID=1726<br />
<br />
Wlassistant must be run with root privileges:<br />
# sudo wlassistant<br />
One method of using wlassistant is to configure your wireless card within {{Filename|/etc/rc.conf}}, specifying the access point you use most often. On startup, your card will automatically be configured for this ESSID, but if other wireless networks are needed/available, wlassistant can then be invoked to access them. Background the network daemon in {{Filename|/etc/rc.conf}}, by prefixing it with a @, to avoid boot delays.<br />
<br />
==See also==<br />
*[[Sharing PPP Connection]]<br />
*[[Ad-hoc networking]]<br />
<br />
==External links==<br />
*[http://www.gnome.org/projects/NetworkManager/ NetworkManager] -- The official website for NetworkManager<br />
*[http://wicd.sourceforge.net/ WICD] -- The official website for WICD<br />
*[http://wifi-radar.berlios.de/ WiFi Radar] -- WiFi Radar information page<br />
*[http://madwifi.org/wiki/UserDocs/FirstTimeHowTo The madwifi project's method of installing] -- Recommended if you are having trouble after reading this article</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Apache_HTTP_Server&diff=147651Apache HTTP Server2011-06-29T19:23:29Z<p>Reventlov: /* PHP */ AddHandler php5-script php</p>
<hr />
<div>[[Category:Web Server (English)]]<br />
{{i18n|LAMP}}<br />
[[de:LAMP Installation]]<br />
[[fr:Lamp]]<br />
<br />
[http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29 LAMP] refers to a common combination of software used in many web servers: '''L'''inux, '''A'''pache, '''M'''ySQL, and '''P'''HP. This article describes how to set up the [http://httpd.apache.org Apache HTTP Server] on an Arch Linux system. It also tells how to optionally install [[PHP]] and [[MySQL]] and integrate these in the Apache server.<br />
<br />
If you only need a web server for development and testing, [[Xampp]] might be a better and easier option.<br />
<br />
==Installation==<br />
# pacman -S apache php php-apache mysql<br />
<br />
This document assumes you will install Apache, PHP and MySQL together. If desired however, you may install Apache, PHP, and MySQL separately and simply refer to the relevant sections below.<br />
<br />
{{Note|New default user and group: Instead of group "nobody", apache now runs as user/group "http" by default. You might want to adjust your httpd.conf according to this change, though you may still run httpd as nobody.}}<br />
<br />
==Configuration==<br />
<br />
===Apache===<br />
For security reasons, as soon as Apache is started by the root user (directly or via startup scripts) it switches to the UID/GID specified in {{filename|/etc/httpd/conf/httpd.conf}}<br />
<br />
* Check for the existence of the http user by looking for ''http'' in the output of the following command:<br />
# grep http /etc/passwd<br />
<br />
* Create the system user http if it does not exist already:<br />
# useradd -d /srv/http -r -s /bin/false -U http<br />
:This creates the http user with home directory {{filename|/srv/http/}}, as a system account (-r), with a bogus shell (-s {{filename|/bin/false}}) and creates a group with the same name (-U).<br />
<br />
* Add this line to {{Filename|/etc/hosts}} (If the file does not exist, create it.):<br />
127.0.0.1 localhost.localdomain localhost<br />
:If you want a different hostname, append it to the end:<br />
127.0.0.1 localhost.localdomain localhost myhostname<br />
<br />
* Edit {{Filename|/etc/[[rc.conf]]}}: If you set a hostname, the {{Codeline|HOSTNAME}} variable should be the same; otherwise, use {{Codeline|"localhost"}}:<br />
#<br />
# Networking<br />
#<br />
HOSTNAME="localhost"<br />
<br />
* Make sure the hostname appears in /etc/hosts or apache will fail to start. Alternatively, you can<br />
edit {{Filename|/etc/httpd/conf/httpd.conf}} and comment the following module:<br />
LoadModule unique_id_module modules/mod_unique_id.so<br />
<br />
* Customize your config. At least change {{Filename|httpd.conf}} and {{Filename|extra/httpd-default.conf}} to your liking. For security reasons, you might want to change '''ServerTokens Full''' to '''ServerTokens Prod''' and '''ServerSignature On''' to '''ServerSignature Off''' in {{Filename|extra/httpd-default.conf}}.<br />
<br />
* Run the following in a terminal to start the HTTP server:<br />
# /etc/rc.d/httpd start<br />
<br />
:Apache should now be running. Test by visiting http://localhost/ in a web browser. It should display a simple Apache test page. If you receive a 403 Error, comment out the following line in {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
Include conf/extra/httpd-userdir.conf<br />
<br />
* To start Apache automatically at boot, edit {{Filename|/etc/rc.conf}} and add the '''httpd''' daemon:<br />
DAEMONS=(... '''httpd''' ...)<br />
:Or add this line to {{Filename|/etc/rc.local}}:<br />
/etc/rc.d/httpd start<br />
<br />
====User dirs====<br />
* If you do not want user directories to be available on the web (e.g., {{Filename|~/public_html}} on the machine is accessed as http://localhost/~user/), comment the following line in {{Filename|/etc/httpd/conf/httpd.conf}} since they are activated by default:<br />
Include conf/extra/httpd-userdir.conf<br />
<br />
* You must make sure that your home directory permissions are set properly so that Apache can get there. Your home directory and {{Filename|~/public_html/}} must be executable for others ("rest of the world"). This seems to be enough:<br />
$ chmod o+x ~<br />
$ chmod o+x ~/public_html<br />
<br />
* More secure way to share your home folder with apache is to add '''http user''' in group that your home folder belongs. For example, if your home folder and other sub-folders in your home folder belong to group '''piter''', all you have to do is following:<br />
<br />
$ usermod -aG piter http<br />
<br />
* Ofcourse, you have to give ''read'' and ''execute'' permissions on {{Filename|~/}}, {{Filename|~/public_html}}, and all other sub-folders in {{Filename|~/public_html}} to the group members (group '''piter''' in our case). Do something like following ('''modify commands for your specific case'''):<br />
<br />
$ chmod g+xr-w /home/''yourusername''<br />
$ chmod -R g+xr-w /home/''yourusername''/public_html<br />
<br />
{{Note|This way you don't have to give access to your folder to every single user in order to give access to '''http user'''. Only '''http user''' and other potential users that are in '''piter''' group will have access to your home folder.}}<br />
<br />
And then<br />
<br />
$ /etc/rc.d/httpd restart<br />
<br />
to restart apache.<br />
<br />
====SSL====<br />
Create self-signed certificate (you can change key size and days of validity)<br />
# cd /etc/httpd/conf<br />
# openssl genrsa -des3 -out server.key 1024<br />
# openssl req -new -key server.key -out server.csr<br />
# cp server.key server.key.org<br />
# openssl rsa -in server.key.org -out server.key<br />
# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt<br />
In {{Filename|/etc/httpd/conf/httpd.conf}} uncomment line<br />
Include conf/extra/httpd-ssl.conf<br />
Restart apache<br />
# /etc/rc.d/httpd restart<br />
<br />
====Virtual Hosts====<br />
If you want to have more than one host, make sure you have<br />
<pre><br />
# Virtual hosts<br />
Include conf/extra/httpd-vhosts.conf<br />
</pre><br />
in {{Filename|/etc/httpd/conf/httpd.conf}}.<br />
<br />
In {{Filename|/etc/httpd/conf/extra/httpd-vhosts.conf}} set your virtual hosts according the example, e.g.:<br />
<pre><br />
NameVirtualHost 127.0.0.1<br />
<br />
<VirtualHost 127.0.0.1><br />
ServerAdmin your@domainname1.dom<br />
DocumentRoot "/home/username/yoursites/domainname1.dom/www"<br />
ServerName domainname1.dom<br />
ServerAlias domainname1.dom<br />
<Directory /home/username/yoursites/domainname1.dom/www/><br />
DirectoryIndex index.htm index.html<br />
AddHandler cgi-script .cgi .pl<br />
Options ExecCGI Indexes FollowSymLinks MultiViews +Includes<br />
AllowOverride None<br />
Order allow,deny<br />
allow from all<br />
</Directory><br />
</VirtualHost><br />
<br />
<VirtualHost 127.0.0.1><br />
ServerAdmin your@domainname2.dom<br />
DocumentRoot "/home/username/yoursites/domainname2.dom/www"<br />
ServerName domainname2.dom<br />
ServerAlias domainname2.dom<br />
<Directory /home/username/yoursites/domainname2.dom/www/><br />
DirectoryIndex index.htm index.html<br />
AddHandler cgi-script .cgi .pl<br />
Options ExecCGI Indexes FollowSymLinks MultiViews +Includes<br />
AllowOverride None<br />
Order allow,deny<br />
allow from all<br />
</Directory><br />
</VirtualHost><br />
</pre><br />
<br />
Add your virtual host names to your {{Filename|/etc/hosts}} file:<br />
<pre>127.0.0.1 domainname1.dom<br />
127.0.0.1 domainname2.dom</pre><br />
<br />
Restart Apache:<br />
<pre>sudo /etc/rc.d/httpd restart</pre><br />
<br />
If you setup your virtual hosts to be in your user directory, sometimes it interferes with Apaches 'Userdir' settings. To avoid problems disable 'Userdir' by commenting it out:<br />
<pre><br />
# User home directories<br />
#Include conf/extra/httpd-userdir.conf</pre><br />
<br />
As said above, take care, you have the proper permissions:<br />
<pre>sudo chmod 0775 /home/yourusername/</pre><br />
<br />
If you have a huge amount of virtual hosts you easily want to dis- and enable, its recommended to create one config file per virtualhost and store them all in one folder, eg: {{Filename|/etc/httpd/conf/vhosts}}.<br />
<br />
First create the folder:<br />
<pre>sudo mkdir /etc/httpd/conf/vhosts</pre><br />
<br />
Then place the single config files in them:<br />
<pre>sudo nano /etc/httpd/conf/vhosts/domainname1.dom<br />
sudo nano /etc/httpd/conf/vhosts/domainname2.dom<br />
...</pre><br />
<br />
In the last step, "Include" the single configs in your {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
<pre>#Enabled Vhosts:<br />
Include conf/vhosts/domainname1.dom<br />
#Include conf/vhosts/domainname1.dom</pre><br />
<br />
You can enable and disable single virtual hosts by commenting them out or uncommenting them.<br />
<br />
====Advanced Options====<br />
These options in {{Filename|/etc/httpd/conf/httpd.conf}} might be interesting for you:<br />
<br />
# Listen 80<br />
This is the port Apache will listen to. For Internet-access with router, you have to forward the port.<br />
<br />
If you setup Apache for local development you may want it to be only accessible from your computer. Then change this line to:<br />
# Listen 127.0.0.1:80<br />
<br />
This is the admin's email-address which can be found on e.g. error-pages:<br />
# ServerAdmin sample@sample.com<br />
<br />
This is the directory where you should put your web pages:<br />
# DocumentRoot "/srv/http"<br />
<br />
Change it, if you want to, but do not forget to also change the<br />
<Directory "/srv/http"><br />
to whatever you changed your DocumentRoot to, or you will likely get a 403 error (lack of privileges) when you try to access the new document root. Do not forget to change the Deny from all line, otherwise you will get 403 error too.<br />
<br />
# AllowOverride None<br />
This directive in <Directory> sections causes apache to completely ignore .htaccess files. If you intend to use rewrite mod or other settings in .htaccess files, you can allow which directives declared in that file can override server configuration. For more info refer to http://httpd.apache.org/docs/current/mod/core.html#allowoverride<br />
<br />
{{Note|If you have issues with your configuration you can have apache check the configuration with:<br />
{{Codeline|apachectl configtest}}}}<br />
<br />
===PHP===<br />
* Install the "php-apache" package from extra using pacman.<br />
<br />
* Add these lines in {{Filename|/etc/httpd/conf/httpd.conf}}:<br />
:Place this in the "LoadModule" list anywhere after {{Codeline|LoadModule dir_module modules/mod_dir.so}}:<br />
LoadModule php5_module modules/libphp5.so<br />
<br />
:Place this at the end of the "Include" list:<br />
Include conf/extra/php5_module.conf<br />
:Place this at the end of the file:<br />
AddHandler php5-script php<br />
<br />
{{Note|If you do not see {{Filename|libphp5.so}} in the Apache modules directory, you may have forgotten to install the ''php-apache'' package.}}<br />
<br />
* If your {{Codeline|DocumentRoot}} is not {{Codeline|/srv/http}}, add it to {{Codeline|open_basedir}} in {{Filename|/etc/php/php.ini}} as such:<br />
open_basedir=/srv/http/:/home/:/tmp/:/usr/share/pear/:/path/to/documentroot<br />
<br />
* Restart the Apache service to make changes take effect:<br />
# /etc/rc.d/httpd restart<br />
<br />
* A test file for PHP is included by default and can be found in {{Codeline|/srv/http}}<br />
<br />
* Remember to copy this file to <tt>~/public_html</tt> if you permitted such a configuration.<!-- Also, remember to make it executable ({{Codeline|chmod o+x test.php}}).--><br />
<br />
* Test PHP: http://localhost/test.php or http://localhost/~myname/test.php<br />
<br />
* If this file does not exist, just place the following in /srv/http/test.php:<br />
<?php phpinfo(); ?><br />
<br />
:If the PHP instruction is not executed (you see : <html>...</html>), check that you have added "Includes" to the "Options" line for your root directory. Moreover, make sure you have this line in your <IfModule mime_module> section:<br />
AddHandler application/x-httpd-php .php<br />
<br />
====Advanced options====<br />
* Remember to add a file handler for .phtml if you need it in {{Filename|/etc/httpd/conf/extra/php5_module.conf}}:<br />
DirectoryIndex index.php index.phtml index.html<br />
<br />
* If you want the libGD module, install php-gd package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
{{Note|php-gd requires libpng, libjpeg, and freetype2}}<br />
;extension=gd.so<br />
to<br />
extension=gd.so<br />
<br />
:Pay attention to which extension you uncomment, as this extension is sometimes mentioned in an explanatory comment before the actual line you want to uncomment.<br />
<br />
<br />
* If you want to display errors to debug your php code, change this line of {{Filename|/etc/php/php.ini}}:<br />
display_errors=Off<br />
to<br />
display_errors=On<br />
<br />
* If you want the mcrypt module, install php-mcrypt package and uncomment in {{Filename|/etc/php/php.ini}}:<br />
;extension=mcrypt.so<br />
:to<br />
extension=mcrypt.so<br />
{{Warning|If you get error like:<br />
<pre><br />
[XXX Debug] PHP Notice: in file /index.php on line 86: date(): It is not safe to rely on the system'XXXX<br />
[XXX Debug] PHP Notice: in file /index.php on line 86: getdate(): It is not safe to rely on the system's timezone settings.XXXX</pre><br />
}}<br />
change this line of {{Filename|/etc/php/php.ini}} <br />
;date.timezone = <br />
to <br />
date.timezone = Europe/Berlin<br />
{{note| more infos about [http://php.net/manual/en/datetime.configuration.php#ini.date.timezone Time Zone in PHP] }}<br />
restart httpd with <br />
# /etc/rc.d/httpd restart<br />
<br />
===MySQL===<br />
* Configure MySQL as described in [[MySQL]].<br />
<br />
* Edit {{Filename|/etc/php/php.ini}} (this is in {{Filename|/usr/etc}} on older systems) to uncomment the following line (''By removing {{Codeline|;}}''):<br />
;extension=mysqli.so<br />
;extension=mysql.so<br />
<br />
<br />
:'''Caution:'''Some users have reported typos on this line. Please make sure that it reads {{Codeline|;extension&#61;mysql.so}} and not {{Codeline|;extension&#61;msql.so}}.<br />
<br />
* You can add minor privileged users for your web scripts by editing the tables found in the <tt>mysql</tt> database. You have to restart MySQL for changes to take effect. Do not forget to check the {{Codeline|mysql/users}} table. If there is a second entry for root and your hostname is left with no password set, everybody from your host probably could gain full access. Perhaps see next section for these jobs.<br />
<br />
* Run in terminal:<br />
# /etc/rc.d/mysqld start<br />
<br />
* You may also need to restart Apache. Run in terminal:<br />
# /etc/rc.d/httpd restart<br />
<br />
* MySQL should now be running. Set the root password and test it by running:<br />
# mysqladmin -u root password ''password''<br />
# mysql -u root -p<br />
<br />
:Type ''exit'' to exit from the CLI MySQL client<br />
<br />
* Edit {{Filename|/etc/rc.conf}} (to start MySQL at boot):<br />
DAEMONS=(... '''mysqld''' ...)<br />
Or add this line to {{Filename|rc.local}}:<br />
/etc/rc.d/mysqld start<br />
<br />
* You can get the {{Codeline|"error no. 2013: Lost Connection to mysql server during query"}} message instantly whenever you try to connect to the MySQL daemon by TCP/IP. This is the TCP wrappers system (tcpd), which uses the <tt>hosts_access(5)</tt> system to allow or disallow connections.<br />
<br />
* If you are running into this problem, be sure to add this to your {{Filename|/etc/hosts.allow}} file:<br />
# mysqld : ALL : ALLOW<br />
# mysqld-max : ALL : ALLOW<br />
# and similar for the other MySQL daemons.<br />
<br />
:Note: The examples above are the simplest case, telling tcpd to allow connections from anywhere. You may wish to use a more-appropriate choice of permissible sources instead of 'ALL'. Just make sure that localhost and the IP address (numeric or DNS) of the interface by which you connect are specified.<br />
<br />
* For example, a line like the following would overcome the "2013: Lost Connection" errors:<br />
# mysqld : 127.0.0.1 : ALLOW<br />
<br />
* You might also need to edit {{Filename|/etc/mysql/my.cnf}} and comment out the {{Codeline|skip-networking}} line as such:<br />
skip-networking<br />
to<br />
#skip-networking<br />
<br />
{{Tip|You may want to install [[PhpMyAdmin|phpmyadmin]] to work with your databases.}}<br />
<br />
==Useful terminal shortcuts==<br />
Adding these to your {{Filename|~/.bashrc}} file could save you a lot of typing:<br />
<pre><br />
alias mysqls='sudo /etc/rc.d/mysqld' #mysqls start/stop/restart starts/stops/restarts mysql<br />
alias apache='sudo /etc/rc.d/httpd' #apache start/stop/restart starts/stops/restarts apache<br />
</pre><br />
<br />
==See also==<br />
* [[MySQL]] - Article for MySQL<br />
* [[PhpMyAdmin]] - Web frontend for MySQL typically found in LAMP environments<br />
* [[Xampp]] - Self contained web-server that supports PHP, Perl, and MySQL<br />
<br />
<br />
==External links==<br />
* http://www.apache.org/<br />
* http://www.php.net/<br />
* http://www.mysql.com/<br />
* http://www.akadia.com/services/ssh_test_certificate.html<br />
* http://wiki.apache.org/httpd/CommonMisconfigurations</div>Reventlovhttps://wiki.archlinux.org/index.php?title=DNS_with_bind&diff=147586DNS with bind2011-06-29T13:49:50Z<p>Reventlov: </p>
<hr />
<div>[[Category: Web Server (English)]]<br />
<br />
{{out of date}}<br />
{{merge|Bind}}<br />
<br />
=Introduction=<br />
This is a simple tutorial in howto setup a simple home network DNS-server with bind. This tutorial is based upon [http://www.howtoforge.com/two_in_one_dns_bind9_views Two-in-one DNS...]<br />
<br />
=Install=<br />
Install bind:<br />
pacman -S bind<br />
<br />
=Basic configuration=<br />
==Kernel config==<br />
load capability-module:<br />
modprobe capability <br />
<br />
Nowtime "capability" is compiled in by default. This mean that capability can be removed from the modules list in rc.conf.<br />
<br />
Add it to start at boot:<br />
MODULES=(8139too mii via-rhine '''capability''')<br />
<br />
==Main config==<br />
Edit /etc/named.conf and edit under options:<br />
options {<br />
directory "/var/named";<br />
pid-file "/var/run/named/named.pid";<br />
auth-nxdomain yes;<br />
datasize default;<br />
allow-recursion { 127.0.0.1; };<br />
'''listen-on { any; };'''<br />
};<br />
<br />
This instructs bind to listen on any interface.<br />
<br />
=Zones=<br />
==Adding zone==<br />
Add your own zone (/etc/named.conf):<br />
zone "cgeek.net" {<br />
type master;<br />
file "cgeek.net.zone"; <br />
};<br />
<br />
On BIND 9.4.1 and later, the defaults for allowing queries changed; consider also defining '''allow-query { any; };''' to allow queries for this zone.<br />
<br />
Then create the file '''<domain>.zone''' (same name as in config above) in '''/var/named''' and paste this content and edit to fit your needs:<br />
; cgeek.net<br />
$TTL 604800<br />
@ IN SOA ns1.cgeek.net. root.cgeek.net. (<br />
2006020201 ; Serial<br />
604800 ; Refresh<br />
86400 ; Retry<br />
2419200 ; Expire<br />
604800); Negative Cache TTL<br />
;<br />
@ IN NS ns1<br />
IN MX 10 mail<br />
IN A 192.168.0.2<br />
<br />
; servers<br />
ns1 IN A 192.168.0.2<br />
www IN A 192.168.0.2<br />
max IN A 192.168.0.2<br />
gw IN A 192.168.0.1<br />
<br />
; Clients<br />
desk IN A 192.168.0.20<br />
mini IN A 192.168.0.16<br />
<br />
Restart bind with:<br />
/etc/rc.d/named restart<br />
<br />
Test the config by trying:<br />
host <computer>.<domain> localhost<br />
<br />
If all is well, you should get something like this:<br />
[root@max named]# host max.cgeek.net localhost <br />
Using domain server:<br />
Name: localhost<br />
Address: 127.0.0.1#53<br />
Aliases: <br />
<br />
max.cgeek.net has address 192.168.0.2</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Locale&diff=137203Locale2011-04-13T15:43:36Z<p>Reventlov: /* Enabling necessary locales */ s/sudo//</p>
<hr />
<div>[[Category:Internationalization (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Locale}}<br />
[[de:Locale]]<br />
[[fr:Locale]]<br />
<br />
Locales are used in Linux to define which language the user uses. As the locales define the character set which the user uses as well, setting up the correct locale is especially important if the language contains non-ASCII characters.<br />
<br />
Locale naming is defined as following:<br />
<lang>_<territory>.<codeset>[@<modifiers>]<br />
<br />
In this HOWTO we're setting up a system that uses the en_US.UTF-8 locale, but you can follow this article easily if you want to setup another locale.<br />
<br />
==Enabling necessary locales==<br />
First you have to enable the locales you want being supported by your system. To enable or disable them, the file '''/etc/locale.gen''' is used. It contains every locale you can enable, and you have just to uncomment lines you want to do so.<br />
<br />
As we want to setup an English UTF-8 conform system, we want to enable en_US.UTF-8. But for compatibility to programs that don't support UTF-8 yet, it's recommended to support any other locale, prefixed with en_US as well. Having this in mind, we enable this set of locales:<br />
en_US.UTF-8 UTF-8<br />
en_US ISO-8859-1<br />
<br />
After you've enabled the necessary locales, you have to run locale-gen as root to update them:<br />
# locale-gen<br />
Generating locales...<br />
en_US.UTF-8... done<br />
en_US.ISO-8859-1... done<br />
Generation complete.<br />
<br />
'''Note:''' Though it's most likely just one language you use on your computer it can be helpful or even necessary to enable other locales as well. For example if you're running a multi-user system with users that don't speak en_US, they won't be happy until their individual locale is at least supported by your system.<br />
<br />
==Setting system wide locale==<br />
To define which locale should be used by the system, you can easily add your locale to your '''/etc/rc.conf''' file. As we've just added ISO-8859 support just for (backward-)compatibility, we add en_US.UTF-8 here:<br />
LOCALE="en_US.UTF-8"<br />
<br />
The system wide locale will be updated after rebooting your computer.<br />
<br />
==Collation==<br />
Collation, or sorting, is a little different. Sorting is a goofy beast and different locales do things differently. To get around potential issues, Arch used to set LC_COLLATE="C" in /etc/profile. However it no longer does that. (See [http://www.archlinux.org/news/476 announcement].) If you want this behavior, you should add LC_COLLATE="C" to your script or .bashrc file yourself. Without a LC_COLLATE setting, locale aware apps sort by LC_ALL or LOCALE.<br />
<br />
Note that LC_COLLATE settings will be overridden if LC_ALL is set. Add the following to your script or .bashrc file:<br />
<br />
export LC_ALL=<br />
export LC_COLLATE="C"<br />
<br />
Now ls will sort dotfiles first, followed by uppercase and lowercase filenames.<br />
<br />
==Setting per user locale==<br />
As we discussed earlier, some users might want to define a different locale than the system-wide locale.<br />
In this case, you can export LANG in your '''~/.bashrc'''.<br />
For example you can use the en_AU.UTF-8 locale.<br />
export LANG=en_AU.UTF-8<br />
<br />
Your locales will be updated as soon as you re-source your ~/.bashrc. This happens on login or alternatively you can type:<br />
$ source ~/.bashrc<br />
<br />
==Setting starting weekday==<br />
In a lot of countries the first day of the week is Monday. To do change or add the following lines under the LC_TIME section in ''/usr/share/i18n/locales/<your_locale>''<br />
<br />
week 7;19971130;5<br />
first_weekday 2<br />
first_workday 2<br />
And then run as root<br />
<br />
# locale-gen<br />
and restart X.<br />
<br />
{{Note| If you experience some kind of problems with your system and would like to ask for help on the forum, mailing list or otherwise, please run the misbehaving program with <code>export LC_MESSAGES&#61;C</code> before posting. It will set the output messages (errors, warnings) to English thus enabling more people to understand what the problem might be, resulting in a more throughout response. This is of course not the point if you are posting to a non-English forum.}}<br />
<br />
==Troubleshooting==<br />
===How can I obtain the available locale names?===<br />
You can get the correct names of all available locales with this command:<br />
$ locale -a<br />
===How can I see which locale I am using?===<br />
Which locale is currently in use is viewable simply by typing:<br />
$ locale<br />
===My terminal doesn't support UTF-8 characters===<br />
Unfortunately some terminals don't support UTF-8. In this case, you have to use a different terminal.<br />
<br />
'''List of terminals that support UTF-8:'''<br />
* gnome-terminal<br />
* gnustep-terminal<br />
* konsole<br />
* [[mlterm]]<br />
* urxvt (rxvt-unicode)<br />
* xfce-terminal<br />
* xterm<br />
'''Note:''' This list may be incomplete.<br />
<br />
===xterm doesn't support UTF-8 characters for me===<br />
xterm only supports UTF-8 if you run it as uxterm or xterm -u8.<br />
<br />
===gnome-terminal doesn't support UTF-8 characters for me===<br />
Append these two lines to <code>/etc/environment</code> file:<br />
<br />
LANG="en_US.UTF-8"<br />
LC_ALL="en_US.UTF-8"<br />
<br />
Reboot your system, and gnome-terminal will work correctly.<br />
<br />
==Links==<br />
* [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]<br />
* [http://www.gentoo-wiki.info/Locales Gentoo Wiki Archives: Locales]<br />
* [http://demo.icu-project.org/icu-bin/locexp?_=en_US&x=col ICU's interactive collation testing]<br />
* [http://www.openi18n.org/ Free Standards Group Open Internationalisation Initiative]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Locale&diff=137201Locale2011-04-13T15:42:34Z<p>Reventlov: /* Setting starting weekday */</p>
<hr />
<div>[[Category:Internationalization (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Locale}}<br />
[[de:Locale]]<br />
[[fr:Locale]]<br />
<br />
Locales are used in Linux to define which language the user uses. As the locales define the character set which the user uses as well, setting up the correct locale is especially important if the language contains non-ASCII characters.<br />
<br />
Locale naming is defined as following:<br />
<lang>_<territory>.<codeset>[@<modifiers>]<br />
<br />
In this HOWTO we're setting up a system that uses the en_US.UTF-8 locale, but you can follow this article easily if you want to setup another locale.<br />
<br />
==Enabling necessary locales==<br />
First you have to enable the locales you want being supported by your system. To enable or disable them, the file '''/etc/locale.gen''' is used. It contains every locale you can enable, and you have just to uncomment lines you want to do so.<br />
<br />
As we want to setup an English UTF-8 conform system, we want to enable en_US.UTF-8. But for compatibility to programs that don't support UTF-8 yet, it's recommended to support any other locale, prefixed with en_US as well. Having this in mind, we enable this set of locales:<br />
en_US.UTF-8 UTF-8<br />
en_US ISO-8859-1<br />
<br />
After you've enabled the necessary locales, you have to run locale-gen as root to update them:<br />
# su -c locale-gen<br />
Generating locales...<br />
en_US.UTF-8... done<br />
en_US.ISO-8859-1... done<br />
Generation complete.<br />
<br />
'''Note:''' Though it's most likely just one language you use on your computer it can be helpful or even necessary to enable other locales as well. For example if you're running a multi-user system with users that don't speak en_US, they won't be happy until their individual locale is at least supported by your system.<br />
<br />
==Setting system wide locale==<br />
To define which locale should be used by the system, you can easily add your locale to your '''/etc/rc.conf''' file. As we've just added ISO-8859 support just for (backward-)compatibility, we add en_US.UTF-8 here:<br />
LOCALE="en_US.UTF-8"<br />
<br />
The system wide locale will be updated after rebooting your computer.<br />
<br />
==Collation==<br />
Collation, or sorting, is a little different. Sorting is a goofy beast and different locales do things differently. To get around potential issues, Arch used to set LC_COLLATE="C" in /etc/profile. However it no longer does that. (See [http://www.archlinux.org/news/476 announcement].) If you want this behavior, you should add LC_COLLATE="C" to your script or .bashrc file yourself. Without a LC_COLLATE setting, locale aware apps sort by LC_ALL or LOCALE.<br />
<br />
Note that LC_COLLATE settings will be overridden if LC_ALL is set. Add the following to your script or .bashrc file:<br />
<br />
export LC_ALL=<br />
export LC_COLLATE="C"<br />
<br />
Now ls will sort dotfiles first, followed by uppercase and lowercase filenames.<br />
<br />
==Setting per user locale==<br />
As we discussed earlier, some users might want to define a different locale than the system-wide locale.<br />
In this case, you can export LANG in your '''~/.bashrc'''.<br />
For example you can use the en_AU.UTF-8 locale.<br />
export LANG=en_AU.UTF-8<br />
<br />
Your locales will be updated as soon as you re-source your ~/.bashrc. This happens on login or alternatively you can type:<br />
$ source ~/.bashrc<br />
<br />
==Setting starting weekday==<br />
In a lot of countries the first day of the week is Monday. To do change or add the following lines under the LC_TIME section in ''/usr/share/i18n/locales/<your_locale>''<br />
<br />
week 7;19971130;5<br />
first_weekday 2<br />
first_workday 2<br />
And then run as root<br />
<br />
# locale-gen<br />
and restart X.<br />
<br />
{{Note| If you experience some kind of problems with your system and would like to ask for help on the forum, mailing list or otherwise, please run the misbehaving program with <code>export LC_MESSAGES&#61;C</code> before posting. It will set the output messages (errors, warnings) to English thus enabling more people to understand what the problem might be, resulting in a more throughout response. This is of course not the point if you are posting to a non-English forum.}}<br />
<br />
==Troubleshooting==<br />
===How can I obtain the available locale names?===<br />
You can get the correct names of all available locales with this command:<br />
$ locale -a<br />
===How can I see which locale I am using?===<br />
Which locale is currently in use is viewable simply by typing:<br />
$ locale<br />
===My terminal doesn't support UTF-8 characters===<br />
Unfortunately some terminals don't support UTF-8. In this case, you have to use a different terminal.<br />
<br />
'''List of terminals that support UTF-8:'''<br />
* gnome-terminal<br />
* gnustep-terminal<br />
* konsole<br />
* [[mlterm]]<br />
* urxvt (rxvt-unicode)<br />
* xfce-terminal<br />
* xterm<br />
'''Note:''' This list may be incomplete.<br />
<br />
===xterm doesn't support UTF-8 characters for me===<br />
xterm only supports UTF-8 if you run it as uxterm or xterm -u8.<br />
<br />
===gnome-terminal doesn't support UTF-8 characters for me===<br />
Append these two lines to <code>/etc/environment</code> file:<br />
<br />
LANG="en_US.UTF-8"<br />
LC_ALL="en_US.UTF-8"<br />
<br />
Reboot your system, and gnome-terminal will work correctly.<br />
<br />
==Links==<br />
* [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]<br />
* [http://www.gentoo-wiki.info/Locales Gentoo Wiki Archives: Locales]<br />
* [http://demo.icu-project.org/icu-bin/locexp?_=en_US&x=col ICU's interactive collation testing]<br />
* [http://www.openi18n.org/ Free Standards Group Open Internationalisation Initiative]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=Locale&diff=137200Locale2011-04-13T15:41:44Z<p>Reventlov: /* Enabling necessary locales */</p>
<hr />
<div>[[Category:Internationalization (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|Locale}}<br />
[[de:Locale]]<br />
[[fr:Locale]]<br />
<br />
Locales are used in Linux to define which language the user uses. As the locales define the character set which the user uses as well, setting up the correct locale is especially important if the language contains non-ASCII characters.<br />
<br />
Locale naming is defined as following:<br />
<lang>_<territory>.<codeset>[@<modifiers>]<br />
<br />
In this HOWTO we're setting up a system that uses the en_US.UTF-8 locale, but you can follow this article easily if you want to setup another locale.<br />
<br />
==Enabling necessary locales==<br />
First you have to enable the locales you want being supported by your system. To enable or disable them, the file '''/etc/locale.gen''' is used. It contains every locale you can enable, and you have just to uncomment lines you want to do so.<br />
<br />
As we want to setup an English UTF-8 conform system, we want to enable en_US.UTF-8. But for compatibility to programs that don't support UTF-8 yet, it's recommended to support any other locale, prefixed with en_US as well. Having this in mind, we enable this set of locales:<br />
en_US.UTF-8 UTF-8<br />
en_US ISO-8859-1<br />
<br />
After you've enabled the necessary locales, you have to run locale-gen as root to update them:<br />
# su -c locale-gen<br />
Generating locales...<br />
en_US.UTF-8... done<br />
en_US.ISO-8859-1... done<br />
Generation complete.<br />
<br />
'''Note:''' Though it's most likely just one language you use on your computer it can be helpful or even necessary to enable other locales as well. For example if you're running a multi-user system with users that don't speak en_US, they won't be happy until their individual locale is at least supported by your system.<br />
<br />
==Setting system wide locale==<br />
To define which locale should be used by the system, you can easily add your locale to your '''/etc/rc.conf''' file. As we've just added ISO-8859 support just for (backward-)compatibility, we add en_US.UTF-8 here:<br />
LOCALE="en_US.UTF-8"<br />
<br />
The system wide locale will be updated after rebooting your computer.<br />
<br />
==Collation==<br />
Collation, or sorting, is a little different. Sorting is a goofy beast and different locales do things differently. To get around potential issues, Arch used to set LC_COLLATE="C" in /etc/profile. However it no longer does that. (See [http://www.archlinux.org/news/476 announcement].) If you want this behavior, you should add LC_COLLATE="C" to your script or .bashrc file yourself. Without a LC_COLLATE setting, locale aware apps sort by LC_ALL or LOCALE.<br />
<br />
Note that LC_COLLATE settings will be overridden if LC_ALL is set. Add the following to your script or .bashrc file:<br />
<br />
export LC_ALL=<br />
export LC_COLLATE="C"<br />
<br />
Now ls will sort dotfiles first, followed by uppercase and lowercase filenames.<br />
<br />
==Setting per user locale==<br />
As we discussed earlier, some users might want to define a different locale than the system-wide locale.<br />
In this case, you can export LANG in your '''~/.bashrc'''.<br />
For example you can use the en_AU.UTF-8 locale.<br />
export LANG=en_AU.UTF-8<br />
<br />
Your locales will be updated as soon as you re-source your ~/.bashrc. This happens on login or alternatively you can type:<br />
$ source ~/.bashrc<br />
<br />
==Setting starting weekday==<br />
In a lot of countries the first day of the week is Monday. To do change or add the following lines under the LC_TIME section in ''/usr/share/i18n/locales/<your_locale>''<br />
<br />
week 7;19971130;5<br />
first_weekday 2<br />
first_workday 2<br />
And then run<br />
<br />
# locale-gen<br />
and restart X.<br />
<br />
{{Note| If you experience some kind of problems with your system and would like to ask for help on the forum, mailing list or otherwise, please run the misbehaving program with <code>export LC_MESSAGES&#61;C</code> before posting. It will set the output messages (errors, warnings) to English thus enabling more people to understand what the problem might be, resulting in a more throughout response. This is of course not the point if you are posting to a non-English forum.}}<br />
<br />
==Troubleshooting==<br />
===How can I obtain the available locale names?===<br />
You can get the correct names of all available locales with this command:<br />
$ locale -a<br />
===How can I see which locale I am using?===<br />
Which locale is currently in use is viewable simply by typing:<br />
$ locale<br />
===My terminal doesn't support UTF-8 characters===<br />
Unfortunately some terminals don't support UTF-8. In this case, you have to use a different terminal.<br />
<br />
'''List of terminals that support UTF-8:'''<br />
* gnome-terminal<br />
* gnustep-terminal<br />
* konsole<br />
* [[mlterm]]<br />
* urxvt (rxvt-unicode)<br />
* xfce-terminal<br />
* xterm<br />
'''Note:''' This list may be incomplete.<br />
<br />
===xterm doesn't support UTF-8 characters for me===<br />
xterm only supports UTF-8 if you run it as uxterm or xterm -u8.<br />
<br />
===gnome-terminal doesn't support UTF-8 characters for me===<br />
Append these two lines to <code>/etc/environment</code> file:<br />
<br />
LANG="en_US.UTF-8"<br />
LC_ALL="en_US.UTF-8"<br />
<br />
Reboot your system, and gnome-terminal will work correctly.<br />
<br />
==Links==<br />
* [http://www.gentoo.org/doc/en/guide-localization.xml Gentoo Linux Localization Guide]<br />
* [http://www.gentoo-wiki.info/Locales Gentoo Wiki Archives: Locales]<br />
* [http://demo.icu-project.org/icu-bin/locexp?_=en_US&x=col ICU's interactive collation testing]<br />
* [http://www.openi18n.org/ Free Standards Group Open Internationalisation Initiative]</div>Reventlovhttps://wiki.archlinux.org/index.php?title=PCManFM&diff=134729PCManFM2011-03-25T17:13:27Z<p>Reventlov: </p>
<hr />
<div>[[Category: Utilities (English)]]<br />
[[Category: File systems (English)]]<br />
[[Category: File managers (English)]]<br />
{{i18n|PCManFM}}<br />
[[pl:PCManFM]]<br />
<br />
'''PCManFM''' is "an extremly fast, lightweight, yet feature-rich file manager with tabbed browsing". Source: [http://pcmanfm.sourceforge.net/ PCManFM on sourceforge]. PCManFM is the default file manager of the [[LXDE]] (Lightweight X11 Desktop Environment).<br />
<br />
==Installation==<br />
Run the following command to install:<br />
# pacman -S pcmanfm<br />
<br />
You will also require gamin (a replacement for fam, which required a daemon) to pick up events such as file and directories changes:<br />
<br />
# pacman -S gamin<br />
<br />
<br />
==Volume handling==<br />
PCManFM is able to mount and unmount devices, both manually and automatically. This feature is offered as an alternative to CLI tools such as [[pmount]]. There are various 'up-to-date' versions of PCManFM (see below), and different volume handling strategies can be chosen.<br />
<br />
===Mounting with udisks===<br />
The current release of PCManFM is able to handle volumes through udisks. If you want to use this feature, make sure the D-Bus daemon is installed and running. See the [[D-Bus]] page for details. Note that you will most likely need to start dbus-launch from your .xinitrc or the autostart script of your window manager. Instructions how to do so can be found on the [[D-Bus]] page or the page for your window manager.<br />
<br />
===Mounting with gvfs===<br />
If you prefer to use the Gnome Virtual FileSystem, the procedure is the same as before but requires additional packages:<br />
<br />
* [[gvfs]] (and dependencies);<br />
* (optional) gvfs-smb, gvfs-obexftp, gvfs-afc, etc. in order to support additional features.<br />
<br />
Note : You must have a /media folder.<br />
<br />
===Mounting as normal user===<br />
To be able to mount devices like removeable USB harddisks, flashdrives or DVDs as a normal user, the PolicyKit toolkit needs to be configured accordingly. The configuration files can be found in the subdirectories of {{Filename|/etc/polkit-1}}. The rest of this section will show you how to configure PolicyKit to allow users belonging to the "storage" group to mount and umount temporary devices.<br />
<br />
First off, start a terminal and make yourself root:<br />
su<br />
Then switch to the right directory:<br />
cd /etc/polkit-1/localauthority/50-local.d<br />
Fire up your favourite text editor and create a file:<br />
nano 55-myconf.pkla<br />
Note that you can name the file anything you want, as long as the name ends with .pkla. Type in or copy/paste the following lines:<br />
[Storage Permissions]<br />
Identity=unix-group:storage<br />
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown<br />
ResultAny=yes<br />
ResultActive=yes<br />
ResultInactive=no<br />
Do not forget to save the file. PolicyKit will notice the changes in the file and update its behaviour without any action from you. Last thing to do is making every user that should have the ability to mount drives a member of the storage group:<br />
usermod -a -G storage USERNAME<br />
Get back to your existence as a humble user and enjoy your ability to mount your USB Drives:<br />
exit<br />
<br />
If you want to grant other permissions instead of granting them to members of the storage group, or simply want to know what you were just doing, check out the manpage:<br />
man pklocalauthority<br />
<br />
==Tips & troubleshooting==<br />
===No icons?===<br />
If you are using a window manager over a desktop environment and notice you have no icons for folders and files, install an icon theme:<br />
# pacman -S tango-icon-theme<br />
<br />
Then edit {{Filename|~/.gtkrc-2.0}} '''or''' {{Filename|/etc/gtk-2.0/gtkrc}} and add the following line:<br />
gtk-icon-theme-name = "Tango"<br />
<br />
===NTFS Read/Write Support===<br />
Install ntfs-3g:<br />
# pacman -S ntfs-3g<br />
<br />
===gnome-open opens "Find" dialog instead of the directory===<br />
Remove or rename the file {{Filename|/usr/share/applications/pcmanfm-find.desktop}}. If you're running pcmanfm-mod from AUR, remove or rename the file {{Filename|/usr/share/applications/pcmanfm-mod-find.desktop}}.<br />
<br />
==Available Versions==<br />
There are several versions of PCManFM currently available:<br />
<br />
===PCManFM2===<br />
This is the package in Arch's extra repository as "pcmanfm". The current git test version of it is available in the AUR as [http://aur.archlinux.org/packages.php?ID=33601 pcmanfm-git]. More information is available on the [http://forum.lxde.org/viewforum.php?f=22 LXDE Forum].<br />
<br />
===PCManFM 0.5.2===<br />
The legacy PCManFM (version 0.5.2, which is currently "pcmanfm-gtk220" in the AUR repository) is frozen and is no longer being maintained by the original author. This version uses HAL for mounting. More information is available on the [http://pcmanfm.sourceforge.net/intro.html project page].<br />
<br />
===PCManFM-Mod===<br />
PCManFM-Mod adds user-definable commands, other features, and bugfixes to the legacy version of the PCManFM file manager v0.5.2. This version builds and installs as "pcmanfm-mod" and will run independently of other versions of PCManFM you have installed on your system. This legacy version is still desired by some due to more stability than the newer 0.9.x rewrite in progress, less Gnome dependencies, and the use of HAL rather than gnome-vfs. PCManFM-Mod is available in the [http://aur.archlinux.org/packages.php?ID=34819 AUR as pcmanfm-mod] and as [http://aur.archlinux.org/packages.php?ID=39547 pcmanfm-mod-prov] (latter provides pcmanfm). More information is available at [http://igurublog.wordpress.com/downloads/mod-pcmanfm/ IgnorantGuru's Blog].</div>Reventlov