https://wiki.archlinux.org/api.php?action=feedcontributions&user=Gabuzo&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:19:22ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Systemd&diff=338318Systemd2014-10-01T13:50:29Z<p>Gabuzo: /* Filtering output */</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[ar:Systemd]]<br />
[[el:Systemd]]<br />
[[es:Systemd]]<br />
[[fr:Systemd]]<br />
[[it:Systemd]]<br />
[[ja:Systemd]]<br />
[[pt:Systemd]]<br />
[[ru:Systemd]]<br />
[[zh-CN:Systemd]]<br />
[[zh-TW:Systemd]]<br />
{{Related articles start}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd/Services}}<br />
{{Related|systemd/cron functionality}}<br />
{{Related|systemd FAQ}}<br />
{{Related|init}}<br />
{{Related|init Rosetta}}<br />
{{Related|Daemons List}}<br />
{{Related|udev}}<br />
{{Related|Improve boot performance}}<br />
{{Related|Allow users to shutdown}}<br />
{{Related articles end}}<br />
<br />
From the [http://freedesktop.org/wiki/Software/systemd project web page]:<br />
<br />
:''systemd'' is a system and service manager for Linux, compatible with SysV and LSB init scripts. systemd provides aggressive parallelization capabilities, uses socket and [[D-Bus]] activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux [[cgroups|control groups]], supports snapshotting and restoring of the system state, maintains mount and automount points and implements an elaborate transactional dependency-based service control logic.<br />
<br />
{{Note|1=For a detailed explanation as to why Arch has moved to ''systemd'', see [https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 this forum post].}}<br />
<br />
== Basic systemctl usage ==<br />
<br />
The main command used to introspect and control ''systemd'' is ''systemctl''. Some of its uses are examining the system state and managing the system and services. See {{ic|man 1 systemctl}} for more details.<br />
<br />
{{Tip|You can use all of the following ''systemctl'' commands with the {{ic|-H ''user''@''host''}} switch to control a ''systemd'' instance on a remote machine. This will use [[SSH]] to connect to the remote ''systemd'' instance.}}<br />
<br />
{{Note|''systemadm'' is the official graphical frontend for ''systemctl''. It is provided by {{Pkg|systemd-ui}} from the [[official repositories]] or by {{AUR|systemd-ui-git}} from the [[AUR]] for the development version.}}<br />
<br />
=== Analyzing the system state ===<br />
<br />
List running units:<br />
<br />
$ systemctl<br />
<br />
or:<br />
<br />
$ systemctl list-units<br />
<br />
List failed units:<br />
<br />
$ systemctl --failed<br />
<br />
The available unit files can be seen in {{ic|/usr/lib/systemd/system/}} and {{ic|/etc/systemd/system/}} (the latter takes precedence). You can see a list of the installed unit files with:<br />
<br />
$ systemctl list-unit-files<br />
<br />
=== Using units ===<br />
<br />
Units can be, for example, services (''.service''), mount points (''.mount''), devices (''.device'') or sockets (''.socket'').<br />
<br />
When using ''systemctl'', you generally have to specify the complete name of the unit file, including its suffix, for example ''sshd.socket''. There are however a few short forms when specifying the unit in the following ''systemctl'' commands:<br />
<br />
* If you do not specify the suffix, systemctl will assume ''.service''. For example, {{ic|netcfg}} and {{ic|netcfg.service}} are equivalent.<br />
* Mount points will automatically be translated into the appropriate ''.mount'' unit. For example, specifying {{ic|/home}} is equivalent to {{ic|home.mount}}.<br />
* Similar to mount points, devices are automatically translated into the appropriate ''.device'' unit, therefore specifying {{ic|/dev/sda2}} is equivalent to {{ic|dev-sda2.device}}.<br />
<br />
See {{ic|man systemd.unit}} for details.<br />
<br />
{{Note|Some unit names contain an {{ic|@}} sign (e.g. {{ic|name@''string''.service}}): this means that they are [http://0pointer.de/blog/projects/instances.html instances] of a ''template'' unit, whose actual file name does not contain the {{ic|''string''}} part (e.g. {{ic|name@.service}}). {{ic|''string''}} is called the ''instance identifier'', and is similar to an argument that is passed to the template unit when called with the ''systemctl'' command: in the unit file it will substitute the {{ic|%i}} specifier. <br />
<br />
To be more accurate, ''before'' trying to instantiate the {{ic|name@.suffix}} template unit, ''systemd'' will actually look for a unit with the exact {{ic|name@string.suffix}} file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an {{ic|@}} sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will just fail, since the {{ic|%i}} specifier cannot be substituted.<br />
}}<br />
<br />
{{Tip|Most of the following commands also work if multiple units are specified, see {{ic|man systemctl}} for more information.}}<br />
<br />
Activate a unit immediately:<br />
<br />
# systemctl start ''unit''<br />
<br />
Deactivate a unit immediately:<br />
<br />
# systemctl stop ''unit''<br />
<br />
Restart a unit:<br />
<br />
# systemctl restart ''unit''<br />
<br />
Ask a unit to reload its configuration:<br />
<br />
# systemctl reload ''unit''<br />
<br />
Show the status of a unit, including whether it is running or not:<br />
<br />
$ systemctl status ''unit''<br />
<br />
Check whether a unit is already enabled or not:<br />
<br />
$ systemctl is-enabled ''unit''<br />
<br />
Enable a unit to be started on bootup:<br />
<br />
# systemctl enable ''unit''<br />
<br />
Disable a unit to not start during bootup:<br />
<br />
# systemctl disable ''unit''<br />
<br />
Show the manual page associated with a unit (this has to be supported by the unit file):<br />
<br />
$ systemctl help ''unit''<br />
<br />
Reload ''systemd'', scanning for new or changed units:<br />
<br />
# systemctl daemon-reload<br />
<br />
=== Power management ===<br />
<br />
[[polkit]] is necessary for power management as an unprivileged user. If you are in a local ''systemd-logind'' user session and no other session is active, the following commands will work without root privileges. If not (for example, because another user is logged into a tty), ''systemd'' will automatically ask you for the root password.<br />
<br />
Shut down and reboot the system:<br />
<br />
$ systemctl reboot<br />
<br />
Shut down and power-off the system:<br />
<br />
$ systemctl poweroff<br />
<br />
Suspend the system:<br />
<br />
$ systemctl suspend<br />
<br />
Put the system into hibernation:<br />
<br />
$ systemctl hibernate<br />
<br />
Put the system into hybrid-sleep state (or suspend-to-both):<br />
<br />
$ systemctl hybrid-sleep<br />
<br />
== Writing custom .service files ==<br />
<br />
The syntax of systemd's [[#Using units|unit files]] is inspired by XDG Desktop Entry Specification ''.desktop'' files, which are in turn inspired by Microsoft Windows ''.ini'' files.<br />
<br />
See [[systemd/Services]] for more examples.<br />
<br />
=== Handling dependencies ===<br />
<br />
With ''systemd'', dependencies can be resolved by designing the unit files correctly. The most typical case is that the unit ''A'' requires the unit ''B'' to be running before ''A'' is started. In that case add {{ic|1=Requires=''B''}} and {{ic|1=After=''B''}} to the {{ic|[Unit]}} section of ''A''. If the dependency is optional, add {{ic|1=Wants=''B''}} and {{ic|1=After=''B''}} instead. Note that {{ic|1=Wants=}} and {{ic|1=Requires=}} do not imply {{ic|1=After=}}, meaning that if {{ic|1=After=}} is not specified, the two units will be started in parallel.<br />
<br />
Dependencies are typically placed on services and not on targets. For example, ''network.target'' is pulled in by whatever service configures your network interfaces, therefore ordering your custom unit after it is sufficient since ''network.target'' is started anyway.<br />
<br />
=== Type ===<br />
<br />
There are several different start-up types to consider when writing a custom service file. This is set with the {{ic|1=Type=}} parameter in the {{ic|[Service]}} section. See {{ic|man systemd.service}} for a more detailed explanation.<br />
<br />
* {{ic|1=Type=simple}} (default): ''systemd'' considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.<br />
* {{ic|1=Type=forking}}: ''systemd'' considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify {{ic|1=PIDFile=}} as well so ''systemd'' can keep track of the main process.<br />
* {{ic|1=Type=oneshot}}: this is useful for scripts that do a single job and then exit. You may want to set {{ic|1=RemainAfterExit=yes}} as well so that ''systemd'' still considers the service as active after the process has exited.<br />
* {{ic|1=Type=notify}}: identical to {{ic|1=Type=simple}}, but with the stipulation that the daemon will send a signal to ''systemd'' when it is ready. The reference implementation for this notification is provided by ''libsystemd-daemon.so''.<br />
* {{ic|1=Type=dbus}}: the service is considered ready when the specified {{ic|BusName}} appears on DBus's system bus.<br />
<br />
=== Editing provided unit files ===<br />
<br />
To edit a unit file provided by a package, you can create a directory called {{ic|/etc/systemd/system/''unit''.d/}} for example {{ic|/etc/systemd/system/httpd.service.d/}} and place ''*.conf'' files in there to override or add new options. ''systemd'' will parse these ''*.conf'' files and apply them on top of the original unit. For example, if you simply want to add an additional dependency to a unit, you may create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customdependency.conf|2=<br />
[Unit]<br />
Requires=''new dependency''<br />
After=''new dependency''<br />
}}<br />
<br />
As another example, in order to replace the {{ic|ExecStart}} directive for a unit that is not of type {{ic|oneshot}}, create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customexec.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=''new command''<br />
}}<br />
<br />
Note how {{ic|ExecStart}} must be cleared before being re-assigned ([https://bugzilla.redhat.com/show_bug.cgi?id=756787#c9]).<br />
<br />
One more example to automatically restart a service:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/restart.conf|2=<br />
[Service]<br />
Restart=always<br />
RestartSec=30<br />
}}<br />
<br />
Then run the following for your changes to take effect:<br />
<br />
# systemctl daemon-reload<br />
# systemctl restart ''unit''<br />
<br />
Alternatively you can copy the old unit file from {{ic|/usr/lib/systemd/system/}} to {{ic|/etc/systemd/system/}} and make your changes there. A unit file in {{ic|/etc/systemd/system/}} always overrides the same unit in {{ic|/usr/lib/systemd/system/}}. Note that when the original unit in {{ic|/usr/lib/}} is changed due to a package upgrade, these changes will not automatically apply to your custom unit file in {{ic|/etc/}}. Additionally you will have to manually reenable the unit with {{ic|systemctl reenable ''unit''}}. It is therefore recommended to use the ''*.conf'' method described before instead.<br />
<br />
{{Tip|You can use '''systemd-delta''' to see which unit files have been overridden and what exactly has been changed.}}<br />
<br />
As the provided unit files will be updated from time to time, use ''systemd-delta'' for system maintenance.<br />
<br />
=== Syntax highlighting for units within Vim ===<br />
<br />
Syntax highlighting for ''systemd'' unit files within [[Vim]] can be enabled by installing {{Pkg|vim-systemd}} from the [[official repositories]].<br />
<br />
== Targets ==<br />
<br />
''systemd'' uses ''targets'' which serve a similar purpose as runlevels but act a little different. Each ''target'' is named instead of numbered and is intended to serve a specific purpose with the possibility of having multiple ones active at the same time. Some ''target''s are implemented by inheriting all of the services of another ''target'' and adding additional services to it. There are ''systemd'' ''target''s that mimic the common SystemVinit runlevels so you can still switch ''target''s using the familiar {{ic|telinit RUNLEVEL}} command.<br />
<br />
=== Get current targets ===<br />
<br />
The following should be used under ''systemd'' instead of running {{ic|runlevel}}:<br />
<br />
$ systemctl list-units --type=target<br />
<br />
=== Create custom target ===<br />
<br />
The runlevels that are assigned a specific purpose on vanilla Fedora installs; 0, 1, 3, 5, and 6; have a 1:1 mapping with a specific ''systemd'' ''target''. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named ''systemd'' ''target'' as {{ic|/etc/systemd/system/''your target''}} that takes one of the existing runlevels as a base (you can look at {{ic|/usr/lib/systemd/system/graphical.target}} as an example), make a directory {{ic|/etc/systemd/system/''your target''.wants}}, and then symlink the additional services from {{ic|/usr/lib/systemd/system/}} that you wish to enable.<br />
<br />
=== Targets table ===<br />
<br />
{| class="wikitable"<br />
! SysV Runlevel !! systemd Target !! Notes<br />
|-<br />
| 0 || runlevel0.target, poweroff.target || Halt the system.<br />
|-<br />
| 1, s, single || runlevel1.target, rescue.target || Single user mode.<br />
|-<br />
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.<br />
|-<br />
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.<br />
|-<br />
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.<br />
|-<br />
| 6 || runlevel6.target, reboot.target || Reboot<br />
|-<br />
| emergency || emergency.target || Emergency shell<br />
|-<br />
|}<br />
<br />
=== Change current target ===<br />
<br />
In ''systemd'' targets are exposed via ''target units''. You can change them like this:<br />
<br />
# systemctl isolate graphical.target<br />
<br />
This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as {{ic|telinit 3}} or {{ic|telinit 5}} in Sysvinit.<br />
<br />
=== Change default target to boot into ===<br />
<br />
The standard target is ''default.target'', which is aliased by default to ''graphical.target'' (which roughly corresponds to the old runlevel 5). To change the default target at boot-time, append one of the following [[kernel parameters]] to your bootloader:<br />
<br />
{{Tip|The ''.target'' extension can be left out.}}<br />
<br />
* {{ic|1=systemd.unit=multi-user.target}} (which roughly corresponds to the old runlevel 3),<br />
* {{ic|1=systemd.unit=rescue.target}} (which roughly corresponds to the old runlevel 1).<br />
<br />
Alternatively, you may leave the bootloader alone and change ''default.target''. This can be done using ''systemctl'':<br />
<br />
# systemctl set-default multi-user.target<br />
<br />
To be able to override the previously set ''default.target'', use the force option:<br />
<br />
# systemctl set-default -f multi-user.target<br />
<br />
The effect of this command is output by ''systemctl''; a symlink to the new default target is made at {{ic|/etc/systemd/system/default.target}}.<br />
<br />
== Temporary files ==<br />
<br />
"''systemd-tmpfiles'' creates, deletes and cleans up volatile and temporary files and directories." It reads configuration files in {{ic|/etc/tmpfiles.d/}} and {{ic|/usr/lib/tmpfiles.d/}} to discover which actions to perform. Configuration files in the former directory take precedence over those in the latter directory.<br />
<br />
Configuration files are usually provided together with service files, and they are named in the style of {{ic|/usr/lib/tmpfiles.d/''program''.conf}}. For example, the [[Samba]] daemon expects the directory {{ic|/run/samba}} to exist and to have the correct permissions. Therefore, the {{Pkg|samba}} package ships with this configuration:<br />
<br />
{{hc|/usr/lib/tmpfiles.d/samba.conf|<br />
D /run/samba 0755 root root}}<br />
<br />
Configuration files may also be used to write values into certain files on boot. For example, if you used {{ic|/etc/rc.local}} to disable wakeup from USB devices with {{ic|echo USBE > /proc/acpi/wakeup}}, you may use the following tmpfile instead:<br />
<br />
{{hc|/etc/tmpfiles.d/disable-usb-wake.conf|<br />
w /proc/acpi/wakeup - - - - USBE}}<br />
<br />
See the {{ic|systemd-tmpfiles(8)}} and {{ic|tmpfiles.d(5)}} man pages for details.<br />
<br />
{{Note|This method may not work to set options in {{ic|/sys}} since the ''systemd-tmpfiles-setup'' service may run before the appropriate device modules is loaded. In this case you could check whether the module has a parameter for the option you want to set with {{ic|modinfo ''module''}} and set this option with a [[Modprobe.d#Configuration|config file in /etc/modprobe.d]]. Otherwise you will have to write a [[Udev#About_udev_rules|udev rule]] to set the appropriate attribute as soon as the device appears.}}<br />
<br />
== Timers ==<br />
<br />
Timer is unit configuration file whose name ends with ''.timer'' and encodes information about a timer controlled and supervised by ''systemd'', for timer-based activation. Use following command to get a listing of all active timers:<br />
<br />
$ systemctl list-timers<br />
<br />
{{Note|Timers can replace cron functionality to a great extent. For further information, please refer to [[systemd/cron functionality]].}}<br />
<br />
== Journal ==<br />
<br />
''systemd'' has its own logging system called the journal; therefore, running a {{ic|syslog}} daemon is no longer required. To read the log, use:<br />
<br />
# journalctl<br />
<br />
In Arch Linux, the directory {{ic|/var/log/journal/}} is a part of the {{Pkg|systemd}} package, and the journal (when {{ic|1=Storage=}} is set to {{ic|auto}} in {{ic|/etc/systemd/journald.conf}}) will write to {{ic|/var/log/journal/}}. If you or some program delete that directory, ''systemd'' will '''not''' recreate it automatically; however, it will be recreated during the next update of the ''systemd'' package. Until then, logs will be written to {{ic|/run/systemd/journal}}, and logs will be lost on reboot.<br />
<br />
{{Tip|If {{ic|/var/log/journal/}} resides in a [[btrfs]] file system, you should consider disabling Copy-on-Write for the directory. See the main article for details: [[Btrfs#Copy-On-Write (CoW)]].}}<br />
<br />
=== Filtering output ===<br />
<br />
''journalctl'' allows you to filter the output by specific fields. Be aware that if there are many messages to display or filtering of large time span has to be done, the output of this command can be delayed for quite some time.<br />
<br />
{{Tip|While the journal is stored in a binary format, the content of stored messages is not modified. This means it is viewable with ''strings'', for example for recovery in an environment which does not have ''systemd'' installed. Example command:<br />
{{ic|$ strings /mnt/arch/var/log/journal/af4967d77fba44c6b093d0e9862f6ddd/system.journal <nowiki>| grep</nowiki> ''message''}}<br />
}}<br />
<br />
Examples:<br />
<br />
* Show all messages from this boot: {{bc|# journalctl -b}} However, often one is interested in messages not from the current, but from the previous boot (e.g. if an unrecoverable system crash happened). This is possible through optional offset parameter of the {{ic|-b}} flag: {{ic|journalctl -b -0}} shows messages from the current boot, {{ic|journalctl -b -1}} from the previous boot, {{ic|journalctl -b -2}} from the second previous and so on. See {{ic|man 1 journalctl}} for full description, the semantics is much more powerful.<br />
* Show all messages from date: {{bc|# <nowiki>journalctl --since="2012-10-30 18:17:16"</nowiki>}}<br />
* Follow new messages: {{bc|# journalctl -f}}<br />
* Show all messages by a specific executable: {{bc|# journalctl /usr/lib/systemd/systemd}}<br />
* Show all messages by a specific process: {{bc|1=# journalctl _PID=1}}<br />
* Show all messages by a specific unit: {{bc|# journalctl -u netcfg}}<br />
* Show kernel ring buffer: {{bc|1=# journalctl -k}}<br />
<br />
See {{ic|man 1 journalctl}}, {{ic|man 7 systemd.journal-fields}}, or Lennart's [http://0pointer.de/blog/projects/journalctl.html blog post] for details.<br />
<br />
{{Tip|1=<br />
By default, ''journalctl'' truncates lines longer than screen width, but in some cases, it may be better to enable wrapping instead of truncating. This can be controlled by the {{ic|SYSTEMD_LESS}} [[Environment variables|environment variable]], which contains options passed to [[Core utilities#less|less]] (the default pager) and defaults to {{ic|FRSXMK}} (see {{ic|man 1 less}} and {{ic|man 1 journalctl}} for details).<br />
<br />
By omitting the {{ic|S}} option, the output will be wrapped instead of truncated. For example, start ''journalctl'' as follows:<br />
<br />
$ SYSTEMD_LESS=FRXMK journalctl<br />
<br />
If you'd like set this behaviour as default, [[Environment variables#Defining variables locally|export]] the variable from {{ic|~/.bashrc}} or {{ic|~/.zshrc}}.<br />
}}<br />
<br />
=== Journal size limit ===<br />
<br />
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the respective file system. For example, with {{ic|/var/log/journal}} located on a 50 GiB root partition this would lead to 5 GiB of journal data. The maximum size of the persistent journal can be controlled by {{ic|SystemMaxUse}} in {{ic|/etc/systemd/journald.conf}}, so to limit it for example to 50 MiB uncomment and edit the corresponding line to:<br />
<br />
SystemMaxUse=50M<br />
<br />
Refer to {{ic|man journald.conf}} for more info.<br />
<br />
=== Journald in conjunction with syslog ===<br />
<br />
Compatibility with classic syslog implementations is provided via a socket {{ic|/run/systemd/journal/syslog}}, to which all messages are forwarded. To make the syslog daemon work with the journal, it has to bind to this socket instead of {{ic|/dev/log}} ([http://lwn.net/Articles/474968/ official announcement]). The {{Pkg|syslog-ng}} package in the repositories automatically provides the necessary configuration.<br />
<br />
# systemctl enable syslog-ng<br />
<br />
A good ''journalctl'' tutorial is [http://0pointer.de/blog/projects/journalctl.html here].<br />
<br />
=== Forward journald to /dev/tty12 ===<br />
<br />
In {{ic|/etc/systemd/journald.conf}} enable the following:<br />
<br />
ForwardToConsole=yes<br />
TTYPath=/dev/tty12<br />
MaxLevelConsole=info<br />
<br />
Restart journald with:<br />
<br />
# systemctl restart systemd-journald<br />
<br />
== Troubleshooting ==<br />
<br />
=== Investigating systemd errors ===<br />
<br />
As an example, we will investigate an error with {{ic|systemd-modules-load}} service:<br />
<br />
'''1.''' Lets find the ''systemd'' services which fail to start:<br />
<br />
{{hc|1=$ systemctl --state=failed|2=<br />
systemd-modules-load.service loaded '''failed failed''' Load Kernel Modules<br />
}}<br />
<br />
'''2.''' Ok, we found a problem with {{ic|systemd-modules-load}} service. We want to know more:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''failed''' (Result: exit-code) since So 2013-08-25 11:48:13 CEST; 32s ago<br />
Docs: man:systemd-modules-load.service(8).<br />
man:modules-load.d(5)<br />
Process: '''15630''' ExecStart=/usr/lib/systemd/systemd-modules-load ('''code=exited, status=1/FAILURE''')<br />
}}<br />
If the {{ic|Process ID}} is not listed, just restart the failed service with {{ic|systemctl restart systemd-modules-load}}<br />
<br />
'''3.''' Now we have the process id (PID) to investigate this error in depth. Enter the following command with the current {{ic|Process ID}} (here: 15630):<br />
{{hc|1=$ journalctl -b _PID=15630|2=<br />
-- Logs begin at Sa 2013-05-25 10:31:12 CEST, end at So 2013-08-25 11:51:17 CEST. --<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'blacklist usblp''''<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'install usblp /bin/false'''' <br />
}}<br />
<br />
'''4.''' We see that some of the kernel module configs have wrong settings. Therefore we have a look at these settings in {{ic|/etc/modules-load.d/}}:<br />
{{hc|$ ls -Al /etc/modules-load.d/|<br />
...<br />
-rw-r--r-- 1 root root 79 1. Dez 2012 blacklist.conf<br />
-rw-r--r-- 1 root root 1 2. Mär 14:30 encrypt.conf<br />
-rw-r--r-- 1 root root 3 5. Dez 2012 printing.conf<br />
-rw-r--r-- 1 root root 6 14. Jul 11:01 realtek.conf<br />
-rw-r--r-- 1 root root 65 2. Jun 23:01 virtualbox.conf<br />
...<br />
}}<br />
<br />
'''5.''' The {{ic|Failed to find module 'blacklist usblp'}} error message might be related to a wrong setting inside of {{ic|blacklist.conf}}. Lets deactivate it with inserting a trailing '''#''' before each option we found via step 3:<br />
{{hc|/etc/modules-load.d/blacklist.conf|<br />
'''#''' blacklist usblp<br />
'''#''' install usblp /bin/false<br />
}}<br />
<br />
'''6.''' Now, try to start {{ic|systemd-modules-load}}:<br />
$ systemctl start systemd-modules-load<br />
If it was successful, this should not prompt anything. If you see any error, go back to step 3 and use the new PID for solving the errors left.<br />
<br />
If everything is ok, you can verify that the service was started successfully with:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: '''loaded''' (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''active (exited)''' since So 2013-08-25 12:22:31 CEST; 34s ago<br />
Docs: man:systemd-modules-load.service(8)<br />
man:modules-load.d(5)<br />
Process: 19005 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)<br />
Aug 25 12:22:31 mypc systemd[1]: '''Started Load Kernel Modules'''.<br />
}}<br />
<br />
Often you can solve these kind of problems like shown above. For further investigation look at [[#Diagnosing boot problems]].<br />
<br />
=== Diagnosing boot problems ===<br />
<br />
Boot with these parameters on the kernel command line:<br />
{{ic|<nowiki>systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M</nowiki>}}<br />
<br />
[http://freedesktop.org/wiki/Software/systemd/Debugging More Debugging Information].<br />
<br />
=== Diagnosing problems with a specific service ===<br />
<br />
If some ''systemd'' service misbehaves and you want to get more information about what is going on, set the {{ic|SYSTEMD_LOG_LEVEL}} [[environment variable]] to {{ic|debug}}. For example, to run the ''systemd-networkd'' daemon in debug mode:<br />
<br />
# systemctl stop systemd-networkd<br />
# SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd<br />
<br />
Or, equivalently, modify the service file temporarily for gathering enough output. For example: <br />
<br />
{{hc|/lib/systemd/system/systemd-networkd.service|2=<br />
[Service]<br />
...<br />
Environment=SYSTEMD_LOG_LEVEL=debug<br />
....<br />
}}<br />
<br />
If debug information is required long-term, add the variable the [[#Editing provided unit files|regular]] way.<br />
<br />
=== Shutdown/reboot takes terribly long ===<br />
<br />
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. ''systemd'' waits some time for each service to exit before trying to kill it. To find out if you are affected, see [http://freedesktop.org/wiki/Software/systemd/Debugging/#shutdowncompleteseventually this article].<br />
<br />
=== Short lived processes do not seem to log any output ===<br />
<br />
If {{ic|journalctl -u foounit}} does not show any output for a short lived service, look at the PID instead. For example, if {{ic|systemd-modules-load.service}} fails, and {{ic|systemctl status systemd-modules-load}} shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i.e. {{ic|journalctl -b _PID&#61;123}}. Metadata fields for the journal such as _SYSTEMD_UNIT and _COMM are collected asynchronously and rely on the {{ic|/proc}} directory for the process existing. Fixing this requires fixing the kernel to provide this data via a socket connection, similar to SCM_CREDENTIALS.<br />
<br />
=== Disabling application crash dumps journaling ===<br />
<br />
{{Accuracy|{{ic|/etc/sysctl.d}} overwrite files of the same name, however {{ic|50-coredump.conf}} is no longer present in Arch; journal dump behaviour is regulated in {{ic|/etc/systemd/coredump.conf}} [http://www.freedesktop.org/software/systemd/man/coredump.conf.html]. Core dumps are by default not written to the journal, but to {{ic|/var/lib/systemd/coredump}}.}}<br />
<br />
Run the following in order to overwrite the settings from {{ic|/lib/sysctl.d/}}:<br />
<br />
# ln -s /dev/null /etc/sysctl.d/50-coredump.conf<br />
# sysctl kernel.core_pattern=core<br />
<br />
This will disable logging of coredumps to the journal.<br />
<br />
Note that the default RLIMIT_CORE of 0 means that no core files are written, either.<br />
If you want them, you also need to "unlimit" the core file size in the shell:<br />
<br />
$ ulimit -c unlimited<br />
<br />
See [http://www.freedesktop.org/software/systemd/man/sysctl.d.html sysctl.d] and [https://www.kernel.org/doc/Documentation/sysctl/kernel.txt the documentation for /proc/sys/kernel] for more information.<br />
<br />
=== Error message on reboot or shutdown ===<br />
<br />
==== cgroup : option or name mismatch, new: 0x0 "", old: 0x4 "systemd" ====<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?pid=1372562#p1372562 this thread] for an explanation.<br />
<br />
==== watchdog watchdog0: watchdog did not stop! ====<br />
<br />
See [https://bbs.archlinux.org/viewtopic.php?pid=1372562#p1372562 this thread] for an explanation.<br />
<br />
=== Boot time increasing over time ===<br />
<br />
After using {{ic|systemd-analyze}} a number of users have noticed that their boot time has increased significantly in comparison with what it used to be. After using {{ic|systemd-analyze blame}} [[NetworkManager]] is being reported as taking an unusually large amount of time to start. <br />
<br />
The problem for some users has been due to {{ic|/var/log/journal}} becoming too large. This may have other impacts on performance, such as for {{ic|systemctl status}} or {{ic|journalctl}}. As such the solution is to remove every file within the folder (ideally making a backup of it somewhere, at least temporarily) and then setting a journal file size limit as described in [[#Journal size limit]].<br />
<br />
== See also ==<br />
<br />
*[http://www.freedesktop.org/wiki/Software/systemd Official web site]<br />
*[[Wikipedia:systemd|Wikipedia article]]<br />
*[http://0pointer.de/public/systemd-man/ Manual pages]<br />
*[http://freedesktop.org/wiki/Software/systemd/Optimizations systemd optimizations]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions FAQ]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks Tips and tricks]<br />
*[http://0pointer.de/public/systemd-ebook-psankar.pdf systemd for Administrators (PDF)]<br />
*[http://fedoraproject.org/wiki/Systemd About systemd on Fedora Project]<br />
*[http://fedoraproject.org/wiki/How_to_debug_Systemd_problems How to debug systemd problems]<br />
*[http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html Two] {{Dead link|2014|08|17}} [http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html part] {{Dead link|2014|08|17}} introductory article in ''The H Open'' magazine.<br />
*[http://0pointer.de/blog/projects/systemd.html Lennart's blog story]<br />
*[http://0pointer.de/blog/projects/systemd-update.html Status update]<br />
*[http://0pointer.de/blog/projects/systemd-update-2.html Status update2]<br />
*[http://0pointer.de/blog/projects/systemd-update-3.html Status update3]<br />
*[http://0pointer.de/blog/projects/why.html Most recent summary]<br />
*[http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet Fedora's SysVinit to systemd cheatsheet]<br />
*[http://wiki.gentoo.org/wiki/Systemd Gentoo Wiki systemd page]</div>Gabuzohttps://wiki.archlinux.org/index.php?title=PhpLDAPadmin&diff=338010PhpLDAPadmin2014-09-29T09:39:06Z<p>Gabuzo: /* PHP */</p>
<hr />
<div>[[Category:Web Server]]<br />
{{lowercase title}}<br />
[http://phpldapadmin.sourceforge.net/ phpLDAPadmin] is an web-based [[LDAP]] adminstration interface.<br />
<br />
==Pre-Installation==<br />
<br />
See [[LAMP]] for a guide to setting up Apache, MySQL, and PHP.<br />
<br />
==Installation==<br />
<br />
Install the package {{Pkg|phpldapadmin}} from the [[official repositories]].<br />
<br />
==Configuration==<br />
<br />
===Apache===<br />
Create the Apache configuration file:<br />
{{hc|/etc/httpd/conf/extra/httpd-phpldapadmin.conf|<nowiki><br />
Alias /phpldapadmin "/usr/share/webapps/phpldapadmin"<br />
<Directory "/usr/share/webapps/phpldapadmin"><br />
DirectoryIndex index.html index.php<br />
AllowOverride All<br />
Options FollowSymlinks<br />
Require all granted<br />
</Directory><br />
</nowiki>}}<br />
<br />
And include it in {{ic|/etc/httpd/conf/httpd.conf}}:<br />
# phpLDAPadmin configuration<br />
Include conf/extra/httpd-phpldapadmin.conf<br />
<br />
By default, everyone can see the phpLDAPadmin page, to change this, edit {{ic|/etc/httpd/conf/extra/httpd-phpldapadmin.conf}} to your liking. For example, if you only want to be able to access it from the same machine, replace {{ic|Require all granted}} by {{ic|Require local}}.<br />
<br />
===PHP===<br />
You need to enable the {{ic|php-ldap}} extension in PHP by editing {{ic|/etc/php/php.ini}} and uncommenting the line<br />
;extension=ldap.so<br />
<br />
You need to make sure that PHP can access {{ic|/usr/share/webapps}} and {{ic|/etc/webapps}}. Add them to {{ic|open_basedir}} in {{ic|/etc/php/php.ini}} :<br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps<br />
<br />
===phpLDAPadmin configuration===<br />
phpLDAPadmin's configuration file is located at {{ic|/etc/webapps/phpldapadmin/config.php}}. If you have a local LDAP server, it should be usable without making any modifications.<br />
<br />
If your LDAP server is not on the localhost, uncomment and edit the following line:<br />
$servers->setValue('server','host','127.0.0.1');<br />
<br />
Although not strictly necessary you can name your server by editing the following line:<br />
$servers->setValue('server','name','My LDAP server');<br />
<br />
==Accessing your phpLDAPadmin installation==<br />
<br />
Your phpLDAPadmin installation is now complete. Before start using it you need to restart Apache.<br />
<br />
You can access your phpLDAPadmin installation by going to http://localhost/phpldapadmin/</div>Gabuzohttps://wiki.archlinux.org/index.php?title=PostGIS&diff=262710PostGIS2013-06-14T06:16:55Z<p>Gabuzo: /* Creating a Template PostGIS Database */</p>
<hr />
<div>[[Category:Database management systems]]<br />
PostGIS adds support for geographic objects in the PostgreSQL database. This document describes the process for installing PostGIS and creating a template PostGIS database. It is assumed that PostgreSQL has been installed. If it hasn't, please refer to the [[PostgreSQL]] page.<br />
<br />
== Installing PostGIS ==<br />
*Install PostGIS.<br />
$ su<br />
# pacman -S postgis<br />
<br />
== Creating a Template PostGIS Database ==<br />
*Become the postgres user.<br />
$ su<br />
# su - postgres<br />
*If you haven't created a superuser for accessing PostgreSQL, you may want do that now. You will be prompted for granting permissions to that user.<br />
$ createuser [username]<br />
*Create a new database called "template_postgis".<br />
$ createdb -O [username] template_postgis -E UTF-8<br />
*PostGIS requires the pl/pgSQL language to be installed on a database.<br />
$ createlang plpgsql template_postgis<br />
*Load the PostGIS spatial types for PostgreSQL and spatial reference systems. "postgis.sql" and "spatial_ref_sys.sql" are part of the installation of PostGIS, and may reside somewhere else besides "/usr/sharepostgresql/contrib/postgis-1.5/" depending on the installation. ''(Below is for default postgis 1.5 installation)''<br />
$ psql -d template_postgis -f /usr/share/postgresql/contrib/postgis-2.0/postgis.sql<br />
$ psql -d template_postgis -f /usr/share/postgresql/contrib/postgis-2.0/spatial_ref_sys.sql<br />
*Make it a real template. <br />
$ psql<br />
<br />
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';<br />
<br />
== Creating a PostGIS Database From the Template==<br />
*It's common practice to reserve a bare template for creating new PostGIS databases. As a PostgreSQL superuser, the following command will create a new database:<br />
$ createdb -T template_postgis [new_postgis_db]<br />
<br />
== More Resources ==<br />
For additional resources concerning PostGIS, check out the [http://postgis.refractions.net/documentation/ PostGIS Documentation].</div>Gabuzohttps://wiki.archlinux.org/index.php?title=PostGIS&diff=262709PostGIS2013-06-14T06:16:39Z<p>Gabuzo: /* Installing PostGIS */</p>
<hr />
<div>[[Category:Database management systems]]<br />
PostGIS adds support for geographic objects in the PostgreSQL database. This document describes the process for installing PostGIS and creating a template PostGIS database. It is assumed that PostgreSQL has been installed. If it hasn't, please refer to the [[PostgreSQL]] page.<br />
<br />
== Installing PostGIS ==<br />
*Install PostGIS.<br />
$ su<br />
# pacman -S postgis<br />
<br />
== Creating a Template PostGIS Database ==<br />
*Become the postgres user.<br />
$ su<br />
$ su - postgres<br />
*If you haven't created a superuser for accessing PostgreSQL, you may want do that now. You will be prompted for granting permissions to that user.<br />
$ createuser [username]<br />
*Create a new database called "template_postgis".<br />
$ createdb -O [username] template_postgis -E UTF-8<br />
*PostGIS requires the pl/pgSQL language to be installed on a database.<br />
$ createlang plpgsql template_postgis<br />
*Load the PostGIS spatial types for PostgreSQL and spatial reference systems. "postgis.sql" and "spatial_ref_sys.sql" are part of the installation of PostGIS, and may reside somewhere else besides "/usr/sharepostgresql/contrib/postgis-1.5/" depending on the installation. ''(Below is for default postgis 1.5 installation)''<br />
$ psql -d template_postgis -f /usr/share/postgresql/contrib/postgis-2.0/postgis.sql<br />
$ psql -d template_postgis -f /usr/share/postgresql/contrib/postgis-2.0/spatial_ref_sys.sql<br />
*Make it a real template. <br />
$ psql<br />
<br />
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';<br />
<br />
== Creating a PostGIS Database From the Template==<br />
*It's common practice to reserve a bare template for creating new PostGIS databases. As a PostgreSQL superuser, the following command will create a new database:<br />
$ createdb -T template_postgis [new_postgis_db]<br />
<br />
== More Resources ==<br />
For additional resources concerning PostGIS, check out the [http://postgis.refractions.net/documentation/ PostGIS Documentation].</div>Gabuzohttps://wiki.archlinux.org/index.php?title=Talk:Installation_guide&diff=262708Talk:Installation guide2013-06-14T05:36:43Z<p>Gabuzo: Change link do syslinux install</p>
<hr />
<div>== Read this first before add new suggestion ==<br />
* Point of this page is to ''not'' become another Beginner's guide. It's meant to be a ''concise'' checklist of things to be done. So detailed install instruction should go to [[Beginners' Guide]]. <br />
* If there is something to discuss which should also affect the Beginner's guide, then do it on [[Talk:Beginners%27_Guide/Installation]]. An advanced user will find this page less bloated and easier to read, so let's KISS.<br />
<br />
==Change link do syslinux install==<br />
<br />
The line <br />
See Syslinux configuration<br />
sould point to installation:<br />
See [[Syslinux#Installation|Syslinux installation]]<br />
Because in the configuration section, there is nothing about : "mark the partition active with the boot flag and install the MBR boot code". <br />
<br />
== Change section "Connect to the internet" ==<br />
<br />
Since the installation guide is now part of the iso image, I'd like to see a few references to the manpages of the necessary tools here, since you cannot open the network related wiki pages. Maybe something like this would be acceptable:<br />
Assuming a wired ethernet connection, running dhclient or dhcpcd is <br />
sufficient to get a lease. Otherwise set up the connection manually<br />
using ip add, wpa_supplicant (WLAN with WPA), pppoe-setup (DSL), etc.<br />
You can also create and use netcfg profiles. Read more in the manpages:<br />
ip(8), wpa_supplicant(8), pppoe(8), netcfg(8), netcfg-profiles(5)<br />
A reminder to install the packages for the internet connection in the pacstrap section would also be nice. -- [[User:progandy|progandy]]<br />
<br />
== Suggestions to update this guide as part of ISO ==<br />
Since this guide is now being included as 'install.txt' in the ISO, it might be beneficial to incorporate the following changes:<br />
* Entirely remove the '''1. Download''' section and move it to the Download area of the archlinux.org page. This document here is about installing, not downloading, checking, burning discs or dd'ing. The majority of users reading this have likely already booted up the install medium.<br />
* Begin or end the document by mentioning the new archlinux(7) man page which explains the location of important system configuration files<br />
# man archlinux<br />
* Slightly expand the '''6. Connect to the internet''' section to include the most basic examples of setting up a private network using a dynamic and static IP address. (Right now it's only a single paragraph/line.) It's a vital installation step and should actually be moved to the top as one of the first actions during system setup. This fact should be emphasized.<br />
<br />
Obtain dynamic IP <br />
# dhcpcd<br />
<br />
Set static IP<br />
# ip link set dev eth0 up<br />
# ip addr add 192.168.1.2/24 dev eth0<br />
# ip route add default via 192.168.1.1<br />
# echo "nameserver 8.8.8.8" >> /etc/resolv.conf<br />
<br />
--[[User:MajorTom|MajorTom]]<br />
<br />
:* I can agree to all your suggestions, I wonder why no one is modifying the wiki. Internet connection setup is the most important part and should be covered more extensively. In addition to your changes, mention the manpages and configuration templates for netcfg and pppoe-setup/connect. The boot medium must at least contain easy accesible information in order to read all pages referenced in the installation guide. There should also be mentioned that elinks is installed and can be used to access the wiki. --[[User:Progandy|Progandy]] ([[User talk:Progandy|talk]]) 21:50, 24 August 2012 (UTC)<br />
<br />
:* The {{ic|dhcpcd}} network daemon is started automatically: [https://www.archlinux.org/news/install-media-20120804-available/], [https://wiki.archlinux.org/index.php/Beginners%27_Guide#Network_setup], so there's no reason to start it manually. --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 08:17, 25 August 2012 (UTC)<br />
<br />
== add a step: setting the clock ==<br />
<br />
Lots of things care about the clock being more-or-less correct, e.g. pacman-key will not work at all if the clock is too far out. Lots of brand new computers come with the clock set to something in the distant past, which causes weird problems during the install. [[User:Thetrivialstuff|Thetrivialstuff]] ([[User talk:Thetrivialstuff|talk]]) 23:14, 31 July 2012 (UTC)<br />
<br />
I agree, the instructions in "Installation Guide" leaves you without a /etc/adjtime file.<br />
The following should be added (taken from beginners guide, but shortened):<br />
Set the hardware clock and generate a {{ic|/etc/adjtime}} file with {{ic|# hwclock --systohc --utc}} or {{ic|# hwclock --systohc --localtime}}<br />
[[User:Bwid|Bwid]] ([[User talk:Bwid|talk]]) 08:03, 3 March 2013 (UTC)<br />
:There's no need for an adjtime file, but it does make sense to have people use {{ic|timedatectl}} from the live media to set the clock correctly. -- [[User:Thestinger|thestinger]] ([[User talk:Thestinger|talk]]) 03:30, 15 March 2013 (UTC)<br />
<br />
== pacman-key --init / populate? ==<br />
<br />
Isn't this a required step? pacstrap does not seem to do it on its own. [[User:Thetrivialstuff|Thetrivialstuff]] ([[User talk:Thetrivialstuff|talk]]) 23:15, 31 July 2012 (UTC)<br />
:Edit: Ah; I think this was related to the "set the clock" step -- I see that there is a pacman keyring init in the boot sequence of the latest media, but it (silently?) fails if the local clock is wrong.<br />
::https://mailman.archlinux.org/pipermail/arch-releng/2012-July/002708.html --[[User:Bluewind|Bluewind]] ([[User talk:Bluewind|talk]]) 09:10, 1 August 2012 (UTC)<br />
<br />
== Link to UEFI Bootloaders page ==<br />
<br />
Instead of telling the user to install GRUB(2) alone in case of UEFI, direct the reader to the [[UEFI_Bootloaders]] page which provides info about all the UEFI bootloaders capable of booting linux kernel. Also how can I edit the guide, there is no "edit" tab shown on top of the page. Is this page restricted to few authors only? -- [[User:The.ridikulus.rat|Keshav P R]] ([[User talk:The.ridikulus.rat|talk]]) 15:31, 19 August 2012 (UTC)<br />
<br />
==Proposed changes to Beginners' Guide and link to Post-Installation==<br />
Some major changes are under discussion in [[Talk:Beginners'_Guide#Guide_restructuring]]: some of them would require adjustments to this very guide, see for example [https://wiki.archlinux.org/index.php?title=Talk%3ABeginners%27_Guide&diff=224578&oldid=224567 this post].<br />
<br />
Please reply in the linked discussion, '''not''' here.<br />
<br />
-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 12:15, 22 September 2012 (UTC)<br />
<br />
:I've added the steps in [[Beginners' Guide/Post-Installation]] to this guide, which now directly sends users to [[Beginners' Guide/Extra]].<br />
:If however [[Talk:Beginners' Guide#Guide restructuring]] will be implemented as planned, the [[Beginners' Guide]] will have a slightly different installation procedure than this guide, unless this one is updated too.<br />
:-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 14:08, 24 September 2012 (UTC)<br />
<br />
::Shouldn't the information be added ''before'' "Unmount leftovers and reboot" ? By the way, the title should mention rebooting, because most likely a kernel update was involved. --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 14:41, 24 September 2012 (UTC)<br />
<br />
:::The link to Post-Installation was the last step of the guide, so that's the line I've replaced with the instructions from Post-Installation.<br />
:::About rebooting in case of a kernel upgrade, I don't think it's necessary to state that since this guide is aimed at experienced users.<br />
:::In any case, any reordering or modification of the various steps should better be approved by a Developer, and probably the forum or the mailing lists are better places than this talk page to involve them in such discussions.<br />
:::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 14:59, 24 September 2012 (UTC)<br />
<br />
::::Yeah, but at this point, you were instructed to reboot. In order to edit {{ic|pacman.conf}}, you need to mount the root partition. And to update your system, you need to chroot into it. It would be better if "Unmount leftovers" was renamed "Unmount leftovers and reboot", and added at the end (before the suggestion to read the instructions from '''Extra'''). --[[User:DSpider|DSpider]] ([[User talk:DSpider|talk]]) 15:07, 24 September 2012 (UTC)<br />
<br />
:::::You are still instructed to reboot, aren't you? The "Unmount leftovers" section currently tells you to ''"reboot and then login into the new system with the root account"''. In the "new system", the correct partition is already mounted at /.<br />
:::::Whether or not configuring pacman, updating the system and adding a user would be better done in the chroot before rebooting, it's something that should be discussed with a Developer. I too think that it would make more sense, requiring one less reboot in case of a kernel upgrade.<br />
:::::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 15:18, 24 September 2012 (UTC)<br />
:::::Renaming "Unmount leftovers" to "Unmount leftovers and reboot" is safe anyway, so I've done that. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 15:37, 24 September 2012 (UTC)<br />
:::::@DSpider: you're quite active on the forum, why don't you propose your idea there? I think it would be interesting to discuss it. -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 14:11, 25 September 2012 (UTC)<br />
:::::Ok, after reading [https://wiki.archlinux.org/index.php?title=Talk%3AInstallation_Guide&diff=226203&oldid=225070 this] I realize that maybe I haven't been clear enough, so I'll try to explain everything more thoroughly.<br />
:::::#The current procedure makes you [[Installation_Guide#Configure_the_system|configure the system]] in the '''chroot''' environment from the '''live''' system.<br />
:::::#Then, still in the '''live''' system, it [[Installation_Guide#Unmount and reboot|asks]] you to '''exit''' the chroot, unmount the partitions for the '''new''' system, '''reboot''' and login into the '''new''' system. Now, I refuse to write more explicitly in the guide that you should boot into the '''new''' system, and not again in the '''live''' system, in order to login into the new system.<br />
:::::#Since you are now into the '''new''' system ('''not''' the live system), the root partition is mounted at {{ic|/}}, not at {{ic|/mnt/}}, so you should be able to configure pacman, update the system and add a user wihtout chrooting. Now, if you've tested the procedure and really noticed that for some obscure-to-me reason you still need to chroot to /mnt in order to do those operations, please ask for clarifications in the forum because I wouldn't be able to answer any more.<br />
:::::Last thing, and I think this is the 3rd or 4th time I write it, I '''agree''' with you that configuring pacman etc. could easily be done in the chroot environment at step 1, but you should '''propose''' that change '''in the forum''' first, since it would be a change in the official installation procedure and I won't take responsibility for that.<br />
:::::I think this is the best I can do here, the next step to explain all this could be making a movie or a five-act play, but I hope it's not necessary :)<br />
:::::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 05:56, 30 September 2012 (UTC)<br />
<br />
== Mounting the Swap partition. ==<br />
<br />
Just a note to clarify the swap partition is '''NOT''' mounted.<br />
You will get an error message if you try.<br />
<br />
Turning on the partition with ''swapon'' command will have the desired effect of having it activated before you add it to /etc/fstab.<br />
--[[User:CaptainK|CaptainK]] ([[User talk:CaptainK|talk]]) 07:56, 12 June 2013 (UTC)</div>Gabuzohttps://wiki.archlinux.org/index.php?title=Daemons&diff=226021Daemons2012-09-28T17:06:12Z<p>Gabuzo: Bit Torrent Daemon</p>
<hr />
<div>[[Category:Boot process]]<br />
[[Category:Daemons and system services]]<br />
[[cs:Daemon]]<br />
[[de:Daemons]]<br />
[[it:Daemon]]<br />
[[pl:Daemon]]<br />
[[ro:Daemon]]<br />
[[ru:Daemon]]<br />
[[tr:Artsüreç]]<br />
[[zh-CN:Daemon]]<br />
A [[Wikipedia:Daemon (computing)|daemon]] is a program that runs in the background, waiting for events to occur and offering services. A good example is a web server that waits for a request to deliver a page or a ssh server waiting for someone trying to log in. While these are full featured applications, there are daemons whose work is not that visible. Daemons are for tasks like writing messages into a log file (e.g. {{ic|syslog}}, {{ic|metalog}}) or keeping your system time accurate (e.g. [[Network Time Protocol daemon|{{ic|ntpd}}]]).<br />
<br />
{{Note|The word daemon is sometimes used for a class of programs that are started at boot but have no process which remains in memory. They are called daemons simply because they utilize the same startup/shutdown framework (e.g. {{ic|/etc/rc.d/}} scripts) used to start traditional daemons. For example, the {{ic|/etc/rc.d}} scripts for {{ic|alsa}} and {{ic|cpufreq}} provide persistent configuration support for their perspective kernel modules but do not start additional background processes to service requests or respond to events.<br />
<br />
From the user's perspective the distinction is typically not significant unless the user tries to look for the "daemon" in a process list.<br />
}}<br />
<br />
==Initscripts system==<br />
<br />
===Starting on Boot===<br />
A default install of Arch Linux will leave you with very few services (or daemons) enabled during boot. You can add or remove services by editing the {{ic|DAEMONS}} array in your [[rc.conf]] file. It will initially look something like this:<br />
DAEMONS=(syslog-ng network netfs crond)<br />
<br />
They will start in the order you have them listed. You can disable one and keep it in the array by prefixing it with an exclamation mark ({{ic|!}}). You can also have them start in the background by adding the {{ic|@}} symbol in front of it.<br />
<br />
Daemon scripts are stored in {{ic|/etc/rc.d/}}. You can print the list of all the available daemons on your system, along with their current status, with:<br />
$ rc.d list<br />
<br />
===Performing daemon actions manually===<br />
Every daemon has a series of actions that can be called with specific commands: usually there are at least {{ic|start}}, {{ic|stop}}, and {{ic|restart}}. You can issue each with:<br />
# /etc/rc.d/''daemon-name'' {start|stop|restart|...}<br />
A completely equivalent way is:<br />
# rc.d {start|stop|restart|...} ''daemon-name-1'' ''daemon-name-2'' ''daemon-name-3'' ...<br />
which, as it is clear from the example, works also with a list of daemons, calling for each the given action.<br />
<br />
For a list of all the available commands for a specific daemon, check its documentation, or just open the script in a text viewer.<br />
<br />
===Essentials===<br />
You do not have to add any more services, if you do not feel the need. However, a typical desktop user will add at least [[CUPS]] and [[D-Bus|dbus]]. As you install new services, you will have to manually add them to the {{ic|DAEMONS}} array in {{ic|/etc/[[rc.conf]]}}.<br />
<br />
===Starting Daemons in Background===<br />
This is helpful for starting a service and letting the next service start before the previous one has finished. Which services to start background depends on your needs. Do not background anything you need immediately. Here is an example:<br />
DAEMONS=(syslog-ng gensplash dbus network netfs @avahi-daemon @samba @crond @openntpd @cupsd @mpd)<br />
<br />
Starting {{ic|openntpd}} in the background could lead to synchronization errors between the actual time and the time stored on your computer. If you recognize an increasing time difference between your desktop clock and the actual time, try to start the {{ic|openntpd}} daemon normally and not in the background.<br />
<br />
===rc.conf GUI front-ends===<br />
[[Rc.conf GUI Frontends|rc.conf GUI front-ends]] allow one to easily change settings in {{ic|/etc/rc.conf}} using a graphical application.<br />
<br />
==Systemd system==<br />
<br />
To see a list of running units (some of which will be daemons, amongst other things), type:<br />
$ systemctl list-units<br />
To see all available ones, add {{ic| --all}} to the end of a command.<br />
<br />
To start a daemon, use:<br />
# systemctl start <name>.service<br />
<br />
To enable it at boot, in the above replace {{ic|start}} with {{ic|enable}}.<br />
<br />
The counter-parts to the previous commands are {{ic|stop}} and {{ic|disable}}.<br />
<br />
You can read more at the [[Systemd#Systemd_commands]] section.<br />
<br />
==List of Daemons==<br />
Here is a list of daemons. Note that any package can provide a daemon, so this list will never be complete. Please feel free to add any missing daemons here, in alphabetical order.<br />
For each daemon the name of the script (for [[rc.conf|initscripts]]) and of the service (for [[systemd]]) is given.<br />
{| border="1"<br />
!Initscripts!!Systemd!!Description<br />
|-<br />
|[[acpid]]||acpid.service||Delivers ACPI events.<br />
|-<br />
|[[Advanced Linux Sound Architecture|alsa]]||alsa-store.service<br />
alsa-restore.service<br />
||Advanced Linux Sound Architecture; provides device drivers for sound cards.<br />
|-<br />
|atd||''not yet implemented''||Run jobs queued for later execution.<br />
|-<br />
|[[Avahi|avahi-daemon]]||avahi-daemon.service||Allows programs to automatically find local network services.<br />
|-<br />
|[[Avahi|avahi-dnsconfd]]||avahi-dnsconfd.service||<br />
|-<br />
|[[Chrony|chrony]]||chrony.service||Alternative NTP client/server designed for systems not online all the time.<br />
|-<br />
|[[ClamAV|clamav]]||clamd.service<br />
freshclamd.service<br />
||Antivirus.<br />
|-<br />
|[[CPU_Frequency_Scaling|cpupower]]||cpupower.service||Userspace tools for the kernel cpufreq subsystem<br />
|-<br />
|craftbukkit||''not yet implemented''||CraftBukkit Minecraft server<br />
|-<br />
|[[Cron|crond]]||cronie.service||Daemon to schedule and time events. The daemon name ''crond'' is used by at least two packages, {{Pkg|cronie}} and {{Pkg|dcron}}.<br />
|-<br />
|[[CUPS|cupsd]]||cupsd.service<br />
''or'' cups.service<br />
||Common UNIX Printing System daemon.<br />
|-<br />
|[[D-Bus|dbus]]||dbus.service||Message bus system for software communication.<br />
|-<br />
|[[Deluge|deluged]]||deluged.service||Cross-platform and full-featured BitTorrent client.<br />
|-<br />
|[[Deluge|deluge-web]]||deluge-web.service||Cross-platform and full-featured BitTorrent client web UI.<br />
|-<br />
|[[Dropbox|dropboxd]]||''not yet implemented''||Cross-platform file synchronisation with version control.<br />
|-<br />
|[[FAM|fam]]||''deprecated''||File Alteration Monitor. (deprecated)<br />
|-<br />
|fancontrol||fancontrol.service||Fan control daemon (part of lm_sensors)<br />
|-<br />
|[[Fbsplash|fbsplash]]||''not yet implemented''||Graphical boot splash screen for the user.<br />
|-<br />
|ftpd||''not yet implemented''||Inetutils ftp daemon<br />
|-<br />
|[[GDM|gdm]]||gdm.service||Gnome Display Manager (Login Screen)<br />
|-<br />
|[[Git|git-daemon]]||''not yet implemented''||GIT daemon<br />
|-<br />
|[[Console Mouse Support|gpm]]||gpm.service||Console mouse support.<br />
|-<br />
|[[HAL|hal]]||''deprecated''||Hardware Abstraction Layer. (Deprecated)<br />
|-<br />
|hddtemp||hddtemp.service||Hard drive temperature monitor daemon<br />
|-<br />
|healthd||healthd.service||A daemon which can be used to alert you in the event of a hardware health monitoring alarm (part of lm_sensors).<br />
|-<br />
|-<br />
|iptables||iptables.service||Load firewall rules.<br />
|-<br />
|-<br />
|ip6tables||ip6tables.service||Load firewall rules for ipv6.<br />
|-<br />
|[[LAMP|httpd]]||httpd.service<br />
See [[Systemd/Services#apache2]] for manual configuration.<br />
||Apache HTTP Server (Web Server)<br />
|-<br />
|[[hwclock]]||||Not a daemon as such, but on shutdown, updates hwclock to compensate for drift. Only run this daemon if ntpd is not running as both daemons adjust the hardware clock.<br />
|-<br />
|irqbalance||''not yet implemented''||Irqbalance is the Linux utility tasked with making sure that interrupts from your hardware devices are handled in as efficient a manner as possible.<br />
|-<br />
|[[KDE|kdm]]||kdm.service||KDE Display Manager (Graphical Login)<br />
|-<br />
|krb5-kadmind||krb5-kadmind.service||Kerberos 5 administration server<br />
|-<br />
|krb5-kdc||krb5-kdc.service||Kerberos 5 KDC<br />
|-<br />
|krb5-kpropd||krb5-kpropd.service||Kerberos 5 propagation server<br />
|-<br />
|[[Laptop Mode Tools|laptop-mode]]||laptop-mode-tools.service||Laptop Power Saving Tools<br />
|-<br />
|[[lighttpd]]||lighttpd.service||Lighttpd HTTP Server (Web Server).<br />
|-<br />
|mdadm||mdadm.service||MD Administration (Linux Software RAID).<br />
|-<br />
|[[Music Player Daemon|mpd]]||mpd.service||Music Player Daemon.<br />
|-<br />
|[[MySQL|mysqld]]||mysqld.service||MySQL database server.<br />
|-<br />
|netfs||''unused, handled automatically, see''<br />
remote-fs.target<br />
''to manually execute scripts''<br />
||Mounts network file systems.<br />
|-<br />
|[[Netcfg|net-auto-wired]]||net-auto-wired.service||Netcfg replacement for {{ic|network}} - connects to wired network<br />
|-<br />
|[[Netcfg|net-auto-wireless]]||net-auto-wireless.service||Netcfg replacement for {{ic|network}} - connects to wireless network<br />
|-<br />
|[[Netcfg|net-profiles]]||netcfg.service<br />
netcfg@<profile-name>.service<br />
||Netcfg replacement for {{ic|network}} - connects to profiles<br />
|-<br />
|[[Configuring_Network|network]]||''(dynamic Ethernet)'' dhcpcd@<interface>.service||To bring up the network connections.<br />
|-<br />
|[[NetworkManager|networkmanager]]||NetworkManager.service<br />
NetworkManager-wait-online.service<br />
||Replaces {{ic|network}}, and provides configuration and detection for automatic network connections.<br />
|-<br />
|[[Nginx|nginx]]||nginx.service||Nginx HTTP Server and IMAP/POP3 proxy server (Web Server)<br />
|-<br />
|nscd||nscd.service||Name service cache daemon<br />
|-<br />
|[[Network Time Protocol daemon|ntpd]]||ntpd.service||Network Time Protocol daemon (client and server).<br />
|-<br />
|[[OpenNTPD|openntpd]]||openntpd.service||alternate Network Time Protocol daemon (client and server).<br />
|-<br />
|[[Pdnsd|pdnsd]]||pdnsd.service||Proxy DNS server with permanent caching.<br />
|-<br />
|[[Nginx#1st_Method_.22New.22_.28as_of_PHP_5.3.3.29|php-fpm]]||||FastCGI Process Manager for PHP<br />
|-<br />
|[[PostgreSQL|postgresql]]||postgresql.service||PostgreSQL database server.<br />
|-<br />
|[[powernowd]]||''not yet implemented''||To adjust speed of CPU depending on system load. See also [[CPU Frequency Scaling]]<br />
|-<br />
|ppp||''not yet implemented''||A daemon which implements the Point-to-Point Protocol for dial-up networking.<br />
|-<br />
|[[preload]]||preload.service||Makes applications run faster by prefetching binaries and shared objects.<br />
|-<br />
|pure-ftpd||''not yet implemented''||FTP server.<br />
|-<br />
|[[readahead]]||systemd-readahead-collect.service<br />
systemd-readahead-done.service<br />
<br />
systemd-readahead-drop.service<br />
<br />
systemd-readahead-replay.service<br />
||Readahead for faster boot<br />
|-<br />
||rfkill||rfkill.service||(Un)block radio devices. (.service does not seem to provide equivalent functionality.)<br />
|-<br />
|[[Rsync|rsyncd]]||rsyncd.service||Rsync daemon.<br />
|-<br />
|[[Rsyslog|rsyslogd]]||rsyslog.service||The latest version of a system logger.<br />
|-<br />
|[[samba]]||smbd.service<br />
nmbd.service<br />
<br />
winbindd.service<br />
||File and print services for Microsoft Windows clients.<br />
|-<br />
|[[USB_Scanner_Support|saned]]||saned@.service||To share the scanner system over network.<br />
|-<br />
|sensord||sensord.service||Sensor information logging daemon (part of lm_sensors)<br />
|-<br />
|[[Lm sensors|sensors]]||lm_sensors.service||Hardware (temperature, fans etc) monitoring.<br />
|-<br />
|[[SLiM|slim]]||slim.service||Simple Login Manager<br />
|-<br />
|[[SMART|smartd]]||smartd.service||Self-Monitoring, Analysis, and Reporting Technology (S.M.A.R.T) Hard Disk Monitoring<br />
|-<br />
|snmpd||''not yet implemented''||A suite of applications used to implement SNMP<br />
|-<br />
|soundmodem||''not yet implemented''||Multiplatform Soundcard Packet Radio Modem<br />
|-<br />
|[[Secure Shell|sshd]]||sshd.service<br />
sshd@.service<br />
<br />
sshdgenkeys.service<br />
||OpenSSH (secure shell) daemon.<br />
|-<br />
|stbd||''deprecated''||This daemon was previously necessary for gnome-system-tools. However, as of gnome-tools 2.28, it is no longer needed.<br />
|-<br />
|svnserve||svnserve.service||Subversion server<br />
|-<br />
|syslogd||''deprecated''||This was the older and basic system logger.<br />
|-<br />
|[[syslog-ng]]||syslog-ng.service||System logger next generation.<br />
|-<br />
|[[Timidity|timidity++]]||''not yet implemented''||Software synthesizer for MIDI.<br />
|-<br />
|[[Transmission|transmissiond]]||transmission.service||Bit Torrent Daemon.<br />
|-<br />
|[[VirtualBox|vboxservice]]||vboxservice.service||VirtualBox Guest Service<br />
|-<br />
|[[Very Secure FTP Daemon|vsftpd]]||vsftpd.service<br />
vsftpd@.service<br />
<br />
vsftpd-ssl.service<br />
||FTP server.<br />
|-<br />
|[[wicd]]||wicd.service||Combine with dbus to replace {{ic|network}}, a lightweight alternative to NetworkManager.<br />
|-<br />
|[[x11vnc]]||''not yet implemented''||VNC remote desktop daemon <br />
|-<br />
|}<br />
<br />
==See also==<br />
* [[rc.conf|Initscripts]]<br />
* [[Systemd|systemd]]<br />
* Examples for [[writing rc.d scripts]]<br />
* Examples for writing [[Systemd/Services]]</div>Gabuzohttps://wiki.archlinux.org/index.php?title=Huawei_E173s&diff=217862Huawei E173s2012-08-14T15:41:50Z<p>Gabuzo: /* Set up usb_modeswitch */</p>
<hr />
<div>[[Category:Modems]]<br />
This page describes how to set up Huawei E173s 3G USB modem on Arch Linux. It involves switching the USB stick from CD-ROM mode to modem mode using usb_modeswitch, making a connection to the network with sakis3g and setting it up to run at system startup.<br />
== Check modem ==<br />
Install usbutils (base) if not installed:<br />
pacman -S usbutils<br />
Plug in the modem and run lsusb:<br />
lsusb | grep Huawei<br />
The output should be something like this:<br />
Bus 003 Device 003: ID 12d1:1c0b Huawei Technologies Co., Ltd.<br />
The ID 12d1:1c0b refers to vendor id and product id. If you get different values, it means your modem is not Huawei E173s (of course, you can always open the USB stick to double check).<br />
== Set up usb_modeswitch ==<br />
Install usb_modeswitch (community) if not installed:<br />
pacman -S usb_modeswitch<br />
At this point, if you remove your modem and re-insert it udev should switch to modem mode automatically but sometimes it just doesn't work (on my system for example) so you have to do it manually as root:<br />
usb_modeswitch -c /usr/share/usb_modeswitch/12d1\:1c0b -v 12d1 -p 1c0b<br />
<br />
== Check if the modem is switched ==<br />
lsusb | grep Huawei<br />
The output should be something like this:<br />
Bus 003 Device 003: ID 12d1:1c05 Huawei Technologies Co., Ltd.<br />
Note that the product ID has changed from 1c0b to 1c05. It means that the USB stick can now be used as a modem. Also note that it can take some time (probably not more than 15 seconds) for the modem to switch if you removed and re-inserted it instead of running usb_modeswitch manually.<br />
== Connecting ==<br />
The easiest way to connect is with sakis3g.<br />
Install ppp (base) and net-tools (core) if not installed:<br />
pacman -S ppp net-tools<br />
Download and install sakis3g from http://www.sakis3g.org/ (it's also available from [https://aur.archlinux.org/packages.php?ID=59017 AUR]):<br />
wget http://www.sakis3g.org/versions/latest/i386/sakis3g.gz<br />
gunzip sakis3g.gz<br />
mv sakis3g /usr/bin<br />
Run sakis3g:<br />
sakis3g --interactive<br />
You will have to provide your APN, username and password, assuming everything goes right you should be connected by now. Note while sakis3g should detect your modem, sometimes it just doesn't (it's the case on my system). If that's the case you have to specify CUSTOM_TTY, for example /dev/ttyUSB0.<br />
== Connecting at system startup ==<br />
=== Creating a configuration file ===<br />
nano /etc/sakis3g.conf<br />
Add the following lines (CUSTOM_APN, APN_USER and APN_PASS refer to your APN, username and password respectively, you may have to adjust them):<br />
OTHER=CUSTOM_TTY<br />
CUSTOM_TTY="/dev/ttyUSB0"<br />
APN=CUSTOM_APN<br />
CUSTOM_APN="general.t-mobile.uk"<br />
APN_USER="t-mobile"<br />
APN_PASS="tm"<br />
This configuration file works very well on my system but you may have to adjust CUSTOM_TTY as well if you have more than one USB modem. Note that it's also modem-independent - if you start using a different modem you shouldn't have to change anything.<br />
=== Running sakis3g at system startup ===<br />
What you need to do is to run sakis3g connect at system startup. The easiest way to do this is to add these lines to /etc/rc.local (it doesn't always work, I don't know why):<br />
sakis3g connect --console<br />
sleep 3<br />
The second line gives you time to examine the output of sakis3g at system startup to see if everything is working as it should, if it is, you can just remove it later. Another option, if you are using X but not using a login manager like GDM, is to put it in your .xinitrc (see the first line):<br />
sudo sakis3g connect &<br />
exec ck-launch-session gnome-session<br />
Although if you are using GNOME, you should add it in gnome-session-properties instead:<br />
Name: sakis3g<br />
Command: sudo sakis3g connect<br />
For both of these to work you need to add the following line to /etc/sudoers:<br />
<username> ALL=(ALL) NOPASSWD:/usr/bin/sakis3g<br />
Replace <username> with your username.<br />
==External links==<br />
* http://wiki.sakis3g.org/wiki/index.php?title=Mode_switch</div>Gabuzohttps://wiki.archlinux.org/index.php?title=Netcfg&diff=212073Netcfg2012-07-05T19:54:16Z<p>Gabuzo: Added waitout option for ping</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Networking]]<br />
[[fr:Netcfg]]<br />
[[it:Netcfg]]<br />
[[ro:Netcfg]]<br />
[[ru:Netcfg]]<br />
[[tr:netcfg]]<br />
[[zh-CN:Netcfg]]<br />
{{Out of date|1=requires adaptations for version 2.8.2, see [http://www.archlinux.org/news/netcfg-282-release/], [http://projects.archlinux.org/netcfg.git/tree/NEWS?id=2.8.2] and [http://www.archlinux.org/netcfg/].}}<br />
{{Article summary start}}<br />
{{Article summary text|A guide to installing and configuring netcfg &ndash; network configuration and profile scripts.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary heading|Resources}}<br />
{{Article summary link|netcfg network scripts repository|https://projects.archlinux.org/netcfg.git/}}<br />
{{Article summary end}}<br />
<br />
From the [https://projects.archlinux.org/netcfg.git/tree/docs/netcfg.txt netcfg man page]:<br />
<br />
:'''''netcfg''' is used to configure and manage network connections via profiles. It has pluggable support for a range of connection types, such as wireless, ethernet, ppp. It is also capable of starting/stopping many to one connections, that is, multiple connections within the same profile, optionally with bonding.''<br />
<br />
netcfg is useful for users seeking a simple and robust means of managing multiple network configurations (e.g. laptop users). For systems connecting to a single network, the [[network]] daemon may be more appropriate.<br />
<br />
==Preparation==<br />
In the simplest cases, users must at least know the name of their network interface(s) (e.g. {{ic|eth0}}, {{ic|wlan0}}). If configuring a static IP address, the IP addresses of the default gateway and name server(s) must also be known.<br />
<br />
If connecting to a wireless network, have some basic information ready. For a wireless network this includes what type of security is used, the network name (ESSID), and any password or encryption keys. Additionally, ensure the proper drivers and firmware are installed for the wireless device, as described in [[Wireless Setup]].<br />
<br />
==Installation==<br />
Ensure you have the latest version of {{Pkg|netcfg}} installed. Older versions have more bugs and may not work well with the latest drivers. The {{Pkg|netcfg}} package is available in the [[Official Repositories|official repositories]].<br />
<br />
As of {{Pkg|netcfg}} version 2.5.x, optional dependencies include {{Pkg|wpa_actiond}} &ndash; required for automatic/roaming wireless connections &ndash; and {{Pkg|ifplugd}} &ndash; required for automatic Ethernet configuration. ([https://www.archlinux.org/news/487/ More information].)<br />
<br />
If you want to have [[Bash]] completion support for netcfg, install the {{Pkg|bash-completion}} package from the official repositories.<br />
<br />
==Configuration==<br />
Network profiles are stored in the {{ic|/etc/network.d}} directory. To minimize the potential for errors, copy an example configuration from {{ic|/etc/network.d/examples/}} to {{ic|/etc/network.d/mynetwork}}. The file name is the name of the network profile ("mynetwork" is used as an example throughout this article). The name is not a network setting and does not need to match the wireless network name (SSID).<br />
<br />
Depending on the connection type and security, use one of the following examples from {{ic|/etc/network.d/examples}} as a base. Be wary of examples found on the Internet as they often contain deprecated options that may cause problems.<br />
<br />
{| border="1"<br />
! Connection type/security !! Example profile<br />
|-<br />
| Wireless; WEP hex key || {{ic|wireless-wep}}<br />
|-<br />
| Wireless; WEP string key || {{ic|wireless-wep-string-key}}<br />
|-<br />
| Wireless; WPA-Personal (passphrase/pre-shared key) || {{ic|wireless-wpa}}<br />
|-<br />
| Wireless; WPA-Enterprise || {{ic|wireless-wpa-config}} (wpa_supplicant configuration is external) <br /> {{ic|wireless-wpa-configsection}} (wpa_supplicant configuration stored as string)<br />
|-<br />
| Wired; DHCP || {{ic|ethernet-dhcp}}<br />
|-<br />
| Wired; static IP || {{ic|ethernet-static}}<br />
|-<br />
| Wired; iproute configuration || {{ic|ethernet-iproute}}<br />
|}<br />
<br />
Next, modify the new configuration file, {{ic|/etc/network.d/mynetwork}}:<br />
<br />
* Set {{ic|INTERFACE}} to the correct wireless or Ethernet interface. This can be checked with {{ic|ip link}} and {{ic|iwconfig}}.<br />
* Ensure the {{ic|ESSID}} and {{ic|KEY}} (passphrase) are set correctly for wireless connections. Typos in these fields are common errors.<br />
** Note that WEP ''string'' keys (not ''hex'' keys) must be specified with a leading {{ic|s:}} (e.g. {{ic|<nowiki>KEY="s:somepasskey"</nowiki>}}).<br />
<br />
{{Note|netcfg configurations are valid Bash scripts. Any configuration involving special characters such as {{ic|$}} or {{ic|\}} needs to be quoted correctly otherwise it will be interpreted by Bash. To avoid interpretation, use single quotes or backslash escape characters where appropriate.}}<br />
<br />
{{Note|Network information (e.g. wireless passkey) will be stored in plain text format, so users may want to change the permissions on the newly created profile (e.g. {{ic|chmod 0600 /etc/network.d/mynetwork}}) to make it readable by root only.}}<br />
<br />
{{Note|For WPA-Personal, it is also possible to use WPA passkey encoded into a hexadecimal string, instead of as a plain text passkey.<br />
Follow the procedure on the [[Wpa_supplicant#Classic_method:_.2Fetc.2Fwpa_supplicant.conf|WPA supplicant page's first example exercise]] to generate a hexadecimal string from you WPA passkey.<br /><br />
Save the new hexadecimal string into your wireless WPA profile in {{ic|/etc/network.d/mynetwork}} as the value of the {{ic|KEY}} variable (make sure this will be the only {{ic|KEY}} variable enabled), to look similar to this (replace the string with your one):<br />
KEY<nowiki>=</nowiki>'7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515'<br />
That should do it, without the need to reveal the passkey.<br /><br />
}}<br />
<br />
==Usage==<br />
To connect a profile:<br />
# netcfg mynetwork<br />
<br />
To disconnect a profile:<br />
# netcfg down <profile-name><br />
<br />
If successful, users can configure netcfg to connect automatically or during boot. If the connection fails, see [[#Troubleshooting]] for solutions and how to get help.<br />
<br />
For other functions, see:<br />
$ netcfg help<br />
<br />
==Connecting automatically==<br />
Several methods are available to users wanting to automatically connect network profiles (e.g. during boot or whilst roaming). Note that a network profile must be properly configured within the {{ic|/etc/network.d}} directory ''first'' (see [[#Configuration]]).<br />
<br />
{{Tip|If enabling one of the following daemons and nothing is configured within the {{ic|INTERFACES}} array in {{ic|/etc/rc.conf}}, you may remove the {{ic|network}} daemon from the {{ic|DAEMONS}} array. If you mount [[NFS]] shares during boot, ensure the {{ic|netfs}} daemon remains listed, though (otherwise the network will be dropped before unmounting shares during shutdown).}}<br />
<br />
===net-profiles===<br />
'''{{ic|net-profiles}} allows users to connect profiles during boot.'''<br />
<br />
To enable this feature, users must add {{ic|net-profiles}} to the {{ic|DAEMONS}} array in {{ic|/etc/[[rc.conf]]}} and specify profiles to try in the {{ic|NETWORKS}} array in {{ic|/etc/conf.d/netcfg}}:<br />
<br />
{{hc|/etc/rc.conf|<nowiki><br />
DAEMONS=(... net-profiles ...)<br />
</nowiki>}}<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
NETWORKS=(mynetwork yournetwork)<br />
</nowiki>}}<br />
A network profile can also be started in the background by prefixing it with a {{ic|@}} in the {{ic|NETWORKS}} array. Note that you should only do this if the backgrounded profiles configure separate interfaces, otherwise race condiditions may occur.<br />
<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
NETWORKS=(@mynetwork @yournetwork)<br />
</nowiki>}}<br />
<br />
Alternatively, {{ic|net-profiles}} can be configured to restore the profiles that were active at last shutdown by setting the {{ic|NETWORKS}} array to {{ic|last}}, as described below.<br />
<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
NETWORKS=(last)<br />
</nowiki>}}<br />
<br />
Finally, {{ic|net-profiles}} can be configured to display a menu &ndash; allowing users to choose a desired profile &ndash; by setting the contents of the {{ic|NETWORKS}} array to {{ic|menu}}:<br />
<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
NETWORKS=(menu)<br />
</nowiki>}}<br />
<br />
Additionally, the {{Pkg|dialog}} package is required.<br />
<br />
{{Tip|Access the menu at any time by running {{ic|netcfg-menu}} in a terminal.}}<br />
<br />
===net-auto-wireless===<br />
'''{{ic|net-auto-wireless}} allows users to automatically connect to wireless networks with proper roaming support.'''<br />
<br />
To enable this feature, users must add {{ic|net-auto-wireless}} to the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}}:<br />
{{hc|/etc/rc.conf|<nowiki><br />
DAEMONS=(... net-auto-wireless ...)<br />
</nowiki>}}<br />
<br />
And specify the desired wireless interface with the {{ic|WIRELESS_INTERFACE}} variable in {{ic|/etc/conf.d/netcfg}}:<br />
<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
WIRELESS_INTERFACE="wlan0"<br />
</nowiki>}}<br />
<br />
It is also possible to define a list of wireless networks that should be automatically connected with the {{ic|AUTO_PROFILES}} variable in {{ic|/etc/conf.d/netcfg}}. If {{ic|AUTO_PROFILES}} is not set, all wireless networks will be tried.<br />
<br />
Additionally, the {{Pkg|wpa_actiond}} package is required. Note that {{ic|wireless-wpa-config}} profiles do not work with {{ic|net-auto-wireless}}. Convert them to {{ic|wireless-wpa-configsection}} instead.<br />
<br />
===net-auto-wired===<br />
'''{{ic|net-auto-wired}} allows users to automatically connect to wired networks.'''<br />
<br />
To enable this feature, users must [[pacman|install]] {{Pkg|ifplugd}}, then add {{ic|net-auto-wired}} to the {{ic|DAEMONS}} array in {{ic|/etc/rc.conf}} and specify the desired wired interface with the {{ic|WIRED_INTERFACE}} variable in {{ic|/etc/conf.d/netcfg}}:<br />
<br />
{{hc|/etc/rc.conf|<nowiki><br />
DAEMONS=(... net-auto-wired ...)<br />
</nowiki>}}<br />
{{hc|/etc/conf.d/netcfg|<nowiki><br />
WIRED_INTERFACE="eth0"<br />
</nowiki>}}<br />
<br />
The daemon starts an {{ic|ifplugd}} process which runs {{ic|/etc/ifplugd/netcfg.action}} when the status of the wired interface changes (e.g. a cable is plugged in or unplugged). On plugging in a cable, attempts are made to start any profiles with {{ic|CONNECTION <nowiki>=</nowiki> "ethernet"}} or {{ic|"ethernet-iproute"}} and {{ic|INTERFACE <nowiki>=</nowiki> WIRED_INTERFACE}} until one of them succeeds.<br />
<br />
{{Note|DHCP profiles are tried before static ones, which could lead to undesired results in some cases. However, one can tell netcfg to prefer a particular interface by adding {{ic|1=AUTO_WIRED=1}} to the desired profile.}}<br />
<br />
{{Note|The {{ic|net-auto-wired}} daemon cannot start multiple ifplugd processes for multiple interfaces (unlike ifplugd's own {{ic|/etc/rc.d/ifplugd}} which can).}}<br />
<br />
<br />
===systemd support===<br />
Since version 2.8.2 {{Pkg|netcfg}} provides systemd unit files. The service files {{ic|net-auto-wireless.service}} and {{ic|net-auto-wired.service}} correspond to the {{Pkg|initscripts}} daemons {{ic|/etc/rc.d/net-auto-wireless}} and {{ic|/etc/rc.d/net-auto-wired}}. To connect to multiple profiles at boot you can use {{ic|netcfg.service}} which is equivalent to {{ic|/etc/rc.d/net-profiles}} and starts all profiles specified in the {{ic|NETWORKS}} array in {{ic|/etc/conf.d/netcfg}}. These service files can be enabled and started with {{ic|systemctl}} as usual.<br />
<br />
Alternatively you can use the template service file {{ic|netcfg@.service}} that allows you to connect to a single profile on boot without having to specify it in {{ic|/etc/conf.d/netcfg}}. To specify the desired profile, create a corresponding symlink to {{ic|/etc/systemd/system/multi-user.target.wants}}:<br />
# ln -s /usr/lib/systemd/system/netcfg@.service /etc/systemd/system/multi-user.target.wants/netcfg@<profile-name>.service<br />
<br />
==Tips and tricks==<br />
<br />
===Passing arguments to iwconfig before connecting===<br />
Simply add the following to a profile:<br />
<br />
IWCONFIG="<arguments>"<br />
<br />
Where {{ic|<arguments>}} can be any valid {{ic|iwconfig}} argument. The script then runs {{ic|iwconfig $INTERFACE $IWCONFIG}}.<br />
<br />
For example, force the card to register to a specific access point given by MAC address:<br />
IWCONFIG="ap 12:34:56:78:90:12"<br />
<br />
This supersedes the {{ic|IWOPTS}} and {{ic|WEP_OPTS}} options which were incompletely implemented.<br />
<br />
===rfkill (enable/disable radio power)===<br />
netcfg can enable/disable radio for wireless cards equipped with software control of radio. For wireless cards with hardware switches, netcfg can detect disabled hardware switches and fail accordingly.<br />
<br />
To enable rfkill support, you need to specify what sort of switch the wireless interface has; hardware or software. This can be set within a profile or at the interface level ({{ic|/etc/network.d/interfaces/$INTERFACE}}; see [[#Per-interface configuration]]). <br />
<br />
RFKILL=soft # can be either 'hard' or 'soft'<br />
<br />
For some kill switches the rfkill entry in {{ic|/sys}} is not linked to the interface and the {{ic|RFKILL_NAME}} variable needs to be set to the contents of the matching {{ic|/sys/class/rfkill/rfkill#/name}}.<br />
<br />
For example, on an Eee PC:<br />
<br />
RFKILL=soft<br />
RFKILL_NAME='eeepc-wlan'<br />
<br />
On a mid-2011 Thinkpad:<br />
<br />
RFKILL=hard<br />
RFKILL_NAME='phy0'<br />
<br />
{{Note|The {{ic|net-auto-wireless}} daemon requires an interface level configuration of rfkill or it will not start.}}<br />
<br />
{{Warning|Some devices (at least few SiS cards) can create {{Ic|/sys/class/rfkill/rfkill#}} entries with different names on every switch. Something like this will work in such cases (wifi-only solution!):<br />
{{hc|/etc/network.d/interfaces/wlan0|<nowiki><br />
RFKILL=hard<br />
RFKILL_NAME=`cat /sys/class/rfkill/rfkill*/name 2> /dev/null || echo ""`</nowiki>}}}}<br />
<br />
===Execute commands before/after interface up/down===<br />
If your interface requires special actions prior/after the establishment/closure of a connection, you may use the {{ic|PRE_UP}}, {{ic|POST_UP}}, {{ic|PRE_DOWN}}, and {{ic|POST_DOWN}} variables.<br />
<br />
For example, if you want to configure your wireless card to operate in ad-hoc mode but you can only change modes when the interface is down, you could use something like this:<br />
<br />
PRE_UP="ip link set wlan0 down; iwconfig wlan0 mode ad-hoc"<br />
<br />
Or if you want to mount your network shares after a successful connection, you could use:<br />
<br />
POST_UP="sleep 5; mount /mnt/shares/nexus/utorrent 2>/dev/null"<br />
<br />
Sometimes you may want to run something from netcfg with another user:<br />
<br />
POST_UP="su -c '/you/own/command' username"<br />
<br />
{{Note|If the commands specified in these properties return anything other than 0 (success), netcfg aborts the current operation. So if you want to mount a certain network share that might not be available at the time of connection (thus returning an error), you could create a separate [[Bash]] script with the mount commands and a {{ic|exit 0}} at the end. Alternatively you can add {{ic|<nowiki>|| true</nowiki>}} to the end of the command that may fail.}}<br />
<br />
===Intermittent Connection Failure===<br />
Some driver+hardware combinations drop associations sometimes. Use the pre and post commands to add/remove the driver and use a script like the following to fix the current connection:<br />
<br />
{{hc|/usr/local/bin/netcfgd|<nowiki><br />
#!/bin/bash<br />
log() { logger -t "$( basename $0 )" "$*" ; }<br />
<br />
main() {<br />
local host<br />
while sleep 1; do<br />
[[ "$( netcfg current )" = "" ]] && continue<br />
<br />
host=$( route -n | awk '/^0.0.0.0/ { print $2 }' )<br />
ping -c1 -w10 $host && continue<br />
<br />
log "trying to reassociate"<br />
wpa_cli reassociate<br />
ping -c1 -w10 $host && continue<br />
<br />
log "reassociate failed, reconfiguring network"<br />
netcfg -r $( netcfg current )<br />
done<br />
}<br />
<br />
exec 1>/dev/null<br />
[[ $EUID != 0 ]] && { log "must be root"; exit 1; }<br />
<br />
for cmd in wpa_cli ping netcfg; do<br />
! which $cmd && {<br />
log "can't find command ${cmd}, exiting..."<br />
exit 1<br />
}<br />
done<br />
<br />
log 'starting...'<br />
main <br />
<br />
</nowiki>}}<br />
<br />
===Per-interface configuration===<br />
Configuration options that apply to all profiles using an interface can be set using {{ic|/etc/network.d/interfaces/$INTERFACE}}. For example:<br />
<br />
/etc/network.d/interfaces/wlan0<br />
<br />
This is useful for {{ic|wpa_supplicant}} options, rfkill switch support, pre/post up/down scripts and {{ic|net-auto-wireless}}. These options are loaded ''before'' profiles so that any profile-based options will take priority.<br />
<br />
{{ic|/etc/network.d/interfaces/$INTERFACE}} may contain any valid profile option, though you are likely to use {{ic|PRE_UP}}/{{ic|DOWN}} and {{ic|POST_UP}}/{{ic|DOWN}} (described in the previous section) or one of the options listed below. Remember that these options are set for ''all'' profiles using the interface; you probably do not want to connect to your work VPN here, for instance, as it will try to connect on ''every'' wireless network!<br />
<br />
WPA_GROUP - Setting the group of the wpa_ctrl interface<br />
WPA_COUNTRY - Enforces local regulatory limitations and allows use of more channels<br />
WPA_DRIVER - Defaults to wext, may want nl80211 for mac80211 devices<br />
<br />
{{Note|{{ic|POST_UP}}/{{ic|POST_DOWN}} require the {{Pkg|wpa_actiond}} package.}}<br />
<br />
===Output hooks===<br />
netcfg has limited support to load hooks that handle output. By default it loads the {{ic|arch}} hook which provides the familiar output that you see. A syslog logging hook is also included. These can be found at {{ic|/usr/lib/network/hooks}}.<br />
<br />
===ArchAssistant (GUI)===<br />
<br />
A Qt-based netcfg front-end called ArchAssistant exists. It proposes to manage and connect/disconnect profiles from a system tray icon. Automatic wireless detection is also available. This tool is particularly useful for laptop users.<br />
<br />
Links:<br />
<br />
* {{AUR|archassistant}} in the [[Arch User Repository|AUR]]<br />
* [http://www.kde-apps.org/content/show.php/ArchAssistant?content=76760 archassistant on kde-apps.org] <br />
<br />
There is also a relatively new GUI for netcfg on qt-apps.org that does only network configuration. You can find it [http://www.qt-apps.org/content/show.php/netcfgGUI?content=99523 here].<br />
<br />
===wifi-select===<br />
<br />
There is a console tool for selecting wireless networks in "real-time" (in [[NetworkManager]] fashion) called {{Pkg|wifi-select}}. The tool is convenient for use in Internet cafés or other places you are visiting for the first (and maybe the last) time. With this tool, you do not need to create a profile for a new network, just run {{ic|wifi-select wlan0}} as root and choose the desired network. <br />
<br />
The tool is currently packaged as {{Pkg|wifi-select}} and is available in the [[Official Repositories|official repositories]].<br />
<br />
{{Pkg|wifi-select}} does the following:<br />
* parses {{ic|iwlist scan}} results and presents a list of networks along with their security settings (WPA/WEP/none) using {{Pkg|dialog}}<br />
* if user selects network with existing profile -- just use this profile to connect with {{Pkg|netcfg}}<br />
* if user selects a new network (for example, a Wi-Fi hotspot), {{Pkg|wifi-select}} automatically generates a new profile with corresponding {{ic|$SECURITY}} and asks for the key (if needed). It uses DHCP as {{ic|$IP}} by default<br />
* then, if the connection succeeds, the profile is saved for later usage<br />
* if the connection fails, the user is asked if he or she wants to keep generated profile for further usage (for example to change {{ic|$IP}} to static or adjust some additional options)<br />
<br />
Links: <br />
<br />
* [https://bbs.archlinux.org/viewtopic.php?id=63973 Forum thread] related to development of {{Pkg|wifi-select}}<br />
* [http://hg.horna.org.ua/wifi-select/ wifi-select Mercurial repository]<br />
* [https://github.com/sphynx/wifi-select wifi-select on GitHub]<br />
<br />
{{Note|Latest version of netcfg will provide '''wifi-menu''' with functionality equal to that of wifi-select.}}<br />
<br />
===Passing arguments to dhcpcd===<br />
<br />
For example, add<br />
DHCP_OPTIONS='-C resolv.conf -G'<br />
to the desired profile. The above example prevents {{Pkg|dhcpcd}} from writing to {{ic|/etc/resolv.conf}} and setting any default routes.<br />
<br />
====Speed up DHCP with dhcpcd====<br />
<br />
By default, {{ic|dhcpcd}} confirms that the assigned IP address is not already taken via ARP. If you are confident that it will not be, e.g. in your home network, you can speed up the connection process by about 5 seconds by adding {{ic|--noarp}} to {{ic|DHCP_OPTIONS}}:<br />
<br />
DHCP_OPTIONS="--noarp"<br />
<br />
If you never want {{ic|dhcpcd}} to perform this check for any connection, you can globally configure this by adding the following line to {{ic|/etc/dhcpcd.conf}}:<br />
<br />
noarp<br />
<br />
===Using dhclient instead of dhcpcd===<br />
<br />
To use {{Pkg|dhclient}} instead of {{Pkg|dhcpcd}}, simply add {{ic|DHCLIENT<nowiki>=</nowiki>yes}} to the desired profile.<br />
<br />
===Configuring a bridge for use with virtual machines (VMs)===<br />
To configure a bridge named br0 with a static IP:<br />
{{hc|/etc/network.d/br0|<nowiki><br />
INTERFACE="br0"<br />
CONNECTION="bridge"<br />
DESCRIPTION="bridge br0 static"<br />
BRIDGE_INTERFACES="eth0"<br />
IP='static'<br />
ADDR='10.0.0.10'<br />
GATEWAY='10.0.0.1'<br />
DNS='10.0.0.1'<br />
</nowiki>}}<br />
<br />
To configure a bridge named br0 with a dhcp IP:<br />
{{hc|/etc/network.d/br0|<nowiki><br />
INTERFACE="br0"<br />
CONNECTION="bridge"<br />
DESCRIPTION="bridge br0 dhcp"<br />
BRIDGE_INTERFACES="eth0"<br />
IP='dhcp'<br />
</nowiki>}}<br />
<br />
Then add the corresponding bridge name to your {{ic|NETWORKS&#61;(...)}} in {{ic|/etc/conf.d/netcfg}}.<br />
<br />
It can be brought up by calling it directly, or by restarting net-profiles.<br />
<br />
netcfg br0<br />
<br />
rc.d restart net-profiles<br />
<br />
===Adding multiple IP addresses to one interface===<br />
If you want to assign multiple IP addresses to 1 specific interface, this can be done by issuing the relevant {{ic|ip}} command in a {{ic|POST_UP}} statement (which as the name suggests will be executed after the interface has been brought up). Multiple statements can be separated with a {{ic|;}}. So if you for example would want to assign both 10.0.0.1 and 10.0.0.2 to interface eth0; the config would look something among the lines of:<br />
<br />
{{hc|/etc/network.d/multiple_ip|<nowiki><br />
INTERFACE="eth0"<br />
CONNECTION="ethernet"<br />
IP='static'<br />
ADDR='10.0.0.1'<br />
POST_UP='ip addr add 10.0.0.2/24 dev eth0'<br />
</nowiki>}}<br />
<br />
===Adding static routes===<br />
When wanting to configure static routes, this can be done by issuing the relevant {{ic|ip}} command in a {{ic|POSTUP}} statement (which as the name suggests will be executed after the interface has been brought up). Optionally, a {{ic|PRE_DOWN}} statement can be added to remove said routes when the interface is brought down. Multiple statements can be separated with a {{ic|;}}. In the below example we'll route 10.0.1.0/24 over interface eth1 and then remove the route when the interface is brought down.<br />
<br />
{{hc|/etc/network.d/static_routes|<nowiki><br />
INTERFACE="eth1"<br />
CONNECTION="ethernet"<br />
IP='static'<br />
POST_UP='ip route add 10.0.1.0/24 dev eth1'<br />
PRE_DOWN='ip route del 10.0.1.0/24 dev eth1'<br />
</nowiki>}}<br />
<br />
==Troubleshooting==<br />
<br />
===Debugging===<br />
To run netcfg with debugging output, set the {{ic|NETCFG_DEBUG}} environment variable to {{ic|"yes"}}, for example:<br />
<br />
# NETCFG_DEBUG="yes" netcfg <arguments><br />
<br />
Debugging information for wpa_supplicant can be logged using {{ic|WPA_OPTS}} within a profile, for example:<br />
<br />
WPA_OPTS="-f/path/to/log"<br />
<br />
Whatever is entered here will be added to the command when {{ic|wpa_supplicant}} is called.<br />
<br />
===Network unavailable===<br />
This error is typically due to:<br />
* Out of range; or<br />
* Driver issue.<br />
<br />
===Wireless association failed===<br />
This error is typically due to:<br />
* Out of range/reception;<br />
* Incorrect configuration;<br />
* Invalid key;<br />
* Driver problem; or<br />
* Trying to connect to a hidden network.<br />
<br />
If the connection problem is due to poor reception, increase the {{ic|TIMEOUT}} variable in {{ic|/etc/network.d/mynetwork}}, such as:<br />
TIMEOUT=60<br />
<br />
If an AP with a hidden SSID is used, try:<br />
PRE_UP='iwconfig $INTERFACE essid $ESSID'<br />
<br />
===Unable to get IP address with DHCP===<br />
This error is typically due to:<br />
* Out of range/reception<br />
<br />
Try increasing {{ic|DHCP_TIMEOUT}} variable in your network {{ic|/etc/network.d/profile}}.<br />
<br />
===Not a valid connection, check spelling or look at examples===<br />
You must set {{ic|CONNECTION}} to one of the connection types listed in the {{ic|/usr/lib/network/connections}} directory. Alternatively, use one of the provided configuration examples in {{ic|/etc/network.d/examples}}.<br />
<br />
===No Connection===<br />
If you get a set of debug messages similar to the following (remembering that profile names and interface names may be different), it could be that the process of bringing up the interface is taking too long. <br />
<br />
DEBUG: Loading profile eth0-dhcp<br />
DEBUG: Configuring interface eth0<br />
:: eth0-dhcp up<br />
DEBUG: status reported to profile_up as:<br />
DEBUG: Loading profile eth0-dhcp<br />
DEBUG: Configuring interface eth0<br />
DEBUG: ethernet_iproute_up ifup<br />
> No connection<br />
DEBUG: profile_up connect failed<br />
[FAIL]<br />
<br />
The default is 2 seconds.<br />
To lengthen the timeout, set the CARRIER_TIMEOUT variable before calling netcfg.<br />
<br />
This thread shows one example of this issue:<br />
https://bbs.archlinux.org/viewtopic.php?id=138615<br />
<br />
===Driver quirks===<br />
{{Note|You most likely do '''not''' need quirks; ensure your configuration is correct before considering them. Quirks are intended for a small range of drivers with unusual issues, many of them older versions. These are workarounds, not solutions.}}<br />
<br />
Some drivers behave oddly and need workarounds to connect. Quirks must be enabled manually. They are best determined by reading the forums, seeing what others have used, and, if that fails, trial and error. Quirks can be combined.<br />
<br />
; {{ic|prescan}}: Run {{ic|iwlist $INTERFACE scan}} before attempting to connect (Broadcom)<br />
; {{ic|preessid}}: Run {{ic|iwconfig $INTERFACE essid $ESSID}} before attempting to connect (ipw3945, Broadcom and Intel PRO/Wireless 4965AGN)<br />
; {{ic|wpaessid}}: Same as previous, run before starting {{ic|wpa_supplicant}}. Not supported anymore - use {{ic|1=IWCONFIG="essid $ESSID"}} instead. (ath9k)<br />
; {{ic|predown}}: Take interface down before association and then restore it after (madwifi)<br />
; {{ic|postsleep}}: Sleep one second before checking if the association was successful<br />
; {{ic|postscan}}: Run {{ic|iwlist scan}} after associating <br />
<br />
Add the required quirks to the netcfg configuration file {{ic|/etc/network.d/mynetwork}}, for example:<br />
QUIRKS=(prescan preessid)<br />
<br />
If you receive "Wireless network not found", "Association failed" errors and have tried the above, or if an AP with a hidden SSID is used, see the above section [[#Wireless association failed]].<br />
<br />
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===<br />
There is no plans to add WPA support to these drivers. rt2x00 is supported, however, and will replace these.<br />
<br />
If you must use them, create a shell script that runs the needed {{ic|iwpriv}} commands and put its path in {{ic|PRE_UP}}.<br />
<br />
===find: "/var/run/network//suspend/": No such file or directory===<br />
If you get this error message, then do not bother because it is a known bug. Create the directory by hand.<br />
<br />
===It still does not work, what do I do?===<br />
If this article did not help solve your problem, the next best places to ask for help are the forums, the mailing list, and the #archlinux IRC channel.<br />
<br />
To be able to determine the problem, we need information. When you ask, provide the following output:<br />
* '''ALL OUTPUT FROM netcfg'''<br />
** This is absolutely crucial to be able determine what went wrong. The message might be short or non-existent, but it can mean a great deal. <br />
* '''{{ic|/etc/network.d}} network profiles'''<br />
** This is also crucial as many problems are simple configuration issues. Feel free to censor your wireless key.<br />
* '''netcfg version'''<br />
* {{ic|lsmod}}<br />
* {{ic|iwconfig}}<br />
<br />
==FAQ==<br />
{{FAQ<br />
|question=Why doesn't netcfg do ''(some feature)''?<br />
|answer=netcfg does not need to; it connects to networks. netcfg is modular and re-usable; see {{ic|/usr/lib/network}} for re-usable functions for custom scripts.}}<br />
<br />
{{FAQ<br />
|question=Why doesn't netcfg behave in ''this'' way?<br />
|answer=netcfg does not enforce any rules; it connects to networks. netcfg does not impose any heuristics, like "disconnect from wireless if Ethernet is connected". If you want behavior like that, it should be simple to write a separate tool on top of netcfg. See the question above.}}<br />
<br />
{{FAQ<br />
|question=Do I still need ''(some thing)'' if I am using netcfg?<br />
|answer=This question usually references {{ic|/etc/hosts}} and the {{ic|HOSTNAME}} variable in {{ic|/etc/rc.conf}}, which are both still required. You may remove {{ic|network}} from the {{ic|DAEMONS}} array if you have configured all of your networks with netcfg, though.}}</div>Gabuzohttps://wiki.archlinux.org/index.php?title=OpenLDAP&diff=211336OpenLDAP2012-06-27T08:25:49Z<p>Gabuzo: /* References */</p>
<hr />
<div>[[Category:Networking]]<br />
OpenLDAP, LDAP & Directory services are an enormous topic. Configuration is therefore complex. This page is a starting point for a basic openldap install on Archlinux and a sanity check. <br />
<br />
<br />
==== References ====<br />
<br />
http://www.openldap.org/doc/admin24/<br />
<br />
==== For the newbies ====<br />
<br />
If you are totally new to those concepts, here is an good introduction that is easy to understand and that will get you started, even if you are new to everything LDAP.<br />
<br />
http://www.brennan.id.au/20-Shared_Address_Book_LDAP.html<br />
<br />
<br />
=== Install OpenLDAP ===<br />
<br />
This part is easy:<br />
pacman -S openldap <br />
<br />
The openldap package basically contains two things: The LDAP server (slapd) and the LDAP client. You will probably want to run the server on your computer. After you design the directory, the server will be able to provide authentication services for LDAP clients. It is quite likely that you will run services requiring the LDAP authentication on that very computer, in which case the LDAP client will query the LDAP server from the same package.<br />
<br />
==== Configure OpenLDAP ====<br />
<br />
===== The server (slapd) =====<br />
<br />
First prepare the database directory. You will need to copy the default config file and set the proper ownership.<br />
<br />
WARNING!!! - The following snippet wipes out any existing ldap database.<br />
<br />
rm -rf /var/lib/openldap/openldap-data/*<br />
cp /etc/openldap/DB_CONFIG.example /var/lib/openldap/openldap-data/DB_CONFIG<br />
chown ldap:ldap /var/lib/openldap/openldap-data/DB_CONFIG<br />
<br />
Next we prepare slapd.conf<br />
====== /etc/openldap/slapd.conf ======<br />
Add some typically used schemas...<br />
{{bc|<br />
include /etc/openldap/schema/cosine.schema<br />
include /etc/openldap/schema/nis.schema<br />
include /etc/openldap/schema/inetorgperson.schema<br />
}}<br />
Edit the suffix. Typically this is your domain name but it does not have to be. It depends on how you use your directory. We will use 'example' for the domain name, and 'com' for the tld. Also set your ldap administrators name (we'll use 'root' here)<br />
{{bc|<nowiki><br />
suffix "dc=example,dc=com"<br />
rootdn "cn=root,dc=example,dc=com"<br />
</nowiki>}}<br />
<br />
Now we delete the default root password and create a strong one:<br />
#find the line with rootpw and delete it<br />
sed -i "/rootpw/ d" slapd.conf<br />
#add a line which includes the hashed password output from slappasswd<br />
echo "rootpw $(slappasswd)" >> slapd.conf<br />
<br />
ldap won't find things unless you index them. Read the [http://www.zytrax.com/books/ldap/ch6/#index ldap documentation] for details, you can use the following to start with. (add them to your {{ic|slapd.conf}})<br />
{{bc|<br />
index uid pres,eq<br />
index mail pres,sub,eq<br />
index cn pres,sub,eq<br />
index sn pres,sub,eq<br />
index dc eq<br />
}}<br />
<br />
'''Note: '''<br />
<br />
Don't forget to run {{ic|slapindex}} after you populate your directory. (slapd needs to be stopped to do this). Then change the ownership for all the generated files:<br />
chown ldap.ldap /var/lib/openldap/openldap-data/*<br />
<br />
If you want to use SSL, you have to specify a path to your certificates here. See [[OpenLDAP Authentication]]<br />
<br />
Finally you can start the slapd daemon.<br />
#rc.d start slapd<br />
<br />
====== /etc/conf.d/slapd ======<br />
Very important, you define here on which port the server should listen and if you want to use SSL, you will want to use the ldaps:// URI instead of the default ldap:// <br />
You can also specify additional slapd options here.<br />
<br />
<br />
===== The client =====<br />
The client is usually not such a big deal, just keep in mind that your apps that require LDAP auth use it, so if something goes wrong with LDAP, do not waste your time with the app, start debugging the client instead.<br />
<br />
The client config file is located at /etc/openldap/ldap.conf<br />
It is actually very simple. <br />
<br />
If you decide to use SSL:<br />
* The protocol (ldap or ldaps) in the URI entry has to conform with the slapd configuration <br />
* If you decide to use self-signed certificates, you have to add them to TLS_CACERT<br />
<br />
==== Test your new OpenLDAP installation ====<br />
<br />
This is easy, just run the command below:<br />
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts<br />
<br />
you should see some information on your database.<br />
== Next Steps ==<br />
<br />
You now have a basic ldap installation. The step is to design your directory. The design is heavily dependent on what you are using it for. If you are new to ldap, consider starting with a directory design recommended by the specific client services that will use the directory (PAM, Postfix, etc).<br />
<br />
A directory for system authentication is the [[LDAP Authentication]] article.<br />
<br />
== Troubleshooting ==<br />
If you notice that slapd seems to start but then stops, you may have a permission issue with the ldap datadir. Try running:<br />
<br />
# chown ldap:ldap /var/lib/openldap/openldap-data/*<br />
<br />
to allow slapd write access to its data directory as the user "ldap"</div>Gabuzohttps://wiki.archlinux.org/index.php?title=OpenLDAP&diff=211335OpenLDAP2012-06-27T07:16:35Z<p>Gabuzo: /* /etc/openldap/slapd.conf */</p>
<hr />
<div>[[Category:Networking]]<br />
OpenLDAP, LDAP & Directory services are an enormous topic. Configuration is therefore complex. This page is a starting point for a basic openldap install on Archlinux and a sanity check. <br />
<br />
<br />
==== References ====<br />
<br />
http://aqua.subnet.at/~max/ldap/<br />
<br />
http://www.openldap.org/doc/admin24/<br />
<br />
==== For the newbies ====<br />
<br />
If you are totally new to those concepts, here is an good introduction that is easy to understand and that will get you started, even if you are new to everything LDAP.<br />
<br />
http://www.brennan.id.au/20-Shared_Address_Book_LDAP.html<br />
<br />
<br />
=== Install OpenLDAP ===<br />
<br />
This part is easy:<br />
pacman -S openldap <br />
<br />
The openldap package basically contains two things: The LDAP server (slapd) and the LDAP client. You will probably want to run the server on your computer. After you design the directory, the server will be able to provide authentication services for LDAP clients. It is quite likely that you will run services requiring the LDAP authentication on that very computer, in which case the LDAP client will query the LDAP server from the same package.<br />
<br />
==== Configure OpenLDAP ====<br />
<br />
===== The server (slapd) =====<br />
<br />
First prepare the database directory. You will need to copy the default config file and set the proper ownership.<br />
<br />
WARNING!!! - The following snippet wipes out any existing ldap database.<br />
<br />
rm -rf /var/lib/openldap/openldap-data/*<br />
cp /etc/openldap/DB_CONFIG.example /var/lib/openldap/openldap-data/DB_CONFIG<br />
chown ldap:ldap /var/lib/openldap/openldap-data/DB_CONFIG<br />
<br />
Next we prepare slapd.conf<br />
====== /etc/openldap/slapd.conf ======<br />
Add some typically used schemas...<br />
{{bc|<br />
include /etc/openldap/schema/cosine.schema<br />
include /etc/openldap/schema/nis.schema<br />
include /etc/openldap/schema/inetorgperson.schema<br />
}}<br />
Edit the suffix. Typically this is your domain name but it does not have to be. It depends on how you use your directory. We will use 'example' for the domain name, and 'com' for the tld. Also set your ldap administrators name (we'll use 'root' here)<br />
{{bc|<nowiki><br />
suffix "dc=example,dc=com"<br />
rootdn "cn=root,dc=example,dc=com"<br />
</nowiki>}}<br />
<br />
Now we delete the default root password and create a strong one:<br />
#find the line with rootpw and delete it<br />
sed -i "/rootpw/ d" slapd.conf<br />
#add a line which includes the hashed password output from slappasswd<br />
echo "rootpw $(slappasswd)" >> slapd.conf<br />
<br />
ldap won't find things unless you index them. Read the [http://www.zytrax.com/books/ldap/ch6/#index ldap documentation] for details, you can use the following to start with. (add them to your {{ic|slapd.conf}})<br />
{{bc|<br />
index uid pres,eq<br />
index mail pres,sub,eq<br />
index cn pres,sub,eq<br />
index sn pres,sub,eq<br />
index dc eq<br />
}}<br />
<br />
'''Note: '''<br />
<br />
Don't forget to run {{ic|slapindex}} after you populate your directory. (slapd needs to be stopped to do this). Then change the ownership for all the generated files:<br />
chown ldap.ldap /var/lib/openldap/openldap-data/*<br />
<br />
If you want to use SSL, you have to specify a path to your certificates here. See [[OpenLDAP Authentication]]<br />
<br />
Finally you can start the slapd daemon.<br />
#rc.d start slapd<br />
<br />
====== /etc/conf.d/slapd ======<br />
Very important, you define here on which port the server should listen and if you want to use SSL, you will want to use the ldaps:// URI instead of the default ldap:// <br />
You can also specify additional slapd options here.<br />
<br />
<br />
===== The client =====<br />
The client is usually not such a big deal, just keep in mind that your apps that require LDAP auth use it, so if something goes wrong with LDAP, do not waste your time with the app, start debugging the client instead.<br />
<br />
The client config file is located at /etc/openldap/ldap.conf<br />
It is actually very simple. <br />
<br />
If you decide to use SSL:<br />
* The protocol (ldap or ldaps) in the URI entry has to conform with the slapd configuration <br />
* If you decide to use self-signed certificates, you have to add them to TLS_CACERT<br />
<br />
==== Test your new OpenLDAP installation ====<br />
<br />
This is easy, just run the command below:<br />
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts<br />
<br />
you should see some information on your database.<br />
== Next Steps ==<br />
<br />
You now have a basic ldap installation. The step is to design your directory. The design is heavily dependent on what you are using it for. If you are new to ldap, consider starting with a directory design recommended by the specific client services that will use the directory (PAM, Postfix, etc).<br />
<br />
A directory for system authentication is the [[LDAP Authentication]] article.<br />
<br />
== Troubleshooting ==<br />
If you notice that slapd seems to start but then stops, you may have a permission issue with the ldap datadir. Try running:<br />
<br />
# chown ldap:ldap /var/lib/openldap/openldap-data/*<br />
<br />
to allow slapd write access to its data directory as the user "ldap"</div>Gabuzohttps://wiki.archlinux.org/index.php?title=PhpLDAPadmin&diff=204293PhpLDAPadmin2012-06-09T17:16:11Z<p>Gabuzo: /* Configuration */</p>
<hr />
<div>[[Category:Web Server]]<br />
==Pre-Installation==<br />
<br />
See [[LAMP]] for a guide to setting up Apache, MySQL, and PHP.<br />
<br />
==Adding php-ldap==<br />
<br />
PHP needs the php-ldap extension to work with [http://phpldapadmin.sourceforge.net/ phpLDAPadmin]<br />
<br />
<pre><br />
pacman -S php-ldap<br />
</pre><br />
<br />
then edit {{ic|/etc/php/php.ini}} and uncomment the line<br />
<br />
<pre><br />
;extension=ldap.so<br />
</pre><br />
<br />
by removing the ";" so it will look like this<br />
<br />
<pre><br />
extension=ldap.so<br />
</pre><br />
<br />
Now add<br />
<br />
<pre><br />
:/usr/share/webapps/phpldapadmin/lib/<br />
</pre><br />
<br />
to the "open_basedir" line.<br />
<br />
==Installation==<br />
<br />
Simply do<br />
<br />
<pre><br />
pacman -S phpldapadmin<br />
</pre><br />
<br />
==Configuration==<br />
<br />
phpLDAPadmin comes with a usable configuration file located at:<br />
<br />
<pre><br />
/etc/webapps/phpldapadmin/config.php<br />
</pre><br />
<br />
Although not strictly neccessary you can edit {{ic|config.php}} and name your server with the line <br />
<br />
<pre><br />
$servers->setValue('server','host','127.0.0.1');<br />
</pre><br />
<br />
phpLDAPadmin now installs to {{ic|/usr/share/webapps}}. This means some changes to the configuration are required.<br />
<br />
Copy the configuration file as follows:<br />
<br />
<pre><br />
sudo cp /etc/webapps/phpldapadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpldapadmin.conf<br />
</pre><br />
<br />
It should look like this:<br />
<br />
<pre><br />
Alias /phpldapadmin "/usr/share/webapps/phpldapadmin"<br />
<Directory "/usr/share/webapps/phpldapadmin"><br />
AllowOverride All<br />
Options FollowSymlinks<br />
Order allow,deny<br />
Allow from all<br />
php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/usr/share/pear/"<br />
</Directory><br />
</pre><br />
<br />
{{Note|If you are getting 403 errors, make sure the 'A' is correct case: ''phpldapadmin'' instead of ''phpldapAdmin''.}}<br />
<br />
Add the following lines to {{ic|/etc/httpd/conf/httpd.conf}}:<br />
<br />
<pre><br />
# phpldapadmin configuration<br />
Include conf/extra/httpd-phpldapadmin.conf<br />
</pre><br />
<br />
Edit {{ic|/usr/share/webapps/phpldapadmin/.htaccess}} and comment out deny from all, otherwise you will receive a 403 access denied error. It should look like this:<br />
<br />
<pre><br />
#deny from all<br />
</pre><br />
<br />
==Accessing your phpMyAdmin installation==<br />
<br />
Finally your phpLDAPadmin installation is complete. Before start using it you need to restart your apache server by following command:<br />
<br />
<pre><br />
# /etc/rc.d/httpd restart<br />
</pre><br />
<br />
You can access your phpLDAPadmin installation using the following url:<br />
<br />
<pre><br />
http://serverip/phpldapadmin<br />
or<br />
http://localhost/phpldapadmin<br />
</pre><br />
<br />
Note: 'localhost' is the hostname in your {{ic|/etc/rc.conf}} file.</div>Gabuzohttps://wiki.archlinux.org/index.php?title=OpenLDAP&diff=204284OpenLDAP2012-06-09T15:54:51Z<p>Gabuzo: Changing generated files ownership</p>
<hr />
<div>[[Category:Networking]]<br />
OpenLDAP, LDAP & Directory services are an enormous topic. Configuration is therefore complex. This page is a starting point for a basic openldap install on Archlinux and a sanity check. <br />
<br />
<br />
==== References ====<br />
<br />
http://aqua.subnet.at/~max/ldap/<br />
<br />
http://www.openldap.org/doc/admin24/<br />
<br />
==== For the newbies ====<br />
<br />
If you are totally new to those concepts, here is an good introduction that is easy to understand and that will get you started, even if you are new to everything LDAP.<br />
<br />
http://www.brennan.id.au/20-Shared_Address_Book_LDAP.html<br />
<br />
<br />
=== Install OpenLDAP ===<br />
<br />
This part is easy:<br />
pacman -S openldap <br />
<br />
The openldap package basically contains two things: The LDAP server (slapd) and the LDAP client. You will probably want to run the server on your computer. After you design the directory, the server will be able to provide authentication services for LDAP clients. It is quite likely that you will run services requiring the LDAP authentication on that very computer, in which case the LDAP client will query the LDAP server from the same package.<br />
<br />
==== Configure OpenLDAP ====<br />
<br />
===== The server (slapd) =====<br />
<br />
First prepare the database directory. You will need to copy the default config file and set the proper ownership.<br />
<br />
WARNING!!! - The following snippet wipes out any existing ldap database.<br />
<br />
rm -rf /var/lib/openldap/openldap-data/*<br />
cp /etc/openldap/DB_CONFIG.example /var/lib/openldap/openldap-data/DB_CONFIG<br />
chown ldap:ldap /var/lib/openldap/openldap-data/DB_CONFIG<br />
<br />
Next we prepare slapd.conf<br />
====== /etc/openldap/slapd.conf ======<br />
Add some typically used schemas...<br />
{{bc|<br />
include /etc/openldap/schema/cosine.schema<br />
include /etc/openldap/schema/nis.schema<br />
include /etc/openldap/schema/inetorgperson.schema<br />
}}<br />
Edit the suffix. Typically this is your domain name but it does not have to be. It depends on how you use your directory. We will use 'example' for the domain name, and 'com' for the tld. Also set your ldap administrators name (we'll use 'root' here)<br />
{{bc|<nowiki><br />
suffix "dc=example,dc=com"<br />
rootdn "cn=root,dc=example,dc=com"<br />
</nowiki>}}<br />
<br />
Now we delete the default root password and create a strong one:<br />
#find the line with rootpw and delete it<br />
sed -i "/rootpw/ d" slapd.conf<br />
#add a line which includes the hashed password output from slappasswd<br />
echo "rootpw $(slappasswd)" >> slapd.conf<br />
<br />
ldap won't find things unless you index them. Read the ldap documentation for details, you can use the following to start with. (add them to your {{ic|slapd.conf}})<br />
{{bc|<br />
index uid pres,eq<br />
index mail pres,sub,eq<br />
index cn pres,sub,eq<br />
index sn pres,sub,eq<br />
index dc eq<br />
}}<br />
<br />
'''Note: '''<br />
<br />
Don't forget to run {{ic|slapindex}} after you populate your directory. (slapd needs to be stopped to do this). Then change the ownership for all the generated files:<br />
chown ldap.ldap /var/lib/openldap/openldap-data/*<br />
<br />
If you want to use SSL, you have to specify a path to your certificates here. See [[OpenLDAP Authentication]]<br />
<br />
Finally you can start the slapd daemon.<br />
#rc.d start slapd<br />
<br />
====== /etc/conf.d/slapd ======<br />
Very important, you define here on which port the server should listen and if you want to use SSL, you will want to use the ldaps:// URI instead of the default ldap:// <br />
You can also specify additional slapd options here.<br />
<br />
<br />
===== The client =====<br />
The client is usually not such a big deal, just keep in mind that your apps that require LDAP auth use it, so if something goes wrong with LDAP, do not waste your time with the app, start debugging the client instead.<br />
<br />
The client config file is located at /etc/openldap/ldap.conf<br />
It is actually very simple. <br />
<br />
If you decide to use SSL:<br />
* The protocol (ldap or ldaps) in the URI entry has to conform with the slapd configuration <br />
* If you decide to use self-signed certificates, you have to add them to TLS_CACERT<br />
<br />
==== Test your new OpenLDAP installation ====<br />
<br />
This is easy, just run the command below:<br />
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts<br />
<br />
you should see some information on your database.<br />
== Next Steps ==<br />
<br />
You now have a basic ldap installation. The step is to design your directory. The design is heavily dependent on what you are using it for. If you are new to ldap, consider starting with a directory design recommended by the specific client services that will use the directory (PAM, Postfix, etc).<br />
<br />
A directory for system authentication is the [[LDAP Authentication]] article.<br />
<br />
== Troubleshooting ==<br />
If you notice that slapd seems to start but then stops, you may have a permission issue with the ldap datadir. Try running:<br />
<br />
# chown ldap:ldap /var/lib/openldap/openldap-data/*<br />
<br />
to allow slapd write access to its data directory as the user "ldap"</div>Gabuzohttps://wiki.archlinux.org/index.php?title=OpenLDAP&diff=204282OpenLDAP2012-06-09T15:41:47Z<p>Gabuzo: Error with config file during slapadd if the "\" sign is present</p>
<hr />
<div>[[Category:Networking]]<br />
OpenLDAP, LDAP & Directory services are an enormous topic. Configuration is therefore complex. This page is a starting point for a basic openldap install on Archlinux and a sanity check. <br />
<br />
<br />
==== References ====<br />
<br />
http://aqua.subnet.at/~max/ldap/<br />
<br />
http://www.openldap.org/doc/admin24/<br />
<br />
==== For the newbies ====<br />
<br />
If you are totally new to those concepts, here is an good introduction that is easy to understand and that will get you started, even if you are new to everything LDAP.<br />
<br />
http://www.brennan.id.au/20-Shared_Address_Book_LDAP.html<br />
<br />
<br />
=== Install OpenLDAP ===<br />
<br />
This part is easy:<br />
pacman -S openldap <br />
<br />
The openldap package basically contains two things: The LDAP server (slapd) and the LDAP client. You will probably want to run the server on your computer. After you design the directory, the server will be able to provide authentication services for LDAP clients. It is quite likely that you will run services requiring the LDAP authentication on that very computer, in which case the LDAP client will query the LDAP server from the same package.<br />
<br />
==== Configure OpenLDAP ====<br />
<br />
===== The server (slapd) =====<br />
<br />
First prepare the database directory. You will need to copy the default config file and set the proper ownership.<br />
<br />
WARNING!!! - The following snippet wipes out any existing ldap database.<br />
<br />
rm -rf /var/lib/openldap/openldap-data/*<br />
cp /etc/openldap/DB_CONFIG.example /var/lib/openldap/openldap-data/DB_CONFIG<br />
chown ldap:ldap /var/lib/openldap/openldap-data/DB_CONFIG<br />
<br />
Next we prepare slapd.conf<br />
====== /etc/openldap/slapd.conf ======<br />
Add some typically used schemas...<br />
{{bc|<br />
include /etc/openldap/schema/cosine.schema<br />
include /etc/openldap/schema/nis.schema<br />
include /etc/openldap/schema/inetorgperson.schema<br />
}}<br />
Edit the suffix. Typically this is your domain name but it does not have to be. It depends on how you use your directory. We will use 'example' for the domain name, and 'com' for the tld. Also set your ldap administrators name (we'll use 'root' here)<br />
{{bc|<nowiki><br />
suffix "dc=example,dc=com"<br />
rootdn "cn=root,dc=example,dc=com"<br />
</nowiki>}}<br />
<br />
Now we delete the default root password and create a strong one:<br />
#find the line with rootpw and delete it<br />
sed -i "/rootpw/ d" slapd.conf<br />
#add a line which includes the hashed password output from slappasswd<br />
echo "rootpw $(slappasswd)" >> slapd.conf<br />
<br />
ldap won't find things unless you index them. Read the ldap documentation for details, you can use the following to start with. (add them to your {{ic|slapd.conf}})<br />
{{bc|<br />
index uid pres,eq<br />
index mail pres,sub,eq<br />
index cn pres,sub,eq<br />
index sn pres,sub,eq<br />
index dc eq<br />
}}<br />
<br />
Note: Don't forget to run {{ic|slapindex}} after you populate your directory. (slapd needs to be stopped to do this)<br />
<br />
If you want to use SSL, you have to specify a path to your certificates here. See [[OpenLDAP Authentication]]<br />
<br />
Finally you can start the slapd daemon.<br />
#rc.d start slapd<br />
<br />
====== /etc/conf.d/slapd ======<br />
Very important, you define here on which port the server should listen and if you want to use SSL, you will want to use the ldaps:// URI instead of the default ldap:// <br />
You can also specify additional slapd options here.<br />
<br />
<br />
===== The client =====<br />
The client is usually not such a big deal, just keep in mind that your apps that require LDAP auth use it, so if something goes wrong with LDAP, do not waste your time with the app, start debugging the client instead.<br />
<br />
The client config file is located at /etc/openldap/ldap.conf<br />
It is actually very simple. <br />
<br />
If you decide to use SSL:<br />
* The protocol (ldap or ldaps) in the URI entry has to conform with the slapd configuration <br />
* If you decide to use self-signed certificates, you have to add them to TLS_CACERT<br />
<br />
==== Test your new OpenLDAP installation ====<br />
<br />
This is easy, just run the command below:<br />
ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts<br />
<br />
you should see some information on your database.<br />
== Next Steps ==<br />
<br />
You now have a basic ldap installation. The step is to design your directory. The design is heavily dependent on what you are using it for. If you are new to ldap, consider starting with a directory design recommended by the specific client services that will use the directory (PAM, Postfix, etc).<br />
<br />
A directory for system authentication is the [[LDAP Authentication]] article.<br />
<br />
== Troubleshooting ==<br />
If you notice that slapd seems to start but then stops, you may have a permission issue with the ldap datadir. Try running:<br />
<br />
# chown ldap:ldap /var/lib/openldap/openldap-data/*<br />
<br />
to allow slapd write access to its data directory as the user "ldap"</div>Gabuzohttps://wiki.archlinux.org/index.php?title=USB_Scanner_Support&diff=169293USB Scanner Support2011-11-09T09:21:18Z<p>Gabuzo: /* Configuring hotplug/udev */</p>
<hr />
<div>{{Merge|Sane}}<br />
[[Category:Imaging (English)]]<br />
===USB Scanner===<br />
<br />
This document describes the process of installing a scanner with a USB interface in Arch Linux. <br />
<br />
'''Update:''' Since I first wrote this document, the installation routine for the sane package has been improved. The only thing you have to do for supported scanners is to install sane with pacman and add your username to the "scanner" group. This document is therefore only necessary for scanners that are not listed in the default usermap file of sane, for people who are interested in hotplug configuration, or for those who are interested in network support.<br />
<br />
====Verify that your scanner works with SANE====<br />
Many but not all of the scanners on the market are supported by SANE. The best way to find out whether yours is supported is to directly check on the project's website: [http://www.sane-project.org/sane-supported-devices.html sane-supported-devices]. On this site, you will also find the information, which SANE backend you will need.<br />
For multifunction devices from Epson see [https://aur.archlinux.org/packages.php?ID=10497 iscan]<br />
====Install sane====<br />
<br />
pacman -S sane<br />
<br />
While xsane is not necessary, but the program is very useful under X, it's with gtk2 GUI.<br />
<br />
pacman -S xsane<br />
<br />
By default, '''hotplug''' has been installed on your Arch system, but if not, you can decide to install or not. However it's strongly recommended.<br />
<br />
<br />
====Get scanner to work====<br />
<br />
# Open a terminal and log in as root<br />
<br />
# Execute the program<br />
<br />
sane-find-scanner<br />
<br />
to verify that SANE correctly detects your scanner.<br />
<br />
# Get the device name of your scanner. The easiest way to find it is to use the program scanimage:<br />
<br />
scanimage -L<br />
<br />
<br />
If everythings is working, the output of this will:<br />
<br />
<code><br />
device `plustek:libusb:003:004' is a Canon N1240U/LiDE30 USB flatbed scanner<br />
</code><br />
<br />
With some HP all-in-one printer-scanner, scanimage -L may not find your hp printer-scanner. Uncommenting hpaio in /etc/sane.d/dll.conf may solve this problem.<br />
<br />
With this information, we are ready to start the test scan:<br />
<br />
scanimage -d plustek:libusb:003:004 -x 50 -y 50 --format=tiff > /home/hunzikea/test.tiff<br />
<br />
If this correctly creates a file called test.tiff with a reasonable content, we are ready to set up the scanner for the ordinary user.<br />
<br />
gpasswd -a yourusername scanner<br />
<br />
Minor remarks for some plustek scanners (noticeably Canoscan ones), they require a lock directory. Make sure that /var/lock/sane directory exists, that its permissions are 660, and that it is owned by <user>:scanner. If the directory permissions are wrong, only root will be able to use the scanner.<br />
Seems (at least on x86-64) that some programs using libusb (noticeably xsane and kooka) need scanner group rw permissions also for accessing /proc/bus/usb to work for a normal user.<br />
<br />
That's it, have fun with your scanner.<br />
<br />
====Fixing potential problems with the above====<br />
<br />
* To remedy the problem where an HP All-In-One device appears in the output of sane-find-scanner but does not appear in the output of scanimage -L, edit the file /etc/sane.d/dll.conf and uncomment the hpaio line.<br />
<br />
====Epson Perfection 1270====<br />
<br />
This is for some scanners which are listed as "good" support but you simple do not know how to make it work, here I take '''Epson Perfection 1270''' as an example.<br />
<br />
By checking the [http://www.sane-project.org/sane-supported-devices.html sane-supported-devices] page, you can find very useful information for your scanner. Here I know Epson Perfection 1270 is supported by snapscan backend.<br />
<br />
For Epson Perfection 1270, you also need a firmware named esfw3e.bin, you can get it from (anyone could give a working place so I can upload it?), or you can get it yourself by reference to [http://wiki.archlinux.org/index.php/Scanner_setup_%26_configure Scanner setup & configure]. I get it by installing the driver in the windows.<br />
<br />
Modify configuration file of snapscan backend:<br />
<br />
vi /etc/sane.d/snapscan.conf <br />
<br />
Change the firmware path line with yours. :<br />
<br />
<pre><br />
# Change to the fully qualified filename of your firmware file, if<br />
# firmware upload is needed by the scanner<br />
firmware /mnt/mydata/Backups/firmware/esfw3e.bin<br />
</pre><br />
<br />
And add the following line in the end or anywhere you like<br />
<br />
<pre><br />
# Epson Perfection 1270<br />
usb 0x04b8 0x0120<br />
</pre><br />
<br />
You can get such code information (''usb 0x04b8 0x0120'') by "sane-find-scanner" command.<br />
<br />
Also add such information lines in your libsane.usermap file to setup your privilage, like:<br />
<br />
vi /etc/hotplug/usb/libsane.usermap<br />
<br />
#Epson Perfection 1270<br />
libusbscanner 0x0003 0x04b8 0x0120 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000<br />
<br />
Replug scanner, you have a working Epson Perfection 1270 now.<br />
<br />
NOTE: I can scan image if I define the X and Y value, but without that error meassage occors like: "scanimage: sane_start: Error during device I/O", if anyone know why, please complete the section.<br />
".<br />
<br />
====Configuring hotplug/udev====<br />
<br />
'''The following hotplug configuration steps are no longer needed (with 0.6 or above), For your information only'''<br />
<br />
In this section we will use hotplug to detect when the scanner is plugged in and, as a consequence, set the permissions on the scanner device so that members of the group \"users\" can use it.<br />
<br />
# First, you will need to get the Vendor and ProdID number of your scanner. To get those, type, as root,<br />
cat /proc/bus/usb/devices<br />
or (since kernel 2.6.24 {{Filename|/proc}} is being deprecate)<br />
lsusb -v<br />
<br />
Search the output of this command for your scanner. In that block of information, you will find your scanner's Vender and ProdID numbers. In my case, the relevant output of the above command was<br />
<br />
<pre><br />
T: Bus<code>03 Lev</code>01 Prnt<code>01 Port</code>01 Cnt<code>02 Dev#</code> 4 Spd<code>12 MxCh</code> 0<br />
D: Ver<code> 1.10 Cls</code>ff(vend.) Sub<code>00 Prot</code>00 MxPS<code> 8 #Cfgs</code> 1<br />
P: Vendor<code>04a9 ProdID</code>220e Rev= 1.00<br />
S: Manufacturer=Canon<br />
S: Product=CanoScan<br />
C:* #Ifs<code> 1 Cfg#</code> 1 Atr<code>a0 MxPwr</code>500mA<br />
I: If#<code> 0 Alt</code> 0 #EPs<code> 3 Cls</code>ff(vend.) Sub<code>00 Prot</code>ff Driver=(none)<br />
E: Ad<code>81(I) Atr</code>03(Int.) MxPS<code> 1 Ivl</code>16ms<br />
E: Ad<code>82(I) Atr</code>02(Bulk) MxPS<code> 64 Ivl</code>0ms<br />
E: Ad<code>03(O) Atr</code>02(Bulk) MxPS<code> 64 Ivl</code>0ms<br />
</pre><br />
<br />
So, for me, the Vendor number is 04a9 and the ProdID is 220e.<br />
<br />
# Create a usbscanner.usermap file in /etc/hotplug/usb. Open your favorite text editor, e.g.<br />
<br />
vi /etc/hotplug/usb/usbscanner.usermap<br />
<br />
Add the following two lines to this file:<br />
<br />
<pre><br />
#Name of your scanner<br />
usbscanner 0x0003 0x04a9 0x220e 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000<br />
</pre><br />
<br />
Instead of the values 0x04a9 and 0x220e, insert the Vendor oder ProdID numbers from step 1.<br />
Save the file as usbscanner.usermap.<br />
(for newer udev, edit the /etc/udev/rules.d/sane.rules)<br />
<br />
# We now need to create a shell script to set the correct permissions on the scanner device. Again, with you favorite text editor, create a file called usbscanner in /etc/hotplug/usb. Insert the following text<br />
<pre><br />
#!/bin/bash<br />
#<br />
# /etc/hotplug/usb/usbscanner<br />
#<br />
<br />
GROUP=users<br />
<br />
if [[ \"${ACTION}\" = \"add\" ]] && [[ -f \"${DEVICE}\" ]]<br />
then<br />
chmod o-rwx \"${DEVICE}\"<br />
chgrp \"${GROUP}\" \"${DEVICE}\"<br />
chmod g+rw \"${DEVICE}\"<br />
fi<br />
<br />
and save the script.<br />
<br />
# Make the script executable<br />
<br />
# chmod +x /etc/hotplug/usb/usbscanner<br />
</pre><br />
<br />
====Test your configuration====<br />
# To test your configuration, plug in your scanner and turn it on. If it was already plugged in before, plug it out and in again to invoke the script.<br />
<br />
# List the contents of /proc/bus/usb by typing<br />
<br />
ls -lR /proc/bus/usb<br />
<br />
There should be at least one device which doesn't say \"root\" twice. On my machine, the output looks like so:<br />
<br />
<pre><br />
/proc/bus/usb/003:<br />
total 0<br />
-rw-r--r-- 1 root root 43 Apr 12 22:02 001<br />
-rw-r--r-- 1 root root 73 Apr 12 22:02 002<br />
-rw-rw---- 1 root users 57 Apr 12 22:08 004<br />
</pre><br />
<br />
Notice the last line.<br />
<br />
====Use your scanner in your favourite application====<br />
<br />
You can now use gimp or xsane to scan pictures with your scanner. Enjoy!<br />
<br />
==Network scanning==<br />
<br />
==== Sharing Your Scanner Over a Network ====<br />
<br />
You can share your scanner with other hosts on your network who use sane, xsane or xsane-enabled Gimp. To set up the server (the PC which is connected to your scanner), first indicate which hosts on your network are allowed access.<br />
<br />
Add the following to the /etc/sane.d/saned.conf file:<br />
<pre><br />
# required<br />
localhost<br />
# allow all local hosts<br />
192.168.0.0/24<br />
</pre><br />
<br />
Of course, you may need to change "192.168.0.0/24" to suit your local area network. You can also specify individual hosts, as the following examples illustrate:<br />
<pre><br />
# specific host with static IP address<br />
192.168.0.2<br />
# specific hosts supported by local DNS or /etc/hosts<br />
bristol<br />
brandal<br />
brutus<br />
</pre><br />
<br />
Ensure xinetd is installed:<br />
<pre><br />
pacman -S xinetd<br />
:: xinetd-#.#.##-#: is up to date. Upgrade anyway? [Y/n] n<br />
</pre><br />
<br />
Also be sure to add xinetd to the list of DAEMONS in /etc/rc.conf<br />
<br />
Next, create a file called /etc/xinetd.d/sane-port and include the following:<br />
<pre><br />
service sane-port<br />
{<br />
port = 6566<br />
socket_type = stream<br />
wait = no<br />
user = nobody<br />
group = nobody<br />
server = /usr/sbin/saned<br />
disable = no<br />
}<br />
</pre><br />
<br />
Note: Apparently you are more likely to achieve success specifying:<br />
<pre><br />
user = root<br />
group = scanner<br />
</pre><br />
<br />
Add the following line to /etc/services:<br />
<pre><br />
sane-port 6566/tcp # SANE network scanner daemon<br />
</pre><br />
<br />
Ensure that ports 6566 and 6567 are not blocked by any firewall which would affect connections inside your local area network. You can check which ports are being used by running the daemon in debug mode:<br />
<br />
saned -d128<br />
<br />
instead of using xinetd.<br />
<br />
Normally, you just need to start (or restart) xinetd as root:<br />
<br />
/etc/rc.d/xinetd start<br />
<br />
Your scanner can now be used by other workstations, across your local area network.<br />
<br />
==== Accessing Your Scanner from a Remote Workstation ====<br />
<br />
You can access your network-enabled scanner from a remote Arch Linux workstation.<br />
<br />
To set up your workstation, begin by installing xsane:<br />
<br />
pacman -S xsane<br />
<br />
Next, specify the server's host name or IP address in the /etc/sane.d/net.conf file:<br />
<pre><br />
# static IP address<br />
192.168.0.1<br />
# OR /etc/hosts or DNS supported host name<br />
stratus<br />
</pre><br />
<br />
Now test your workstation's connection, from a non-root login prompt:<br />
<br />
xsane<br />
<br />
After a short while, xsane should find your remote scanner and present you with the usual windows, ready for network scanning delight!<br />
<br />
==== Common problems with scanner sharing ====<br />
<br />
If your saned backend, at the computer that you're trying to access shared scanner from, says that no scanners are available on the server, but scanning works locally and you're sure, that you have done everything according to the previous two chapters, check following scenarios:<br />
<br />
===== Missing hostname declaration =====<br />
<br />
Stop xinetd (as a root):<br />
<br />
/etc/rc.d/xinetd stop<br />
<br />
Run saned in debug mode as a user belonging to group scanner:<br />
<br />
saned -d<br />
<br />
Try to scan from the client. If the scanning program at the client side reports no available devices and saned at the server reports following before exiting:<br />
<pre><br />
[saned] check_host: getaddrinfo failed: Name or service not known<br />
[saned] init: access by host 192.168.0.2 denied<br />
</pre><br />
then it's probably just missing declaration of your hostname in /etc/hosts<br />
<br />
Fix it by adding following line to the /etc/hosts:<br />
<pre><br />
127.0.0.1 yourhostname<br />
</pre><br />
where "yourhostname" is the same as the one, you have chosen during instalation. Check the following line in /etc/rc.conf:<br />
<pre><br />
HOSTNAME="yourhostname"<br />
</pre><br />
<br />
And start xinetd again (as root):<br />
<br />
/etc/rc.d/xinetd start</div>Gabuzohttps://wiki.archlinux.org/index.php?title=ACPI_hotkeys&diff=169289ACPI hotkeys2011-11-09T09:01:39Z<p>Gabuzo: /* Using acpi_listen */</p>
<hr />
<div>{{i18n|ACPI hotkeys}}<br />
[[Category:Input devices (English)]]<br />
<br />
====Summary====<br />
There are many guides on how to configure multimedia hotkeys using program such as xev or keyTouch. However, this guide explains how to use the simple utility of acpi_listen and generate your own script for hotkeys.<br />
<br />
====Who Should be Using This Guide====<br />
This guide assumes that you know your keyboard signals through acpi. If you do not know whether or not this is the case, I suggest looking:<br />
*[http://en.gentoo-wiki.com/wiki/Multimedia_Keys Using Multimedia Keys in Linux]<br />
*[[Hotkeys|Hotkeys]]<br />
*[[Extra Keyboard Keys|Extra Keyboard Keys - keyTouch]]<br />
<br />
====Installing Necessary Tools====<br />
You should already have these tools installed, but just to make sure you will need<br />
sudo pacman -S acpi acpid acpitool<br />
<br />
[[ACPI modules|Refer to this guide]] on what modules you should load (i.e. through /etc/rc.conf or modprobe)<br />
<br />
====Using acpi_listen====<br />
Under root, or with sufficient access to the input devices, run:<br />
acpi_listen<br />
<br />
If pressing a special key, such as previous or next, receives a response that looks similar to:<br />
hkey VALZ 00000000 00000b31<br />
then all is well and we can continue.<br />
<br />
If nothing appears on the screen during execution of the {{Codeline|acpi_listen}}, that means that the pressed keys do not generate an ACPI event. In this case you can't use ACPI for monitoring these keys. See the page [[Hotkeys]] for other ways of mapping keys.<br />
<br />
===Configuring ACPID===<br />
The ACPI daemon reacts to ACPI events according to the 'handler.sh' file. This is located in<br />
/etc/acpi/handler.sh<br />
<br />
You can either directly edit this file, to react to the ACPI events, or you can point it to another shell script (i.e. /etc/acpi/hotkeys.sh)<br />
<br />
Under the section<br />
case "$1" in<br />
<br />
Add the following lines:<br />
hkey)<br />
case "$4" in<br />
00000b31)<br />
echo "PreviousButton pressed!"<br />
exailectl p<br />
;;<br />
00000b32)<br />
echo "NextButton pressed!"<br />
exailectl n<br />
;;<br />
00000b33)<br />
echo "Play/PauseButton pressed!"<br />
exailectl pp<br />
echo "executed.."<br />
;;<br />
00000b30)<br />
echo "StopButton pressed!"<br />
exailectl s<br />
;;<br />
*)<br />
echo "Hotkey Else: $4"<br />
;;<br />
esac<br />
;;<br />
<br />
The '00000b31' etc. values are the response received from acpi_listen.<br />
In 'hkey VALZ 00000000 00000b31', $4 is the final part, which was what distinguished my keys apart.<br />
<br />
Also, the exailectl script is a brief shell script I created for controlling Exaile music player. As the ACPID is run from root, you will need to use<br />
sudo -u (username) exaile<br />
for example, otherwise it will not detect your user-level program and recreate another.<br />
<br />
<br />
====Old: Sample Script====<br />
As keyTouch and other keyboard programs did not work for me, or did not work effectively, prior to editing my handler.sh file I created my own script that runs in the background and reacts directly from the output of acpi_listen. However it is a poor method to use, caused my laptop to be constantly active and noisy. I have provided the script here anyway, feel free to use it / modify it to suit your needs and post suggestions on how it can be improved. Currently, it is setup for a Toshiba Satellite A50 laptop to control exaile, but can be modified very easily for Amarok, Xine or other non-music related functions (internet, email).<br />
<br />
export STOP_MYHOTKEY=0<br />
i=`acpi_listen -c 1`<br />
case "$i" in<br />
"hkey VALZ 00000000 00000b31")<br />
#echo "PREVIOUS"<br />
exaile -p<br />
;;<br />
"hkey VALZ 00000000 00000b32")<br />
#echo "NEXT"<br />
exaile -n<br />
;;<br />
"hkey VALZ 00000000 00000b33")<br />
exaile -t<br />
;;<br />
"hkey VALZ 00000000 00000b30")<br />
#echo "STOP"<br />
exaile -s<br />
;;<br />
*)<br />
#echo "ELSE: $i"<br />
;;<br />
esac<br />
e=`echo $STOP_MYHOTKEY`<br />
if [ "$e" != "1" ]<br />
then<br />
./myHotkey.sh &<br />
fi<br />
<br />
Note: This does not need to be run as root if you can receive an acpi_listen response from a user account (again, meaning you have access to the input devices).</div>Gabuzo