https://wiki.archlinux.org/api.php?action=feedcontributions&user=Emlun&feedformat=atomArchWiki - User contributions [en]2024-03-29T08:47:02ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Spotify&diff=692176Spotify2021-08-19T15:30:24Z<p>Emlun: /* Installation */ Add instructions for finding upstream release signing key</p>
<hr />
<div>[[Category:Music]]<br />
[[Category:Streaming]]<br />
[[es:Spotify]]<br />
[[ja:Spotify]]<br />
[[Wikipedia:Spotify|Spotify]] is a digital music streaming service with a freemium business model. This article is mainly about the semi-official, proprietary '''Spotify for Linux''' client, which is developed by Spotify's engineers in their spare time and not actively supported by Spotify.[https://www.spotify.com/us/download/linux/] Alternatively, there is an [https://open.spotify.com/ online player] and a number of open source [[#Third-party clients|third-party clients]].<br />
<br />
== Installation ==<br />
<br />
[https://www.spotify.com/us/download/linux/ Spotify for Linux] can be [[install]]ed with the {{AUR|spotify}} package. If you wish to play local files you will need to additionally install {{Pkg|zenity}} and {{AUR|ffmpeg-compat-57}}.<br />
<br />
=== Upstream release signing key ===<br />
<br />
A URL to Spotify's release signing key can be found in the Debian setup instructions on https://www.spotify.com/us/download/linux/ . As of 2021-08, the URL is https://download.spotify.com/debian/pubkey_0D811D58.gpg and the key fingerprint is {{ic|8FD3D9A8D3800305A9FFF259D1742AD60D811D58}}.<br />
<br />
=== Third-party clients ===<br />
<br />
* {{App|[[Wikipedia:Clementine (software)|Clementine]]|Able to stream from Spotify with a premium account after activating (downloading) a plugin in the settings.|https://www.clementine-player.org/|{{Pkg|clementine}}}}<br />
* {{App|Librespot|An open source client library for Spotify. It enables applications to use Spotify's service (streaming), without using the official closed-source ''libspotify''. Requires Spotify Premium account.|https://github.com/librespot-org/librespot|{{AUR|librespot}}}}<br />
* {{App|MellowPlayer|A free, open source and cross-platform desktop application that runs web-based music streaming services in its own window and provides integration with your desktop. No longer actively developed.|https://colinduquesnoy.gitlab.io/MellowPlayer/|{{AUR|mellowplayer}}}}<br />
* {{App|Mopidy|An alternative plug-in based implementation of [[Music Player Daemon]] is able to stream from Spotify with an extension.|https://mopidy.com/|{{Pkg|mopidy}}+ {{AUR|mopidy-spotify}}}}<br />
* {{App|ncspot|Cross-platform ncurses Spotify client written in Rust, inspired by ncmpc and the likes.|https://github.com/hrkfdn/ncspot|{{AUR|ncspot}}}}<br />
* {{App|Psst|Fast and multi-platform Spotify client, made in Rust with a native GUI.|https://github.com/jpochyla/psst|{{AUR|psst-git}}}}<br />
* {{App|Spot|Gtk/Rust native Spotify client for the Gnome desktop.|https://github.com/xou816/spot|{{AUR|spot-client}}}}<br />
* {{App|Spotifyd|An open source Spotify client running as a UNIX daemon. Spotifyd streams music just like the official client, but is more lightweight and supports more platforms. Spotifyd also supports the Spotify Connect protocol which makes it show up as a device that can be controlled from the official clients. Requires Spotify Premium account.|https://github.com/Spotifyd/spotifyd|{{Pkg|spotifyd}}}}<br />
* {{App|spotify-tui|A Spotify client for the terminal written in Rust.|https://github.com/Rigellute/spotify-tui|{{AUR|spotify-tui}}}}<br />
* {{App|spotify-qt|Lightweight Spotify client using Qt written in C++.|https://github.com/kraxarn/spotify-qt|{{AUR|spotify-qt}}}}<br />
* {{App|Tizonia|Command-line cloud music player for Linux with support for Spotify, Google Play Music, YouTube, SoundCloud, Plex servers and Chromecast devices..|https://tizonia.org/docs/spotify/|{{AUR|tizonia-all}}}}<br />
* {{App|Tomahawk|A Music Player App written in C++/Qt. '''No longer actively developed'''.|https://github.com/tomahawk-player/tomahawk|{{AUR|tomahawk-git}}}}<br />
<br />
== Tips and tricks ==<br />
<br />
=== Limit storage size ===<br />
<br />
Spotify automatically manage a storage size for caching, however one may want to force the size limit preventing the [[filesystem]] from filling up.<br />
<br />
[[Append]] {{ic|storage.size}} (measured in MB) to {{ic|/home/''user''/.config/spotify/prefs}}, e.g. a storage size of 3072MB:<br />
<br />
{{hc|~/.config/spotify/prefs|2=<br />
storage.size=3072<br />
}}<br />
<br />
=== Global media hotkeys ===<br />
<br />
{{Tip|Many [[desktop environments]] come with keyboard shortcuts which work with the Spotify client out of the box e.g. under [[Cinnamon]] (Preferences -> Keyboard -> Shortcuts -> Sound and Media), several default bindings are set up to control the player, and these can easily be changed by pressing the preferred keys.}}<br />
<br />
For environments in which controlling Spotify via the keyboard does not work automatically, the official Linux client has support for media keys like {{ic|XF86AudioPlay}}. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below. If you use xbindkeys, ensure that Spotify is restarted after installation and key configuration otherwise the key events will not be properly caught.<br />
<br />
==== MPRIS ====<br />
<br />
The Spotify client implements the [[MPRIS]] D-Bus interface which allows external control.<br />
<br />
==== pactl (pulseaudio) ====<br />
<br />
As you might have noticed, MPRIS protocol commands do not include volume control. This is broken within spotify itself, which ignores volume change requests. However, there is a possibility to control volume via pulseaudio's input sink:<br />
<br />
$ pactl set-sink-input-volume "$current_sink_num" +1% #volume up by 1%<br />
$ pactl set-sink-input-volume "$current_sink_num" -1% #volume down by 1%<br />
$ pactl set-sink-input-mute "$current_sink_num" toggle #mute toggler<br />
<br />
The sink number for "$current_sink_num" can be found in the output of command:<br />
{{hc|head=$ pactl list sink-inputs|2=<br />
Sink Input #'''3''' << here<br />
Driver: protocol-native.c<br />
[...]<br />
application.name = "Spotify"}}<br />
<br />
You can create a script for changing volume and bind it for example to keyboard shortcut via [[desktop environments]] configuration or xdotool described in next section. Here are some examples:<br />
<br />
Bash:<br />
#!/bin/bash<br />
LANGUAGE="en_US"<br />
app_name="Spotify"<br />
current_sink_num=''<br />
sink_num_check=''<br />
app_name_check=''<br />
pactl list sink-inputs |while read line; do \<br />
sink_num_check=$(echo "$line" |sed -rn 's/^Sink Input #(.*)/\1/p')<br />
if [ "$sink_num_check" != "" ]; then<br />
current_sink_num="$sink_num_check"<br />
else<br />
app_name_check=$(echo "$line" \<br />
|sed -rn 's/application.name = "([^"]*)"/\1/p')<br />
if [ "$app_name_check" = "$app_name" ]; then<br />
pactl set-sink-input-volume "$current_sink_num" +1%<br />
fi<br />
fi<br />
done<br />
This script is based on work done by user [https://unix.stackexchange.com/users/52126/miko%c5%82ak Mikołak] in [https://unix.stackexchange.com/questions/208784/command-line-per-application-volume-maybe-amixer-or-pactl/209047#209047 this post].<br />
<br />
Unfortunately this script is not the fastest solution and if you execute it multiple times via keyboard hotkey, it might become laggy.<br />
<br />
Faster (like 10 times) Python code (requires at least Python 3.7 to be installed):<br />
#!/usr/bin/env python3<br />
#Author: Marcin Kocur, attribution license: https://creativecommons.org/licenses/by/4.0/<br />
import subprocess<br />
import os<br />
x=0<br />
y=0<br />
env = os.environ<br />
env['LANG'] = 'en_US'<br />
app = '"Spotify"'<br />
pactl = subprocess.check_output(['pactl', 'list', 'sink-inputs'], env=env).decode().strip().split()<br />
if app in pactl:<br />
for e in pactl:<br />
x += 1<br />
if e == app:<br />
break<br />
for i in pactl[0 : x -1 ]:<br />
y += 1<br />
if i == 'Sink' and pactl[y] == 'Input' and '#' in pactl[y + 1]:<br />
sink_id = pactl[y+1]<br />
if i == 'Volume:' and '%' in pactl[y + 3]:<br />
volume = pactl[y + 3]<br />
sink_id = sink_id[1: ]<br />
volume = volume[ : -1 ]<br />
if int(volume) < 100:<br />
subprocess.run(['pactl', 'set-sink-input-volume', sink_id, '+1%'])<br />
<br />
You can save it to a .py file. The last line does the actual job, so you can adjust the command to lower the volume or toggle mute.<br />
<br />
=== Disable track notifications ===<br />
<br />
After version 0.9.10, track change notifications were enabled by default. They can be quite intrusive. To disable them, add the following line to {{ic|~/.config/spotify/Users/<spotifylogin>-user/prefs}}<br />
<br />
ui.track_notifications_enabled=false<br />
<br />
It is also possible to launch spotify with the {{ic|--ui.track_notifications_enabled&#61;false}} option.<br />
<br />
=== Show track notifications ===<br />
<br />
{{Move|MPRIS#Playerctl|Not specific to spotify.}}<br />
<br />
{{Pkg|playerctl}} provides a library you can use with {{pkg|python-gobject}} and a notification daemon such as {{pkg|dunst}} to show the artist and title in a notification when the track changes.<br />
<br />
#!/usr/bin/env python3<br />
<br />
import gi<br />
gi.require_version('Playerctl', '2.0')<br />
from gi.repository import Playerctl, GLib<br />
from subprocess import Popen<br />
<br />
player = Playerctl.Player()<br />
<br />
def on_track_change(player, e):<br />
track_info = '{artist} - {title}'.format(artist=player.get_artist(), title=player.get_title())<br />
Popen(['notify-send', track_info])<br />
<br />
player.connect('metadata', on_track_change)<br />
<br />
GLib.MainLoop().run()<br />
<br />
=== Skip overplayed radio tracks ===<br />
<br />
{{Move|MPRIS#Playerctl|Not specific to spotify.}}<br />
<br />
Another use of the {{Pkg|playerctl}} library is to skip tracks that are played too much on radio when you do not necessarily want to downvote these tracks because you may want to hear them again later on that station.<br />
<br />
#!/usr/bin/env python3<br />
<br />
from gi.repository import Playerctl, GLib<br />
<br />
player = Playerctl.Player()<br />
<br />
played_out = ['Zu Fuss', 'Walk And Talk', 'Neuland']<br />
<br />
def on_track_change(player, e):<br />
if player.get_title() in played_out:<br />
player.next()<br />
<br />
player.on('metadata', on_track_change)<br />
<br />
GLib.MainLoop().run()<br />
<br />
=== Mute commercials ===<br />
<br />
{{Warning|Muting commercials is not supported by Spotify and may result in a temporary ban [https://www.theverge.com/2018/3/5/17080920/spotify-cracking-down-pirating-premium-free-account]}}<br />
<br />
==== blockify ====<br />
<br />
With [https://github.com/mikar/blockify blockify] you can mute commercials. It is available in the [[AUR]] as {{AUR|blockify}}{{Broken package link|package not found}}.<br />
<br />
To have this start and run in the background every time Spotify starts you will need to automate this yourself:<br />
<br />
{{bc|<nowiki><br />
#!/bin/sh<br />
<br />
spotify=/usr/bin/spotify<br />
<br />
if [[ -x $spotify && -x /usr/bin/blockify ]];<br />
then<br />
blockify &<br />
block_pid=$!<br />
$spotify<br />
trap "kill -9 $block_pid" SIGINT SIGTERM EXIT<br />
fi<br />
</nowiki>}}<br />
<br />
By placing this script at {{ic|/usr/local/bin/spotify}}, it gets preferred to {{ic|/usr/bin/spotify}} everytime you start Spotify, so there is nothing else to change and updates will not break it.<br />
<br />
==== spotblock ====<br />
<br />
[https://github.com/mahkoh/spotblock spotblock] ({{AUR|spotblock-git}}) is a resource-efficient ad blocker that runs as a systemd daemon.<br />
<br />
==== Spotify-AdKiller ====<br />
<br />
[https://github.com/SecUpwN/Spotify-AdKiller Spotify-AdKiller] ({{AUR|spotify-adkiller-git}}) is another alternative to block Spotify ads.<br />
<br />
==== Hosts file ====<br />
<br />
You may also add the following lines to your hosts file to block ads in Spotify :<br />
<br />
{{hc|/etc/hosts|<nowiki><br />
# Block spotify ads<br />
127.0.0.1 media-match.com<br />
127.0.0.1 adclick.g.doublecklick.net<br />
127.0.0.1 www.googleadservices.com<br />
127.0.0.1 open.spotify.com<br />
127.0.0.1 pagead2.googlesyndication.com<br />
127.0.0.1 desktop.spotify.com<br />
127.0.0.1 googleads.g.doubleclick.net<br />
127.0.0.1 pubads.g.doubleclick.net<br />
127.0.0.1 audio2.spotify.com<br />
127.0.0.1 www.omaze.com<br />
127.0.0.1 omaze.com<br />
127.0.0.1 bounceexchange.com<br />
#127.0.0.1 spclient.wg.spotify.com<br />
127.0.0.1 securepubads.g.doubleclick.net<br />
127.0.0.1 8.126.154.104.bc.googleusercontent.com<br />
127.0.0.1 104.154.126.8<br />
<br />
</nowiki>}}<br />
spclient.wg.spotify.com now appears to block radio and daily mixes, as well as recently played songs.<br />
<br />
=== Remote Control ===<br />
<br />
==== Send commands via SSH ====<br />
<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host ''yourcommand''<br />
<br />
where ''yourcommand'' can be [https://code.google.com/p/spotifycmd/ spotifycmd] that you installed on the server, or a dbus script for the linux version, as described above.<br />
<br />
==== Grab the Spotify window via SSH ====<br />
<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done<br />
</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
<br />
$ sh vncget.sh<br />
<br />
or, for the whole desktop:<br />
<br />
$ sh vncget.sh all<br />
<br />
=== HiDPI Mode ===<br />
<br />
As the current Spotify build is not DPI aware, the amount to scale the interface by can be specified using the terminal command:<br />
$ spotify --force-device-scale-factor='''X'''<br />
<br />
where X is the amount to scale the interface by, e.g 2.<br />
<br />
This change can be added to the {{ic|spotify.desktop}} file in order to apply the scaling when launching from the desktop.<br />
<br />
To make sure the file does not get overwritten when the package is updated, copy it to you local applications folder:<br />
$ cp /usr/share/applications/spotify.desktop ~/.local/share/applications/<br />
<br />
Now edit {{ic|~/.local/share/applications/spotify.desktop}} and add the {{ic|--force-device-scale-factor}} option:<br />
<br />
{{hc|spotify.desktop|2=<br />
[Desktop Entry]<br />
Name=Spotify<br />
GenericName=Music Player<br />
Comment=Spotify streaming music client<br />
Icon=spotify-client<br />
Exec=spotify '''--force-device-scale-factor=2''' %U<br />
TryExec=spotify<br />
Terminal=false<br />
Type=Application<br />
Categories=Audio;Music;Player;AudioVideo<br />
MimeType=x-scheme-handler/spotify<br />
}}<br />
<br />
You might need to relaunch your Desktop Manager, before these override changes will be effective.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Desktop Environment alerts (beeps) mutes Spotify ===<br />
<br />
Comment out "module-role-cork" in pulse audio configuration file.<br />
<br />
Open {{ic|/etc/pulse/default.pa}} with your text editor and comment out:<br />
<br />
load-module module-role-cork <br />
<br />
Or simply unload it with:<br />
<br />
pactl unload-module module-role-cork<br />
<br />
=== Using search causes the whole interface to blink and then crash ===<br />
<br />
Spotify is using an old version of Chromium Embedded Framework and hits a bug causing it to crash repeatedly when trying to use the search. This can be worked around by using the following command line option:<br />
<br />
--force-device-scale-factor=1.0000001<br />
<br />
=== Blinking images and improper rendering while using Spotify Linux with DWM ===<br />
<br />
Start spotify as a floating window.<br />
<br />
You can add this rule to the rules array in your {{ic|config.h}}:<br />
{ "Spotify", NULL, NULL, 2, True, -1 },<br />
<br />
This will tell dwm to start spotify as a floating window associated with the tag "2" no matter what window mode you are in. Recompile and install dwm to apply your new settings.<br />
<br />
=== Broken search, browsing or radio ===<br />
<br />
: Spotify [https://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning non-english locales<br />
If various tabs like browsing only show a blank screen, the search field does not seem to do anything or the radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale.<br />
<br />
Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
=== Deadlock GUI Thread ===<br />
<br />
Can occur under tiling window managers, such as Awesome, when double-clicking new song or playlist. Edit the file {{ic|~/.config/spotify/Users/[1-9]*-user/prefs}} to add or change the following:<br />
<br />
ui.track_notifications_enabled=false<br />
<br />
Restart Spotify. This will try to disable song notifications which seem to be the cause of the issue (the lack of a notification daemon to receive them makes the UI thread hang). Note that several causes appear to exist for this problem, and this particular fix only applies to select versions of Spotify client, i3 and Awesome, and it may be that additional root causes exist for the Debian and Ubuntu users reporting this issue. Observed with Spotify 0.9.17.1.g9b85d436 and Awesome 3.4.15 and i3-gaps 4.13-2 and Spotify 1.0.64.407.g9bd02c2d.<br />
<br />
{{Note|As of Spotify 1.0.17.75-2, {{ic|1=ui.track_notifications_enabled=false}} seems to be ignored. On the other hand, some users report not experiencing the deadlock anymore as of Awesome 3.5.6. Deadlocks could be caused by scripts called by Awesome, which rely on buggy spotify dbus properties. See [https://github.com/acrisci/playerctl/issues/20].}}<br />
<br />
'''Note:''' This issue has multiple causes, so keep track of what you change while researching this. Update this section with additional scenarios and fixes.<br />
<br />
=== Album art and images are missing, show up as squares ===<br />
<br />
Quit spotify, then open spotify preferences {{ic|~/.config/spotify/prefs}}<br />
<br />
Change @https to @http:<br />
<br />
network.proxy.addr="your-proxy.com:80<strong>@http</strong>"<br />
network.proxy.mode=2<br />
<br />
See original form post [https://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Mac-Windows-0-9-0-128-Apps-can-t-connect-anywhere-behind-proxy/m-p/448704#M52332 here].<br />
<br />
{{Note|As of 1.0.17 it looks like replacing https with http as suggested above can result in no connectivity at all. If this happens an alternative solution is to set 'no proxy' in the GUI use {{Pkg|proxychains-ng}} to force all TCP connection coming from the app through a proxy. Even with HTTP proxies that reject connections on port 80 (and only work for port 443) this works reliably.}}<br />
<br />
=== Spotify does not detect other devices on local network ===<br />
<br />
If a firewall is in place, open ports 57621 for UDP and TCP. If you use a variant of the [[iptables]] [[Simple stateful firewall]], the following should do it:<br />
<br />
iptables -A TCP -p tcp --dport 57621 -j ACCEPT -m comment --comment spotify<br />
iptables -A UDP -p udp --dport 57621 -j ACCEPT -m comment --comment spotify<br />
<br />
It is also possible to restrict the source and destination to the local network.<br />
<br />
If you are using Spotify Connect to play music on a wireless speaker or AVR, your firewall needs to be configured for Spotify's mDNS lookup of those. Sadly, it uses a random unprivileged port [https://community.spotify.com/t5/Desktop-Linux-Windows-Web-Player/Spotify-Connect-and-iptables-netfilter/td-p/1235049] which makes these firewall rules rather nasty. Fortunately, you can restrict the rules to source port 1900 or 5353.<br />
<br />
iptables -A UDP -p udp --sport 1900 --dport 1025:65535 -j ACCEPT -m comment --comment spotify<br />
iptables -A UDP -p udp --sport 5353 --dport 1025:65535 -j ACCEPT -m comment --comment spotify<br />
<br />
If using MusicCast for streaming, you will also need to ensure that IGMP multicast packets are allowed to 224.0.0.22 (with IP options allowed) from the MusicCast speaker/AVR by all firewalls in place (including router firewall).<br />
<br />
If you cannot detect other linux clients, this may be due to a bug in Spotify related to the user name launching the instance. Spotify will not detect other instances having the same {{ic|$HOME}} environment variable, even on different machines. To circumvent this, either create a dedicated user, or launch Spotify with a different {{ic|$HOME}}. The following is a workaround to use your home directory and still be able to detect other devices:<br />
<br />
$ ln -s $HOME ~/.spotify_fakehome_$HOSTNAME<br />
$ HOME=$HOME/.spotify_fakehome_$HOSTNAME spotify &<br />
<br />
=== Search Bar text is invisible when using a dark theme ===<br />
<br />
The text in the search bar appears to be hardcoded to be white, making it invisible when using a dark Qt theme. To fix this, you will need to make an override.<br />
<br />
First create a css file somewhere your account has permission to read/write from (such as your home folder). Call it whatever you like (eg. '''spotify-override.css''').<br />
<br />
Open the newly created css file and add the following:<br />
<br />
QLineEdit { color: #000 }<br />
<br />
Save the file and exit. Next, you need to add the following to the end of your Spotify launcher (substitute the path with the actual path of your css file):<br />
<br />
-stylesheet=/home/user/spotify-override.css<br />
<br />
So your full launch path should look something like this:<br />
<br />
/usr/share/spotify/spotify-client/spotify -stylesheet=/home/user/spotify-override.css<br />
<br />
=== Cannot play local files ===<br />
<br />
{{Remove|Playback of local files works seamlessly on {{AUR|spotify}} out of the box without any changes as tested on version 1:1.1.56.595-1.|section=Removal of sections regarding playback of local files}}<br />
<br />
If you get a segmentation fault or error message when trying to play local files e.g.<br />
<br />
This song is not available. If you have the file on your computer you can import it.<br />
<br />
- it's caused by a missing libavcodec dependency. For PulseAudio users, installing {{aur|ffmpeg-compat-57}} should fix it. If you get PGP verification errors when you install it you might have to import the correct PGP key. <br />
<br />
$ gpg --keyserver pgp.mit.edu --recv-keys FCF986EA15E6E293A5644F10B4322F04D67658D8<br />
<br />
=== Not respecting window manager rules ===<br />
<br />
Window manager that try to apply specific rules like starting it on a determined workspace or maximizing it on startup, has no effect, as Spotify does not set the ''WM_CLASS'' property before creating the window, violating the ICCCM specifications. One solution is to use {{AUR|spotifywm-git}}.<br />
<br />
=== GUI hangs while the music plays ===<br />
<br />
Also the previous and next track buttons act with a delay of 10-40 seconds. Spotify by default tries to send notification about next track, if you do not have a notification-daemon installed, Spotify's GUI hangs.<br />
<br />
The solution is to either disable notifications in the settings or to install a notification daemon from [[Desktop notifications]].<br />
<br />
=== GUI Borders are gone and app occupies the whole screen over cinnamon panel ===<br />
<br />
If having issue with window borders disappearing and so app goes to a kind of fullscreen but you cannot drag the window or change its size on cinnamon, that may be caused by the preferences located by default at text file {{ic|/home/yourusername/.config/Spotify/Users/yourusername-user/prefs}} configs:<br />
<br />
app.window.position.width=1366<br />
app.window.position.height=768<br />
<br />
What probably happens is, when both resolutions matches your "main" monitor resolution values or higher, this may happen when going from two monitors to only one monitor. As a solution, close Spotify, edit {{ic|prefs}} file to remove both configs above, save it, then run Spotify again.<br />
<br />
=== Cannot open settings in Wayland ===<br />
<br />
When using Wayland, clicking on the 'Settings' button does nothing. Using the keyboard instead will work (arrows and enter). See [https://community.spotify.com/t5/Desktop-Linux/Settings-don-t-open-on-Linux/td-p/1478736]<br />
<br />
=== Crashes on startup ===<br />
<br />
If the app crashes on startup and you get the following error message<br />
<br />
[NNN:FATAL:gpu_data_manager_impl_private.cc(439)] GPU process isn't usable. Goodbye<br />
<br />
try to run {{ic|spotify}} with the {{ic|-no-zygote}} flag.<br />
<br />
=== Spotify crashes when adding a local folder ===<br />
<br />
{{Remove|Playback of local files works seamlessly on {{AUR|spotify}} out of the box without any changes as tested on version 1:1.1.56.595-1.|section=Removal of sections regarding playback of local files}}<br />
<br />
When the 'add a source' button inside the Local Files options crashes Spotify. One workaround available is shown in [https://www.reddit.com/r/archlinux/comments/knyfpo/how_to_play_local_files_with_spotify/ this reddit post]. Alternatively you can install the [[Flatpak]] version.<br />
<br />
=== Spotify has limited or no internet connectivity while using a VPN ===<br />
<br />
More recent versions of Spotify (noticed after version ~1.1.10) use [[NetworkManager]]'s detection of internet connectivity for determining if Spotify is able to play songs or even log in. When using a VPN service, Network Manager can fail to correctly identify internet connectivity, stating "Limited Connectivity". See [[NetworkManager#Checking connectivity]] for possible solutions.<br />
<br />
== See also ==<br />
<br />
* [https://www.spotify.com/int/download/linux/ Spotify for Linux] — Spotify's homepage for the Linux client</div>Emlunhttps://wiki.archlinux.org/index.php?title=Alacritty&diff=563752Alacritty2019-01-18T12:33:25Z<p>Emlun: Redirected page to List of applications/Utilities#Terminal emulators</p>
<hr />
<div>#REDIRECT [[List_of_applications/Utilities#Terminal_emulators]]</div>Emlunhttps://wiki.archlinux.org/index.php?title=User:Emlun&diff=432912User:Emlun2016-04-26T18:53:07Z<p>Emlun: </p>
<hr />
<div>Emil Lundberg; lundberg.emil at gmail; emlun on AUR and irc.freenode.net<br />
<br />
https://keybase.io/emlun<br />
<br />
Arch user since 2010.</div>Emlunhttps://wiki.archlinux.org/index.php?title=User:Emlun&diff=432907User:Emlun2016-04-26T18:30:16Z<p>Emlun: </p>
<hr />
<div>Emil Lundberg; lundberg.emil at gmail; emlun on AUR and irc.freenode.net<br />
<br />
Arch user since 2010.</div>Emlunhttps://wiki.archlinux.org/index.php?title=DeveloperWiki_talk:Pacman_Hooks&diff=432906DeveloperWiki talk:Pacman Hooks2016-04-26T18:20:40Z<p>Emlun: /* Suggestion: update-ca-trust */ new section</p>
<hr />
<div>==glib-compile-schemas==<br />
Used by 222 packages<br />
<br />
Proposed Hook (glib-compile-schemas)<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Target = usr/share/glib-2.0/schemas/*.gschema.xml<br />
Target = usr/share/glib-2.0/schemas/*.gschema.override<br />
<br />
[Action]<br />
Description = Compile GSettings XML schema files...<br />
When = PostTransaction<br />
Exec = /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas<br />
<br />
--[[User:City-busz|City-busz]] ([[User talk:City-busz|talk]]) 08:06, 23 April 2016 (UTC)<br />
<br />
:Thanks, I think that will work. --[[User:Heftig|Heftig]] ([[User talk:Heftig|talk]]) 08:22, 23 April 2016 (UTC)<br />
<br />
==hook script location==<br />
libalpm doesn't place any restrictions on where we store custom scripts for hooks, but I think we should store them all in the same place for the sake of consistency. I suggest '/usr/share/libalpm/hooks.bin/' in order to keep them near the hooks themselves. [[User:Apg|Apg]] ([[User talk:Apg|talk]]) 11:47, 23 April 2016 (UTC)<br />
<br />
== systemd-sysusers and systemd-tmpfiles ==<br />
<br />
=== systemd-tmpfiles ===<br />
Used by 52 packages<br />
<br />
Proposed hook (systemd):<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Target = usr/lib/tmpfiles.d/*.conf<br />
<br />
[Action]<br />
Description = Updating systemd-tmpfiles…<br />
When = PostTransaction<br />
Exec = /bin/sh -c 'while read -r f; do /usr/bin/systemd-tmpfiles --create "$f" ; done'<br />
NeedsTargets<br />
<br />
=== systemd-sysusers ===<br />
Used by 29 packages<br />
<br />
Proposed hook (systemd):<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Target = usr/lib/sysusers.d/*.conf<br />
<br />
[Action]<br />
Description = Updating systemd-sysusers…<br />
When = PostTransaction<br />
Exec = /bin/sh -c 'while read -r f; do /usr/bin/systemd-sysusers "$f" ; done'<br />
NeedsTargets<br />
<br />
--[[User:AsamK|AsamK]] ([[User talk:AsamK|talk]]) 14:13, 23 April 2016 (UTC)<br />
<br />
== while read ==<br />
<br />
Suggested alternative (conveniently, texinfo already depends on findutils):<br />
<br />
Exec = /usr/bin/xargs -i /usr/bin/install-info {} /usr/share/info/dir<br />
NeedsTargets<br />
<br />
--[[User:Grawity|grawity]] ([[User talk:Grawity|talk]]) 14:49, 23 April 2016 (UTC)<br />
<br />
texinfo only depends on find due to its install scriptlet which is being replaced by these hooks. [[User:Allan|Allan]] ([[User talk:Allan|talk]]) 00:35, 24 April 2016 (UTC)<br />
<br />
== systemctl daemon-reload? ==<br />
<br />
Not sure if this is ever called during the update process anywhere. If so I imagine it would be called often. -- [[User:Rdeckard|Rdeckard]] ([[User_talk:Rdeckard|talk]]), [[ArchWiki:Maintainers|ArchWiki Maintainer]] 00:07, 24 April 2016 (UTC)<br />
<br />
== texlive file database update ==<br />
<br />
Used in 27 packages with calls to either mktexlsr or texhash (one symlinks to the other).<br />
<br />
Proposed hook (texlive-texmf):<br />
<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Target = usr/share/texmf/*<br />
Target = usr/share/texmf-dist/*<br />
<br />
[Action]<br />
Description = Updating texlive filename database...<br />
When = PostTransaction<br />
Exec = /usr/bin/mktexlsr<br />
<br />
--[[User:Abdo|abdo]] ([[User talk:Abdo|talk]]) 09:49, 24 April 2016 (UTC)<br />
<br />
:I think you can put multiple Targets under one <tt>[Trigger]</tt>, can't you? --[[User:Grawity|grawity]] ([[User talk:Grawity|talk]]) 10:08, 24 April 2016 (UTC)<br />
:: Oh yes! I just tested it. Thanks!<br />
<br />
== gconf ==<br />
<br />
{{bc|1=<br />
[Trigger]<br />
Type = file<br />
Operation = Install<br />
Operation = Upgrade<br />
Target = usr/share/gconf/schemas/*.schemas<br />
<br />
[Action]<br />
Description = Installing GConf schemas...<br />
When = PostTransaction<br />
Exec = /bin/bash -c 'while read -r f; do f=${f##*/}; f=${f%.schemas}; /usr/bin/gconfpkg --install $f; done'<br />
NeedsTargets<br />
}}<br />
<br />
{{bc|1=<br />
[Trigger]<br />
Type = file<br />
Operation = Remove<br />
Target = usr/share/gconf/schemas/*.schemas<br />
<br />
[Action]<br />
Description = Removing GConf schemas...<br />
When = PreTransaction<br />
Exec = /bin/bash -c 'while read -r f; do f=${f##*/}; f=${f%.schemas}; /usr/bin/gconfpkg --uninstall $f; done'<br />
NeedsTargets<br />
}}<br />
<br />
(As a side note, gconf's own .install scriptlet is a bit weird)<br />
<br />
--[[User:Grawity|grawity]] ([[User talk:Grawity|talk]]) 10:24, 24 April 2016 (UTC)<br />
<br />
== glib2: gio-querymodules ==<br />
<br />
{{bc|1=<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Target = usr/lib/gio/modules/*.so<br />
<br />
[Action]<br />
Description = Updating GLib GIO module cache...<br />
When = PostTransaction<br />
Exec = /usr/bin/gio-querymodules /usr/lib/gio/modules<br />
}}<br />
<br />
--[[User:Grawity|grawity]] ([[User talk:Grawity|talk]]) 10:25, 24 April 2016 (UTC)<br />
<br />
== fontconfig font cache ==<br />
<br />
Used in 53 packages.<br />
<br />
Proposed hook (fontconfig-cache):<br />
<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Target = usr/share/fonts/*<br />
<br />
[Action]<br />
Description = Updating fontconfig font cache...<br />
When = PostTransaction<br />
Exec = /usr/bin/fc-cache -s<br />
<br />
--[[User:Abdo|abdo]] ([[User talk:Abdo|talk]]) 10:29, 24 April 2016 (UTC)<br />
<br />
:The <tt>-f</tt> is unnecessary most of the time; existing packages have been removing it from their scripts. --[[User:Grawity|grawity]] ([[User talk:Grawity|talk]]) 10:59, 24 April 2016 (UTC)<br />
::Corrected.<br />
<br />
== X font index ==<br />
<br />
Used in 38 packages.<br />
<br />
Proposed hook (xorg-font-index):<br />
<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Target = usr/share/fonts/*/<br />
<br />
[Action]<br />
Description = Updating X font index...<br />
When = PostTransaction<br />
Exec = /bin/sh -c 'while read -r d; do mkfontscale "$d"; mkfontdir "$d"; done'<br />
NeedsTargets<br />
<br />
Note: <tt>mkfontdir</tt> should run after <tt>mkfontscale</tt>, in case this hook ends up split as two separate hooks.<br />
<br />
--[[User:Abdo|abdo]] ([[User talk:Abdo|talk]]) 11:21, 24 April 2016 (UTC)<br />
<br />
== Suggestion: update-ca-trust ==<br />
<br />
Here's a hook I recently added to one of my private packages, which will (should/seems to successfully) rebuild the CA certificate trust store whenever anchors change:<br />
<br />
[Trigger]<br />
Operation = Install<br />
Operation = Upgrade<br />
Operation = Remove<br />
Type = File<br />
Target = usr/share/ca-certificates/trust-source/anchors/*<br />
<br />
[Action]<br />
Description = Rebuild CA certificate trust sources<br />
When = PostTransaction<br />
Exec = /usr/bin/update-ca-trust<br />
<br />
[[User:Emlun|Emlun]] ([[User talk:Emlun|talk]]) 18:20, 26 April 2016 (UTC)</div>Emlunhttps://wiki.archlinux.org/index.php?title=VirtualBox&diff=400434VirtualBox2015-09-18T12:04:14Z<p>Emlun: /* Troubleshooting */ Add section on exit code 0x1 NS_ERROR_FAILURE</p>
<hr />
<div>[[Category:Emulators]]<br />
[[Category:Hypervisors]]<br />
[[cs:VirtualBox]]<br />
[[de:VirtualBox]]<br />
[[el:VirtualBox]]<br />
[[es:VirtualBox]]<br />
[[fr:VirtualBox]]<br />
[[hu:VirtualBox]]<br />
[[it:VirtualBox]]<br />
[[ja:VirtualBox]]<br />
[[pt:VirtualBox]]<br />
[[ru:VirtualBox]]<br />
[[zh-CN:VirtualBox]]<br />
{{Related articles start}}<br />
{{Related|:Category:Hypervisors}}<br />
{{Related|PhpVirtualBox}}<br />
{{Related|Moving an existing install into (or out of) a virtual machine}}<br />
{{Related articles end}}<br />
<br />
[https://www.virtualbox.org VirtualBox] is a [[Wikipedia:Hypervisor|hypervisor]] used to run operating systems in a special environment, called a virtual machine, on top of the existing operating system. VirtualBox is in constant development and new features are implemented continuously. It comes with a [[Qt]] GUI interface, as well as headless and [[Wikipedia:Simple DirectMedia Layer|SDL]] command-line tools for managing and running virtual machines.<br />
<br />
In order to integrate functions of the host system to the guests, including shared folders and clipboard, video acceleration and a seamless window integration mode, ''guest additions'' are provided for some guest operating systems.<br />
<br />
== Installation steps for Arch Linux hosts ==<br />
<br />
In order to launch VirtualBox virtual machines on your Arch Linux box, follow these installation steps.<br />
<br />
=== Install the core packages ===<br />
<br />
First, [[install]] the {{Pkg|virtualbox}} package which contains the GPL-licensed VirtualBox suite with the SDL and headless command-line tools included. The {{Pkg|virtualbox}} package comes with {{Pkg|virtualbox-host-modules}} as a required dependency. <br />
<br />
You can install the {{Pkg|qt4}} optional dependency in order to use the graphical interface which is based on [[Qt]]. This is not required if you intend to use VirtualBox in command-line only. [[#Use the right front-end|See below to learn the differences]].<br />
<br />
=== Install the VirtualBox kernel modules ===<br />
<br />
Next, to fully virtualize your guest installation, VirtualBox provides the following [[kernel modules]]: {{ic|vboxdrv}}, {{ic|vboxnetadp}}, {{ic|vboxnetflt}}, and {{ic|vboxpci}}. These must be added to your host kernel.<br />
<br />
The binary compatibility of kernel modules depends on the API of the kernel against which they have been compiled. The problem with the Linux kernel is that these interfaces might not be the same from one kernel version to another. In order to avoid compatibility problems and subtle bugs, each time the Linux kernel is upgraded, it is advised to recompile the kernel modules against the Linux kernel version that has just been installed. This is what Arch Linux packagers actually do with the VirtualBox kernel modules packages: each time a new Arch Linux kernel is released, the Virtualbox modules are upgraded accordingly.<br />
<br />
Therefore, if you are using a kernel from the [[official repositories]] or a custom one (self-compiled or installed from the [[AUR]]), the kernel module package you will need to install will thus vary.<br />
<br />
==== Hosts running an official kernel ====<br />
<br />
* If you are using the {{Pkg|linux}} kernel, make sure the {{pkg|virtualbox-host-modules}} package is still installed. The latter has been installed when you installed the {{Pkg|virtualbox}} package.<br />
* If you are using the LTS version of the kernel ({{pkg|linux-lts}}), you need to install the {{pkg|virtualbox-host-modules-lts}} package. {{Pkg|virtualbox-host-modules}} can now be removed if you want.<br />
* If you are using the {{aur|linux-ck}} kernel, build the {{aur|virtualbox-ck-host-modules}} package.<br />
<br />
==== Hosts running a custom kernel ====<br />
<br />
If you use or intend to use a self-compiled kernel from sources, you have to know that VirtualBox does not require any virtualization modules (e.g. virtuo, kvm,...). The VirtualBox kernel modules provide all the necessary for VirtualBox to work properly. You can thus disable in your kernel ''.config'' file these virtualization modules if you do not use other hypervisors like Xen, KVM or QEMU.<br />
<br />
The {{Pkg|virtualbox-host-modules}} package works fine with custom kernels of the same version of the Arch Linux stock kernel such as {{AUR|linux-ck}}. If you do not use such kernel, see [[#DKMS Install]] instead.<br />
<br />
===== DKMS Install =====<br />
<br />
{{Tip|[[DKMS]] can automatically generate the modules of the current running kernel by running the following command:<br />
{{bc|<nowiki># dkms autoinstall</nowiki>}}<br />
}}<br />
<br />
As the {{Pkg|virtualbox-host-dkms}} package requires compilation, make sure you have the kernel headers corresponding to your custom kernel version to prevent this error from happening: {{ic|Your kernel headers for kernel ''your custom kernel version'' cannot be found at /usr/lib/modules/''your custom kernel version''/build or /usr/lib/modules/''your custom kernel version''/source}}<br />
<br />
Once {{Pkg|virtualbox-host-dkms}} is installed, simply generate the kernel modules for the custom kernel by running the following command:<br />
# dkms install vboxhost/''virtualbox-host-source version'' -k ''your custom kernel version''/''your architecture''<br />
<br />
{{Tip|Use this all-in-one command instead, if you do not want to adapt the above command:<br />
{{bc|<nowiki># dkms install vboxhost/$(pacman -Q virtualbox|awk '{print $2}'|sed 's/\-.\+//') -k $(uname -rm|sed 's/\ /\//')</nowiki>}}<br />
}}<br />
<br />
To automatically recompile the VirtualBox kernel modules when their sources get upgraded (i.e. when the {{Pkg|virtualbox-host-dkms}} package has been upgraded), enable the {{ic|dkms}} service.<br />
<br />
=== Load the VirtualBox kernel modules ===<br />
<br />
Among the [[kernel modules]] VirtualBox uses, there is a mandatory module named {{ic|vboxdrv}}, which must be loaded before any virtual machines can run. It can be automatically loaded when Arch Linux starts up, or it can be loaded manually when necessary.<br />
<br />
To load the module manually:<br />
# modprobe vboxdrv<br />
<br />
To load the VirtualBox module at boot time, refer to [[Kernel modules#Automatic module handling]] and create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/modules-load.d/}} with the line:<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxdrv}}<br />
<br />
The following modules are optional but are recommended if you do not want to be bothered in some advanced configurations (precised here after): {{ic|vboxnetadp}}, {{ic|vboxnetflt}} and {{ic|vboxpci}}.<br />
<br />
* {{ic|vboxnetadp}} and {{ic|vboxnetflt}} are both needed when you intend to use the [https://www.virtualbox.org/manual/ch06.html#network_bridged bridged] or [https://www.virtualbox.org/manual/ch06.html#network_hostonly host-only networking] feature. More precisely, {{ic|vboxnetadp}} is needed to create the host interface in the VirtualBox global preferences, and {{ic|vboxnetflt}} is needed to launch a virtual machine using that network interface.<br />
<br />
* {{ic|vboxpci}} is needed when your virtual machine needs to pass through a PCI device on your host.<br />
<br />
{{Note|If the VirtualBox kernel modules were loaded in the kernel while you updated the modules, you need to reload them manually to use the new updated version. To do it, run {{ic|vboxreload}} as root.}}<br />
<br />
Finally, if you use the aforementioned "Host-only" or "bridge networking" feature, make sure {{pkg|net-tools}} is installed. VirtualBox actually uses {{ic|ifconfig}} and {{ic|route}} to assign the IP and route to the host interface configured with {{ic|VBoxManage hostonlyif}} or via the GUI in ''Settings > Network > Host-only Networks > Edit host-only network (space) > Adapter''.<br />
<br />
=== Add usernames to the vboxusers group ===<br />
<br />
To use the USB ports of your host machine in your virtual machines, add to the {{ic|vboxusers}} [[group]] the usernames that will be authorized to use this feature. The new group does not automatically apply to existing sessions; the user has to log out and log in again, or start a new environment with the {{ic|newgrp}} command or with {{ic|sudo -u $USER -s}}. To add the current user to the {{ic|vboxusers}} group, type:<br />
# gpasswd -a $USER vboxusers<br />
<br />
=== Guest additions disc ===<br />
<br />
It is also recommended to install the {{Pkg|virtualbox-guest-iso}} package on the host running VirtualBox. This package will act as a disc image that can be used to install the guest additions onto guest systems other than Arch Linux. The ''.iso'' file will be located at {{ic|/usr/lib/virtualbox/additions/VBoxGuestAdditions.iso}}, and may have to be mounted manually inside the virtual machine. Once mounted, you can run the guest additions installer inside the guest.<br />
<br />
=== Extension pack ===<br />
<br />
Since VirtualBox 4.0, non-GPL components have been split from the rest of the application. Despite being released under a non-free license and '''being only available for personal use''', you might be interested in installing the Oracle Extension Pack which provides [https://www.virtualbox.org/manual/ch01.html#intro-installing additional features]. To avoid manual manipulation, the {{aur|virtualbox-ext-oracle}} package is available, and a prebuilt version can be found in the [[Unofficial user repositories#seblu|seblu]] repository.<br />
<br />
If you prefer to use the traditional and manual way: download the extension manually and install it via the GUI (''File > Preferences > Extensions'') or via {{ic|VBoxManage extpack install <.vbox-extpack>}}, make sure you have a toolkit (like [[Polkit]], gksu, etc.) to grant privileged access to VirtualBox. The installation of this extension [https://www.virtualbox.org/ticket/8473 requires root access].<br />
<br />
=== Use the right front-end ===<br />
<br />
Now, you are ready to use VirtualBox. Congratulations!<br />
<br />
Multiple front-ends are available to you of which two are available by default:<br />
* If you want to use VirtualBox in command-line only (only launch and change settings of existing virtual machines), you can use the {{ic|VBoxSDL}} command. VBoxSDL does only provide a simple window that contains only the ''pure'' virtual machine, without menus or other controls.<br />
* If you want to use VirtualBox in command-line without any GUI running (e.g. on a server) to create, launch and configure virtual machines, use the {{ic|VBoxHeadless}} which produces no visible output on the host at all, but instead only delivers VRDP data (note: VRDP is only enabled if the extension pack is installed).<br />
<br />
If you installed the {{Pkg|qt4}} optional dependency, you can run {{ic|VirtualBox}} and have a nice-looking GUI interface with menus usable via the mouse.<br />
<br />
Finally, you can use [[PhpVirtualBox]] to administrate your virtual machines via a web interface.<br />
<br />
Refer to the [https://www.virtualbox.org/manual VirtualBox manual] to learn how to create virtual machines.<br />
<br />
{{Warning|If you intend to store virtual disk images on a [[Btrfs]] file system, before creating any images, you should consider disabling [[Btrfs#Copy-On-Write_.28CoW.29|Copy-on-Write]] for the destination directory of these images.}}<br />
<br />
== Installation steps for Arch Linux guests ==<br />
<br />
=== Install Arch Linux inside the virtual machine ===<br />
Boot the Arch installation media through one of the virtual machine's virtual drives. Then, complete the installation of a basic Arch system as explained in the [[Beginners' guide]] or the [[Installation guide]] without installing any graphic driver: we will install one provided by VirtualBox just at the next step.<br />
<br />
==== Installation in EFI mode ====<br />
<br />
If you want to install Arch Linux in EFI mode inside VirtualBox, in the settings of the virtual machine, go in the ''Settings'' tab, and check the checkbox ''Enable EFI (special OSes only)''. After selecting the kernel from the Arch Linux installation media's menu, the media will hang for a minute or two and will continue to boot the kernel normally afterwards. Be patient.<br />
<br />
When booting in EFI mode, VirtualBox will first attempt to run {{ic|/EFI/BOOT/BOOTX64.EFI}} from the ESP. If that first option fails, VirtualBox will then try the EFI shell script {{ic|startup.nsh}} from the root of the ESP. Unless you want to manually launch your bootloader from the EFI shell every time, you will need to move your bootloader to that default path. Do not bother with the VirtualBox Boot Manager (accessible with {{ic|F2}} at boot): EFI entries added to it manually at boot or with {{Pkg|efibootmgr}} will persist after a reboot [https://www.virtualbox.org/ticket/11177 but are lost when the VM is shut down].<br />
<br />
=== Install the Guest Additions ===<br />
<br />
After completing the installation of the guest system, install the VirtualBox [https://www.virtualbox.org/manual/ch04.html Guest Additions] which include drivers and applications that optimize the guest operating system. These can be installed via {{Pkg|virtualbox-guest-utils}}, which provides {{Pkg|virtualbox-guest-modules}} as a required dependency.<br />
<br />
{{Note|The method described in the [https://www.virtualbox.org/manual/ch04.html#idp54932560 VirtualBox manual] does not work on Arch Linux guests, resulting in an {{ic|Unable to determine your Linux distribution}} repeated several times as error message. If you tried this method first and you use the right solution described above afterwards, this will fail. You will get a [[Pacman#"Failed to commit transaction (conflicting files)" error|file conflict]]: {{ic|/usr/bin/VBox*}} and {{ic|/usr/lib/VBox* exists in filesystem}}. The solution is to remove the offending files first with {{ic|rm /usr/bin/VBox* /usr/lib/VBox*}} as root. These files are actually symbolic links to the location where the additions tools were installed; by default, this is {{ic|/opt/VBoxGuestAdditions-''version number''}}. Remove these files too with {{ic|rm -r /opt/VBoxGuestAdditions-''version number''}} as they are not needed. Now you can restart the installation from the right method above.}}<br />
<br />
=== Install the VirtualBox guest kernel modules ===<br />
<br />
==== Guests running an official kernel ====<br />
<br />
* If you are using the {{Pkg|linux}} kernel, make sure the {{pkg|virtualbox-guest-modules}} package is still installed. The latter has been installed when you installed the {{Pkg|virtualbox-guest-utils}} package.<br />
* If you are using the LTS version of the kernel ({{pkg|linux-lts}}), you need to install the {{pkg|virtualbox-guest-modules-lts}} package. {{Pkg|virtualbox-guest-modules}} can now be removed if you want.<br />
* If you are using the {{aur|linux-ck}}, kernel, build the {{aur|virtualbox-ck-guest-modules}} package. {{Pkg|virtualbox-guest-modules}} can now be removed in this case too, if you want.<br />
<br />
==== Guests running a custom kernel ====<br />
<br />
As this installation step is quite similar to the Vitualbox kernel modules section for the host described above, please refer to [[#Install the VirtualBox kernel modules|that section]] for more information and replace all {{Pkg|virtualbox-host-modules}}, {{Pkg|virtualbox-host-dkms}} and {{AUR|vboxhost-hook}} statements by {{Pkg|virtualbox-guest-modules}}, {{Pkg|virtualbox-guest-dkms}} and {{AUR|vboxguest-hook}} respectively.<br />
<br />
=== Load the Virtualbox kernel modules ===<br />
<br />
To load the modules manually, type:<br />
# modprobe -a vboxguest vboxsf vboxvideo<br />
<br />
To load the VirtualBox module at boot time, refer to [[Kernel modules#Automatic module handling]] and create a {{ic|*.conf}} file (e.g. {{ic|virtualbox.conf}}) in {{ic|/etc/modules-load.d/}} with these lines:<br />
{{hc|/etc/modules-load.d/virtualbox.conf|<br />
vboxguest<br />
vboxsf<br />
vboxvideo}}<br />
<br />
Alternatively, [[enable]] the {{ic|vboxservice}} service which loads the modules and synchronizes the guest's system time with the host.<br />
<br />
=== Launch the VirtualBox guest services ===<br />
<br />
After the rather big installation step dealing with VirtualBox kernel modules, now you need to start the guest services. The guest services are actually just a binary executable called {{ic|VBoxClient}} which will interact with your X Window System. {{ic|VBoxClient}} manages the following features:<br />
* shared clipboard and drag and drop between the host and the guest;<br />
* seamless window mode;<br />
* the guest display is automatically resized according to the size of the guest window;<br />
* checking the VirtualBox host version<br />
<br />
All of these features can be enabled independently with their dedicated flags:<br />
$ VBoxClient --clipboard --draganddrop --seamless --display --checkhostversion<br />
<br />
As a shortcut, the {{ic|VBoxClient-all}} bash script enables all of these features. You should set {{ic|VBoxClient}} to be automatically loaded as your [[desktop environment]] or [[window manager]] starts. In practice,<br />
* if you are using a [[desktop environment]], you just need to check a box or add the {{ic|/usr/sbin/VBoxClient-all}} to the autostart section in your [[desktop environment]] settings (the DE will typically set a flag to a ''.desktop'' file in {{ic|~/.config/autostart}}, see [[Autostart#Desktop entries|the Autostart section]] for more details);<br />
* if you do not have any [[desktop environment]], add the following line to the top of {{ic|~/.xinitrc}} above any {{ic|exec}} options. See [[Xinitrc]] for detail.<br />
{{hc|~/.xinitrc|<br />
/usr/bin/VBoxClient-all}}<br />
<br />
VirtualBox can also synchronize the time between the host and the guest. To do this, run {{ic|VBoxService}} as root. To set this to run automatically on boot, simply [[enable]] the {{ic|vboxservice}} service.<br />
<br />
Now, you should have a working Arch Linux guest. Note that features like clipboard sharing are disabled by default in VirtualBox, and you will need to turn them on in the per-VM settings if you actually want to use them (e.g. ''Settings > General > Advanced > Shared Clipboard'').<br />
<br />
If you want to share folders between your host and your Arch Linux guest, read on.<br />
<br />
=== Enable shared folders ===<br />
<br />
Shared folders are managed on the host, in the settings of the Virtual Machine accessible via the GUI of VirtualBox, in the ''Shared Folders'' tab. There, ''Folder Path'', the name of the mount point identified by ''Folder name'', and options like ''Read-only'', ''Auto-mount'' and ''Make permanent'' can be specified. These parameters can be defined with the {{ic|VBoxManage}} command line utility. See [https://www.virtualbox.org/manual/ch04.html#sharedfolders there for more details].<br />
<br />
No matter which method you will use to mount your folder, all methods require some steps first.<br />
<br />
To avoid this issue {{ic|/sbin/mount.vboxsf: mounting failed with the error: No such device}}, make sure the {{ic|vboxsf}} kernel module is properly loaded. It should be, since we enabled all guest kernel modules previously.<br />
<br />
Two additional steps are needed in order for the mount point to be accessible from users other than root:<br />
* the {{Pkg|virtualbox-guest-utils}} package created a group {{ic|vboxsf}} (done in a previous step);<br />
* your username must be in this group, use this command {{ic|gpasswd -a $USER vboxsf}} to add your username and use {{ic|newgrp}} to apply the changes immediately;<br />
<br />
==== Manual mounting ====<br />
<br />
Use the following command to mount your folder in your Arch Linux guest:<br />
# mount -t vboxsf ''shared_folder_name'' ''mount_point_on_guest_system''<br />
<br />
The vboxsf filesystem offers other options which can be displayed with this command:<br />
# mount.vboxsf<br />
<br />
For example if the user was not in the ''vboxsf'' group, we could have used this command to give access our mountpoint to him:<br />
# mount -t vboxsf -o uid=1000,gid=1000 home /mnt/<br />
<br />
Where ''uid'' and ''gid'' are values corresponding to the users we want to give access to. These values are obtained from the {{ic|id}} command run against this user.<br />
<br />
==== Automounting ====<br />
<br />
In order for the automounting feature to work you must have checked the auto-mount checkbox in the GUI or used the optional {{ic|--automount}} argument with the command {{ic|VBoxManage sharedfolder}}.<br />
<br />
The shared folder should now appear in {{ic|/media/sf_''shared_folder_name''}}. If users in {{ic|media}} cannot access the shared folders, check that {{ic|media}} has permissions 755 or has group ownership {{ic|vboxsf}} if using permission 750. This is currently not the default if media is created by installing the {{ic|virtualbox-guest-utils}}.<br />
<br />
You can use symlinks if you want to have a more convenient access and avoid to browse in that directory, e.g.:<br />
$ ln -s /media/sf_''shared_folder_name'' ~/''my_documents''<br />
<br />
==== Mount at boot ====<br />
<br />
You can mount your directory with [[fstab]]. However, to prevent startup problems with systemd, {{ic|1=comment=systemd.automount}} should be added to {{ic|/etc/fstab}}. This way, the shared folders are mounted only when those mount points are accessed and not during startup. This can avoid some problems, especially if the guest additions are not loaded yet when systemd read fstab and mount the partitions.<br />
''desktop'' ''/media/desktop'' vboxsf uid=''user'',gid=''group'',rw,dmode=700,fmode=600,comment=systemd.automount 0 0<br />
<br />
As of 2012-08-02, mount.vboxsf does not support the ''nofail'' option:<br />
''desktop'' ''/media/desktop'' vboxsf uid=''user'',gid=''group'',rw,dmode=700,fmode=600,nofail 0 0<br />
<br />
== Import/export VirtualBox virtual machines from/to other hypervisors ==<br />
<br />
If you plan to use your virtual machine on another hypervisor or want to import in VirtualBox a virtual machine created with another hypervisor, you might be interested in reading the following steps.<br />
<br />
=== Remove additions ===<br />
<br />
Guest additions are available in most hypervisor solutions: VirtualBox comes with the Guest Additions, VMware with the VMware Tools, Parallels with the Parallels Tools, etc. These additional components are designed to be installed inside a virtual machine after the guest operating system has been installed. They consist of device drivers and system applications that optimize the guest operating system for better performance and usability [https://www.virtualbox.org/manual/ch04.html by providing these features].<br />
<br />
If you have installed the additions to your virtual machine, please uninstall them first. Your guest, especially if it is using an OS from the Windows family, might behave weirdly, crash or even might not boot at all if you are still using the specific drivers in another hypervisor.<br />
<br />
=== Use the right virtual disk format ===<br />
<br />
This step will depend on the ability to convert the virtual disk image directly or not.<br />
<br />
==== Automatic tools ====<br />
<br />
Some companies provide tools which offer the ability to create virtual machines from a Windows or GNU/Linux operating system located either in a virtual machine or even in a native installation. With such a product, you do not need to apply this and the following steps and can stop reading here.<br />
* ''[http://www.parallels.com/products/transporter Parallels Transporter]'' which is non free, is a product from Parallels Inc. This solution basically consists in an piece of software called ''agent'' that will be installed in the guest you want to import/convert. Then, Parallels Transporter, <u>which only works on OS X</u>, will create a virtual machine from that ''agent'' which is contacted either by USB or Ethernet network.<br />
* ''[https://www.vmware.com/products/converter/ VMware vCenter Converter]'' which is free upon registration on the VMware webiste, works nearly the same way as Parallels Transporter, but the piece of software that will gather the data to create the virtual machine only works on a Windows platform.<br />
<br />
==== Manual conversion ====<br />
<br />
First, familiarize yourself with the [[#Formats supported by VirtualBox]] and [[Wikipedia:Comparison of platform virtual machines#Image type compatibility|those supported by third-party hypervisors]].<br />
<br />
* Importing or exporting a virtual machine from/to a VMware solution is not a problem at all if you use the VMDK or OVF disk format, otherwise converting [[#VMDK to VDI and VDI to VMDK]] is possible and the aforementioned VMware vCenter Converter tool is available.<br />
<br />
* Importing or exporting from/to QEMU is not a problem neither: some QEMU formats are supported directly by VirtualBox and conversion between [[#QCOW2 to VDI and VDI to QCOW2]] is still available if needed.<br />
<br />
* Importing or exporting from/to Parallels hypervisor is the hardest way: Parallels does only support its own HDD format (even the standard and portable OVF format is not supported!).<br />
:* To export your virtual machine to Parallels, you will need to use the Parallels Transporter tool described above.<br />
:* To import your virtual machine to VirtualBox, you will need to use the VMware vCenter Converter described above to convert the VM to the VMware format first. Then, apply the solution to migrate from VMware.<br />
<br />
=== Create the VM configuration for your hypervisor ===<br />
<br />
Each hypervisor have their own virtual machine configuration file: {{ic|.vbox}} for VirtualBox, {{ic|.vmx}} for VMware, a {{ic|config.pvs}} file located in the virtual machine bundle ({{ic|.pvm}} file), etc. You will have thus to recreate a new virtual machine in your new destination hypervisor and specify its hardware configuration as close as possible as your initial virtual machine.<br />
<br />
Pay a close attention to the firmware interface (BIOS or UEFI) used to install the guest operating system. While an option is available to choose between these 2 interfaces on VirtualBox and on Parallels solutions, on VMware, you will have to add manually the following line to your ''.vmx'' file.<br />
<br />
{{hc|ArchLinux_vm.vmx|2=<br />
firmware = "efi"<br />
}}<br />
<br />
Finally, ask your hypervisor to use the existing virtual disk you have converted and launch the virtual machine.<br />
{{Tip|<br />
* On VirtualBox, if you do not want to browse the whole GUI to find the right location to add your new virtual drive device, you can [[#Replace a virtual disk manually from the .vbox file]], or use the {{ic|VBoxManage storageattach}} described in [[#Increase virtual disks]] or in the [https://www.virtualbox.org/manual/ch08.html#vboxmanage-storageattach VirtualBox manual page].<br />
* Similarly, in VMware products, you can replace the location of the current virtual disk location by adapting the ''.vmdk'' file location in your ''.vmx'' configuration file.}}<br />
<br />
== Virtual disks management ==<br />
<br />
=== Formats supported by VirtualBox ===<br />
<br />
VirtualBox supports the following virtual disk formats:<br />
<br />
* VDI: The Virtual Disk Image is the VirtualBox own open container used by default when you create a virtual machine with VirtualBox.<br />
<br />
* VMDK: The Virtual Machine Disk has been initially developed by VMware for their products. The specification was initially closed source, but it became now an open format which is fully supported by VirtualBox. This format offers the ability to be split into several 2GB files. This feature is specially useful if you want to store the virtual machine on machines which do not support very large files. Other formats, excluding the HDD format from Parallels, do not provide such an equivalent feature.<br />
<br />
* VHD: The Virtual Hard Disk is the format used by Microsoft in Windows Virtual PC and Hyper-V. If you intend to use any of these Microsoft products, you will have to choose this format.<br />
:{{Tip|Since Windows 7, this format can be mounted directly without any additional application.}} <br />
<br />
* VHDX (read only): This is the eXtended version of the Virtual Hard Disk format developed by Microsoft, which has been released on 2012-09-04 with Hyper-V 3.0 coming with Windows Server 2012. This new version of the disk format does offer enhanced performance (better block alignment), larger blocks size, and journal support which brings power failure resiliency. VirtualBox [https://www.virtualbox.org/manual/ch15.html#idp63002176 should support this format in read only].<br />
<br />
* Version 2 of the HDD: The HDD format is developed by Parallels Inc and used in their hypervisor solutions like Parallels Desktop for Mac. Newer versions of this format (i.e. 3 and 4) are not supported due to the lack of documentation for this proprietary format. {{Note|There is currently a controversy regarding the support of the version 2 of the format. While the official VirtualBox manual [https://www.virtualbox.org/manual/ch05.html#vdidetails only reports the second version of the HDD file format as supported], Wikipedia's contributors are [[Wikipedia:Comparison of platform virtual machines#Image type compatibility|reporting the first version may work too]]. Help is welcome if you can perform some tests with the first version of the HDD format.}}<br />
<br />
* QED: The QEMU Enhanced Disk format is an old file format for QEMU, another free and open source hypervisor. This format was designed from 2010 in a way to provide a superior alternative to QCOW2 and others. This format features a fully asynchronous I/O path, strong data integrity, backing files, and sparse files. QED format is supported only for compatibility with virtual machines created with old versions of QEMU.<br />
<br />
* QCOW: The QEMU Copy On Write format is the current format for QEMU. The QCOW format does support zlib-based transparent compression and encryption (the latter has flaw and is not recommended). QCOW is available in two versions: QCOW and QCOW2. The latter tends to supersede the first one. QCOW is [https://www.virtualbox.org/manual/ch15.html#idp63002176 currently fully supported by VirtualBox]. QCOW2 comes in two revisions: QCOW2 0.10 and QCOW2 1.1 (which is the default when you create a virtual disk with QEMU). VirtualBox does not support this QCOW2 format (both revisions have been tried).<br />
<br />
* OVF: The Open Virtualization Format is an open format which has been designed for interoperability and distributions of virtual machines between different hypervisors. VirtualBox supports all revisions of this format via the [https://www.virtualbox.org/manual/ch08.html#idp55423424 {{ic|VBoxManage}} import/export feature] but with [https://www.virtualbox.org/manual/ch14.html#KnownProblems known limitations].<br />
<br />
* RAW: This is the mode when the virtual disk is exposed directly to the disk without being contained in a specific file format container. VirtualBox supports this feature in several ways: converting RAW disk [https://www.virtualbox.org/manual/ch08.html#idp59139136 to a specific format], or by [https://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi cloning a disk to RAW], or by using directly a VMDK file [https://www.virtualbox.org/manual/ch09.html#idp57804112 which points to a physical disk or a simple file].<br />
<br />
=== Disk image format conversion ===<br />
<br />
==== VMDK to VDI and VDI to VMDK ====<br />
<br />
VirtualBox can handle back and forth conversion between VDI and VMDK by itself with [https://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi {{ic|VBoxManage clonehd}}].<br />
<br />
VMDK to VDI:<br />
<br />
$ VBoxManage clonehd ''source.vmdk'' ''destination.vdi'' --format VDI<br />
<br />
VDI to VMDK:<br />
<br />
$ VBoxManage clonehd ''source.vdi'' ''destination.vmdk'' --format VMDK<br />
<br />
==== VHD to VDI and VDI to VHD ====<br />
<br />
VirtualBox can handle conversion back and forth this format with [https://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi {{ic|VBoxManage clonehd}}] too.<br />
<br />
VHD to VDI:<br />
<br />
$ VBoxManage clonehd ''source.vhd'' ''destination.vdi'' --format VDI<br />
<br />
VDI to VHD:<br />
<br />
$ VBoxManage clonehd ''source.vdi'' ''destination.vhd'' --format VHD<br />
<br />
==== QCOW2 to VDI and VDI to QCOW2 ====<br />
<br />
[https://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi {{ic|VBoxManage clonehd}}] cannot handle the QEMU format conversion; we will thus rely on another tool. The {{ic|qemu-img}} command from {{Pkg|qemu}} can be used to convert images back and forth from VDI to QCOW2. {{Note|{{ic|qemu-img}} can handle a bunch of other formats too. According to the {{ic|qemu-img --help}}, here are the supported formats this tool supports: "''vvfat vpc vmdk vhdx vdi ssh sheepdog sheepdog sheepdog raw host_cdrom host_floppy host_device file qed qcow2 qcow parallels nbd nbd nbd iscsi dmg tftp ftps ftp https http cow cloop bochs blkverify blkdebug'".}}<br />
<br />
QCOW2 to VDI:<br />
<br />
$ qemu-img convert -pO vdi ''source.qcow2'' ''destination.vdi''<br />
<br />
VDI to QCOW2:<br />
<br />
$ qemu-img convert -pO qcow2 ''source.vdi'' ''destination.qcow2''<br />
<br />
As QCOW2 comes in two revisions (see [[#Formats supported by VirtualBox]], use the flag {{ic|1=-o compat=}} to specify the revision.<br />
<br />
$ qemu-img convert -pO qcow2 ''source.vdi'' ''destination.qcow2'' -o compat=0.10<br />
or<br />
$ qemu-img convert -pO qcow2 ''source.vdi'' ''destination.qcow2'' -o compat=1.1<br />
<br />
{{Tip|The {{ic|-p}} parameter is used to get the progression of the conversion task.}}<br />
<br />
=== Mount virtual disks ===<br />
<br />
==== VDI ====<br />
<br />
Mounting vdi images only works with fixed size images (a.k.a. static images); dynamic (dynamically size allocating) images are not easily mountable.<br />
<br />
The offset of the partition (within the vdi) is needed, then add the value of {{ic|offData}} to {{ic|32256}} (e.g. 69632 + 32256 = 101888):<br />
<br />
$ VBoxManage internalcommands dumphdinfo <storage.vdi> | grep "offData"<br />
<br />
The can now be mounted with:<br />
<br />
# mount -t ext4 -o rw,noatime,noexec,loop,offset=101888 <storage.vdi> /mntpoint/<br />
<br />
You can also use [https://github.com/pld-linux/VirtualBox/blob/master/mount.vdi mount.vdi] script that, which you can use as (install script itself to {{ic|/usr/bin/}}):<br />
<br />
# mount -t vdi -o fstype=ext4,rw,noatime,noexec ''vdi_file_location'' ''/mnt/''<br />
<br />
Alternately you can use {{Pkg|qemu}}'s kernel module that can do this [[http://bethesignal.org/blog/2011/01/05/how-to-mount-virtualbox-vdi-image/ attrib]]:<br />
<br />
# modprobe nbd max_part=16<br />
# qemu-nbd -c /dev/nbd0 <storage.vdi><br />
# mount /dev/nbd0p1 /mnt/dir/<br />
# # to unmount:<br />
# umount /mnt/dir/<br />
# qemu-nbd -d /dev/nbd0<br />
<br />
If the partition nodes are not propagated try using {{ic|partprobe /dev/nbd0}}; otherwise, a vdi partition can be mapped directly to a node by: {{ic|qemu-nbd -P 1 -c /dev/nbd0 <storage.vdi>}}.<br />
<br />
=== Compact virtual disks ===<br />
<br />
Compacting virtual disks only works with {{ic|.vdi}} files and basically consists in the following steps.<br />
<br />
Boot your virtual machine and remove all bloat manually or by using cleaning tools like {{Pkg|bleachbit}} which is [http://bleachbit.sourceforge.net/download/windows available for Windows systems too].<br />
<br />
Wiping free space with zeroes can be achieved with several tools:<br />
* If you were previously using Bleachbit, check the checkbox ''System > Free disk space'' in the GUI, or use {{ic|bleachbit -c system.free_disk_space}} in CLI;<br />
* On UNIX-based systems, by using {{ic|dd}} or preferably {{Pkg|dcfldd}} (see [http://superuser.com/a/355322 here] to learn the differences) :<br />
:{{bc|1=# dcfldd if=/dev/zero of=''/fillfile'' bs=4M}}<br />
:When {{ic|fillfile}} reaches the limit of the partition, you will get a message like {{ic|1280 blocks (5120Mb) written.dcfldd:: No space left on device}}. This means that all of the user-space and non-reserved blocks of the partition will be filled with zeros. Using this command as root is important to make sure all free blocks have been overwritten. Indeed, by default, when using partitions with ext filesystem, a specified percentage of filesystem blocks is reserved for the super-user (see the {{ic|-m}} argument in the {{ic|mkfs.ext4}} man pages or use {{ic|tune2fs -l}} to see how much space is reserved for root applications).<br />
:When the aforementioned process has completed, you can remove the file {{ic|''fillfile''}} you created.<br />
<br />
* On Windows, there are two tools available:<br />
:*{{ic|sdelete}} from the [http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx Sysinternals Suite], type {{ic|sdelete -s -z ''c:''}}, where you need to reexecute the command for each drive you have in your virtual machine;<br />
:* or, if you love scripts, there is a [http://blog.whatsupduck.net/2012/03/powershell-alternative-to-sdelete.html PowerShell solution], but which still needs to be repeated for all drives.<br />
::{{bc|PS> ./Write-ZeroesToFreeSpace.ps1 -Root ''c:\'' -PercentFree 0}}<br />
::{{Note|This script must be run in a PowerShell environment with administrator privileges. By default, scripts cannot be run, ensure the execution policy is at least on {{ic|RemoteSigned}} and not on {{ic|Restricted}}. This can be checked with {{ic|Get-ExecutionPolicy}} and the required policy can be set with {{ic|Set-ExecutionPolicy RemoteSigned}}.}}<br />
<br />
Once the free disk space have been wiped, shut down your virtual machine.<br />
<br />
The next time you boot your virtual machine, it is recommended to do a filesystem check.<br />
* On UNIX-based systems, you can use {{ic|fsck}} manually;<br />
:* On GNU/Linux systems, and thus on Arch Linux, you can force a disk check at boot [[Fsck#Forcing the check|thanks to a kernel boot parameter]];<br />
* On Windows systems, you can use:<br />
:* either {{ic|chkdsk ''c:'' /F}} where {{ic|''c:''}} needs to be replaced by each disk you need to scan and fix errors;<br />
:* or {{ic|FsckDskAll}} [http://therightstuff.de/2009/02/14/ChkDskAll-ChkDsk-For-All-Drives.aspx from here] which is basically the same software as {{ic|chkdsk}}, but without the need to repeat the command for all drives;<br />
<br />
Now, remove the zeros from the {{ic|vdi}} file with {{ic|[https://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi VBoxManage modifyhd]}}:<br />
$ VBoxManage modifyhd ''your_disk.vdi'' --compact<br />
<br />
{{Note|If your virtual machine has snapshots, you need to apply the above command on each {{ic|.vdi}} files you have.}}<br />
<br />
=== Increase virtual disks ===<br />
<br />
If you are running out of space due to the small hard drive size you selected when you created your virtual machine, the solution adviced by the VirtualBox manual is to use [https://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi {{ic|VBoxManage modifyhd}}]. However this command only works for VDI and VHD disks and only for the dynamically allocated variants. If you want to resize a fixed size virtual disk disk too, read on this trick which works either for a Windows or UNIX-like virtual machine.<br />
<br />
First, create a new virtual disk next to the one you want to increase:<br />
$ VBoxManage createhd -filename ''new.vdi'' --size ''10000''<br />
<br />
where size is in MiB, in this example 10000MiB ~= 10GiB, and ''new.vdi'' is name of new hard drive to be created.<br />
<br />
Next, the old virtual disk needs to be cloned to the new one which this may take some time:<br />
$ VBoxManage clonehd ''old.vdi'' ''new.vdi'' --existing<br />
<br />
{{Note|By default, this command uses the ''Standard'' (corresponding to dynamic allocated) file format variant and thus will not use the same file format variant as your source virtual disk. If your ''old.vdi'' has a fixed size and you want to keep this variant, add the parameter {{ic|--variant Fixed}}.}}<br />
<br />
Detach the old hard drive and attach new one, replace all mandatory italic arguments by your own:<br />
$ VBoxManage storageattach ''VM_name'' --storagectl ''SATA'' --port ''0'' --medium none<br />
$ VBoxManage storageattach ''VM_name'' --storagectl ''SATA'' --port ''0'' --medium ''new.vdi'' --type hdd<br />
<br />
To get the storage controller name and the port number, you can use the command {{ic|VBoxManage showvminfo ''VM_name''}}. Among the output you will get such a result (what you are looking for is in italic):<br />
<br />
{{bc|<br />
[...]<br />
Storage Controller Name (0): IDE<br />
Storage Controller Type (0): PIIX4<br />
Storage Controller Instance Number (0): 0<br />
Storage Controller Max Port Count (0): 2<br />
Storage Controller Port Count (0): 2<br />
Storage Controller Bootable (0): on<br />
Storage Controller Name (1): SATA<br />
Storage Controller Type (1): IntelAhci<br />
Storage Controller Instance Number (1): 0<br />
Storage Controller Max Port Count (1): 30<br />
Storage Controller Port Count (1): 1<br />
Storage Controller Bootable (1): on<br />
IDE (1, 0): Empty<br />
''SATA'' (''0'', 0): /home/wget/IT/Virtual_machines/GNU_Linux_distributions/ArchLinux_x64_EFI/Snapshots/{6bb17af7-e8a2-4bbf-baac-fbba05ebd704}.vdi (UUID: 6bb17af7-e8a2-4bbf-baac-fbba05ebd704)<br />
[...]}}<br />
<br />
Download [http://gparted.org/download.php GParted live image] and mount it as a virtual CD/DVD disk file, boot your virtual machine, increase/move your partitions, umount GParted live and reboot.<br />
<br />
{{Note|On GPT disks, increasing the size of the disk will result in the backup GPT header not being at the end of the device. GParted will ask to fix this, click on ''Fix'' both times. On MBR disks, you do not have such a problem as this partition table as no trailer at the end of the disk.}}<br />
<br />
Finally, unregister the virtual disk from VirtualBox and remove the file:<br />
$ VBoxManage closemedium disk ''old.vdi''<br />
$ rm ''old.vdi''<br />
<br />
=== Replace a virtual disk manually from the .vbox file ===<br />
<br />
If you think that editing a simple ''XML'' file is more convenient than playing with the GUI or with {{ic|VBoxManage}} and you want to replace (or add) a virtual disk to your virtual machine, in the ''.vbox'' configuration file corresponding to your virtual machine, simply replace the GUID, the file location and the format to your needs:<br />
<br />
{{hc|ArchLinux_vm.vbox|2=<br />
<HardDisk uuid="''{670157e5-8bd4-4f7b-8b96-9ee412a712b5}''" location="''ArchLinux_vm.vdi''" format="''VDI''" type="Normal"/><br />
}}<br />
<br />
then in the {{ic|<AttachedDevice>}} sub-tag of {{ic|<StorageController>}}, replace the GUID by the new one.<br />
<br />
{{hc|ArchLinux_vm.vbox|2=<br />
<AttachedDevice type="HardDisk" port="0" device="0"><br />
<Image uuid="''{670157e5-8bd4-4f7b-8b96-9ee412a712b5}''"/><br />
</AttachedDevice><br />
}}<br />
<br />
{{Note|If you do not know the GUID of the drive you want to add, you can use the {{ic|VBoxManage showhdinfo ''file''}}. If you previously used {{ic|VBoxManage clonehd}} to copy/convert your virtual disk, this command should have outputted the GUID just after the copy/conversion completed. Using a random GUID does not work, as each [http://www.virtualbox.org/manual/ch05.html#cloningvdis UUID is stored inside each disk image].}}<br />
<br />
==== Transfer between Linux host and other OS ====<br />
<br />
The information about path to harddisks and the snapshots is stored between {{ic|<HardDisks> .... </HardDisks>}} tags in the file with the ''.vbox'' extension. You can edit them manually or use this script where you will need change only the path or use defaults, assumed that ''.vbox'' is in the same directory with a virtual harddisk and the snapshots folder. It will print out new configuration to stdout.<br />
<br />
{{bc|1=<br />
#!/bin/bash<br />
NewPath="${PWD}/"<br />
Snapshots="Snapshots/"<br />
Filename="$1"<br />
<br />
awk -v SetPath="$NewPath" -v SnapPath="$Snapshots" '{if(index($0,"<HardDisk uuid=") != 0){A=$3;split(A,B,"=");<br />
L=B[2];<br />
gsub(/\"/,"",L);<br />
sub(/^.*\//,"",L);<br />
sub(/^.*\\/,"",L);<br />
if(index($3,"{") != 0){SnapS=SnapPath}else{SnapS=""};<br />
print $1" "$2" location="\"SetPath SnapS L"\" "$4" "$5}<br />
else print $0}' "$Filename"}}<br />
<br />
{{Note|<br />
* If you will prepare virtual machine for use in Windows host then in the path name end you should use backslash \ instead of / .<br />
* The script detects snapshots by looking for {{ic|{}} in the file name.<br />
* To make it run on a new host you will need to add it first to the register by clicking on '''Machine -> Add...''' or use hotkeys Ctrl+A and then browse to ''.vbox'' file that contains configuration or use command line {{ic|VBoxManage registervm ''filename''.vbox}}}}<br />
<br />
=== Clone a virtual disk and assigning a new UUID to it ===<br />
<br />
UUIDs are widely used by VirtualBox. Each virtual machines and each virtual disk of a virtual machine must have a different UUID. When you launch a virtual machine in VirtualBox, the latter will keep track of all UUID of your virtual machine instance. See the [http://www.virtualbox.org/manual/ch08.html#vboxmanage-list {{ic|VBoxManage list}}] to list the items registered with VirtualBox.<br />
<br />
If you cloned a virtual disk manually by copying the virtual disk file, you will need to assign a new UUID to the cloned virtual drive if you want to use the disk in the same virtual machine or even in another (if that one has already been opened, and thus registered, with VirtualBox).<br />
<br />
You can use this command to assign a new UUID to your virtual disk: <br />
$ VBoxManage internalcommands sethduuid ''/path/to/disk.vdi''<br />
<br />
{{Tip|In the future, to avoid copying the virtual disk and assigning a new UUID to your file manually, use {{ic|[http://www.virtualbox.org/manual/ch08.html#vboxmanage-clonevdi VBoxManage clonehd]}} instead.}}<br />
<br />
{{Note|The commands above supports [[#Formats supported by VirtualBox|all virtual disk formats supported by VirtualBox]].}}<br />
<br />
== Advanced configuration ==<br />
<br />
=== Virtual machine launch management ===<br />
<br />
==== Starting virtual machines with a service ====<br />
<br />
Find hereafter the implementation details of a systemd service that will be used to consider a virtual machine as a service.<br />
<br />
{{hc|/etc/systemd/system/vboxvmservice@.service|2=<br />
[Unit]<br />
Description=VBox Virtual Machine %i Service<br />
Requires=systemd-modules-load.service<br />
After=systemd-modules-load.service<br />
<br />
[Service]<br />
User=''username''<br />
Group=vboxusers<br />
ExecStart=/usr/bin/VBoxHeadless -s %i<br />
ExecStop=/usr/bin/VBoxManage controlvm %i savestate<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
{{Note|Replace {{ic|''username''}} with a user that is a member of the {{ic|vboxusers}} group. Make sure the user chosen is the same user that will create/import virtual machines, otherwise the user will not see the VM appliances.}}<br />
<br />
{{Note|If you have multiple virtual machines managed by Systemd and they are not stopping properly, try to add {{ic|RemainAfterExit&#61;true}} and {{ic|KillMode&#61;none}} at the end of {{ic|[Service]}} section.}}<br />
<br />
To enable the service that will launch the virtual machine at next boot, use:<br />
# systemctl enable vboxvmservice@''your_virtual_machine_name''<br />
<br />
To start the service that will launch directly the virtual machine, use:<br />
# systemctl start vboxvmservice@''your_virtual_machine_name''<br />
<br />
VirtualBox 4.2 introduces [http://lifeofageekadmin.com/how-to-set-your-virtualbox-vm-to-automatically-startup/ a new way] for UNIX-like systems to have virtual machines started automatically, other than using a systemd service.<br />
<br />
==== Starting virtual machines with a keyboard shortcut ====<br />
<br />
It can be useful to start virtual machines directly with a keyboard shortcut instead of using the VirtualBox interface (GUI or CLI). For that, you can simply define key bindings in {{ic|.xbindkeysrc}}. Please refer to [[Xbindkeys]] for more details.<br />
<br />
Example, using the {{ic|Fn}} key of a laptop with an unused battery key ({{ic|F3}} on the computer used in this example):<br />
"VBoxManage startvm 'Windows 7'"<br />
m:0x0 + c:244<br />
XF86Battery<br />
<br />
{{Note|If you have a space in the name of your virtual machine, then enclose it with single apostrophes like made in the example just above.}}<br />
<br />
=== Use specific device in the virtual machine ===<br />
<br />
==== Using USB webcam / microphone ====<br />
<br />
{{Note|You will need to have VirtualBox extension pack installed before following the steps below. See [[#Extension pack]] for details.}}<br />
<br />
# Make sure the virtual machine is not running and your webcam / microphone is not being used.<br />
# Bring up the main VirtualBox window and go to settings for Arch machine. Go to USB section.<br />
# Make sure "Enable USB Controller" is selected. Also make sure that "Enable USB 2.0 (EHCI) Controller" is selected too.<br />
# Click the "Add filter from device" button (the cable with the '+' icon).<br />
# Select your USB webcam/microphone device from the list.<br />
# Now click OK and start your VM.<br />
<br />
==== Detecting web-cams and other USB devices ====<br />
<br />
Make sure you filter any devices that are not a keyboard or a mouse so they do not start up at boot and this insures that Windows will detect the device at start-up.<br />
<br />
=== Access a guest server ===<br />
<br />
To access [[Wikipedia:Apache_HTTP_Server|Apache server]] on a Virtual Machine from the host machine '''only''', simply execute the following lines on the host:<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/''pcnet''/0/LUN#0/Config/Apache/HostPort" ''8888''<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/''pcnet''/0/LUN#0/Config/Apache/GuestPort" ''80''<br />
$ VBoxManage setextradata GuestName "VBoxInternal/Devices/''pcnet''/0/LUN#0/Config/Apache/Protocol" TCP<br />
Where 8888 is the port the host should listen on and 80 is the port the VM will send Apache's signal on.<br />
<br />
To use a port lower than 1024 on the host machine, changes need to be made to the firewall on that host machine. This can also be set up to work with SSH or any other services by changing "Apache" to the corresponding service and ports. <br />
<br />
{{note|{{ic|pcnet}} refers to the network card of the VM. If you use an Intel card in your VM settings, change {{ic|pcnet}} to {{ic|e1000}}.}}<br />
<br />
To communicate between the VirtualBox guest and host using ssh, the server port must be forwarded under Settings > Network. When connecting from the client/host, connect to the IP address of the client/host machine, as opposed to the connection of the other machine. This is because the connection will be made over a virtual adapter.<br />
<br />
=== D3D acceleration in Windows guests ===<br />
<br />
Recent versions of Virtualbox have support for accelerating OpenGL inside guests. This can be enabled with a simple checkbox in the machine's settings, right below where video ram is set, and installing the Virtualbox guest additions. However, most Windows games use Direct3D (part of DirectX), not OpenGL, and are thus not helped by this method. However, it is possible to gain accelerated Direct3D in your Windows guests by borrowing the d3d libraries from Wine, which translate d3d calls into OpenGL, which is then accelerated. These libraries are now part of Virtualbox guest additions software. <br />
<br />
After enabling OpenGL acceleration as described above, reboot the guest into safe mode (press F8 before the Windows screen appears but after the Virtualbox screen disappears), and install Virtualbox guest additions, during install enable checkbox "Direct3D support". Reboot back to normal mode and you should have accelerated Direct3D. <br />
<br />
{{Note | This hack may or may not work for some games depending on what hardware checks they make and what parts of D3D they use.}}<br />
{{Note | This was tested on Windows XP, 7 and 8.1. If method does not work on your Windows version please add data here.}}<br />
<br />
=== VirtualBox on a USB key ===<br />
When using VirtualBox on a USB key, for example to start an installed machine with an ISO image, you will manually have to create VDMKs from the existing drives. However, once the new VMDKs are saved and you move on to another machine, you may experience problems launching an appropriate machine again. To get rid of this issue, you can use the following script to launch VirtualBox. This script will clean up and unregister old VMDK files and it will create new, proper VMDKs for you:<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
<br />
# Erase old VMDK entries<br />
rm ~/.VirtualBox/*.vmdk<br />
<br />
# Clean up VBox-Registry<br />
sed -i '/sd/d' ~/.VirtualBox/VirtualBox.xml<br />
<br />
# Remove old harddisks from existing machines<br />
find ~/.VirtualBox/Machines -name \*.xml | while read file; do<br />
line=`grep -e "type\=\"HardDisk\"" -n $file | cut -d ':' -f 1`<br />
if [ -n "$line" ]; then<br />
sed -i ${line}d $file<br />
sed -i ${line}d $file<br />
sed -i ${line}d $file<br />
fi<br />
sed -i "/rg/d" $file<br />
done<br />
<br />
# Delete prev-files created by VirtualBox<br />
find ~/.VirtualBox/Machines -name \*-prev -exec rm '{}' \;<br />
<br />
# Recreate VMDKs<br />
ls -l /dev/disk/by-uuid | cut -d ' ' -f 9,11 | while read ln; do<br />
if [ -n "$ln" ]; then<br />
uuid=`echo "$ln" | cut -d ' ' -f 1`<br />
device=`echo "$ln" | cut -d ' ' -f 2 | cut -d '/' -f 3 | cut -b 1-3`<br />
<br />
# determine whether drive is mounted already<br />
checkstr1=`mount | grep $uuid`<br />
checkstr2=`mount | grep $device`<br />
checkstr3=`ls ~/.VirtualBox/*.vmdk | grep $device`<br />
if [[ -z "$checkstr1" && -z "$checkstr2" && -z "$checkstr3" ]]; then<br />
VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/$device.vmdk -rawdisk /dev/$device -register<br />
fi<br />
fi<br />
done<br />
<br />
# Start VirtualBox<br />
VirtualBox<br />
</nowiki>}}<br />
Note that your user has to be added to the "disk" group to create VMDKs out of existing drives.<br />
<br />
=== Run a native Arch Linux installation inside VirtualBox ===<br />
<br />
If you have a dual boot system between Arch Linux and another operating system, it can become rapidly tedious to switch back and forth if you need to work in both. Also, by using virtual machines, you just have a tiny fragment of your computer power, which can cause issues when working on projects requiring performance.<br />
<br />
This guide will let you reuse, in a virtual machine, your native Arch Linux installation when you are running your second operating system. This way, you keep the ability to run each operating system natively, but have the option to run your Arch Linux installation inside a virtual machine.<br />
<br />
==== Make sure you have a persistent naming scheme ====<br />
<br />
Depending on your hard drive setup, device files representing your hard drives may appear differently when you will run your Arch Linux installation natively or in virtual machine. This problem occurs when using [[RAID#Implementation|FakeRAID]] for example. The fake RAID device will be mapped in {{ic|/dev/mapper/}} when you run your GNU/Linux distribution natively, while the devices are still accessible separately. However, in your virtual machine, it can appear without any mapping in {{ic|/dev/sdaX}} for example, because the drivers controlling the fake RAID in your host operating system (e.g. Windows) are abstracting the fake RAID device.<br />
<br />
To circumvent this problem, we will need to use an addressing scheme that is persistent to both systems. This can be achieved using [[Fstab#UUIDs|UUIDs]] in your {{ic|/etc/fstab}} file. Make sure your [[fstab]] file is using UUIDs, otherwise fix this issue. Read [[fstab]] and [[Persistent block device naming]].<br />
<br />
{{ic|/etc/fstab}} is not the only location where UUIDs are used. Bootloaders and boot managers make use of them too. Now, make sure these are really using UUIDs.<br />
<br />
; [[GRUB Legacy]]<br />
If you are still using the old [[GRUB Legacy]], maybe is it [[GRUB Legacy#Upgrading to GRUB2|time to upgrade]], since this package is now dropped from the official Arch Linux repositories. If you want to keep it, edit {{ic|/boot/grub/menu.lst}} and replace the {{ic|1=root=/dev/sdXX}} statement in your Arch Linux boot entry by the Linux UUID mapping in {{ic|/dev/disk/by-uuid/}} corresponding to your root partition.<br />
<br />
title Arch Linux<br />
root<br />
kernel /vmlinuz-linux root=''/dev/disk/by-uuid/0a3407de-014b-458b-b5c1-848e92a327a3'' ro vga=773<br />
initrd /initramfs-linux-vbox.img<br />
<br />
Repeat the process here, for the fallback entry.<br />
<br />
; [[GRUB]]<br />
If you are running the most recent version of [[GRUB]]; you have nothing to do. Yet another reason to upgrade to GRUB 2.<br />
<br />
{{Warning|<br />
* Make sure your host partition is only accessible in read only from your Arch Linux virtual machine, this will avoid risk of corruptions if you were to corrupt that host partition by writing on it due to lack of attention.<br />
* You should NEVER allow VirtualBox to boot from the entry of your second operating system, which, as a reminder, is used as the host for this virtual machine! Take thus a special care especially if your default boot loader/boot manager entry is your other operating system. Give a more important timeout or put it below in the order of preferences.}}<br />
<br />
==== Make sure your mkinitcpio image is correct ====<br />
<br />
Make sure your [[Mkinitcpio|mkinitcpio]] configuration uses the [[Mkinitcpio#HOOKS|HOOK]] {{ic|block}}:<br />
<br />
{{hc|/etc/mkinitcpio.conf|2=<br />
[...]<br />
HOOKS="base udev autodetect modconf ''block'' filesystems keyboard fsck"<br />
[...]}}<br />
<br />
If it is not present, add it and [[Mkinitcpio#Image creation and activation|regenerate your initramfs]]:<br />
<br />
# mkinitcpio -p linux<br />
<br />
==== Create a VM configuration to boot from the physical drive ====<br />
<br />
===== Create a raw disk .vmdk image =====<br />
<br />
Now, we need to create a new virtual machine which will use a [https://www.virtualbox.org/manual/ch09.html#rawdisk RAW disk] as virtual drive, for that we will use a ~ 1Kio VMDK file which will be mapped to a physical disk. Unfortunately, VirtualBox does not have this option in the GUI, so we will have to use the console and use an internal command of {{ic|VBoxManage}}.<br />
<br />
Boot the host which will use the Arch Linux virtual machine. The command will need to be adapted according to the host you have.<br />
<br />
; On a GNU/Linux host:<br />
<br />
There is 3 ways to achieve this: login as root, changing the access right of the device with {{ic|chmod}}, adding your user to the {{ic|disk}} group. The latter way is the more elegant, let us proceed that way:<br />
<br />
# gpasswd -a ''your_user'' disk<br />
<br />
Apply the new group settings with:<br />
<br />
$ newgrp<br />
<br />
Now, you can use the command:<br />
<br />
$ VBoxManage internalcommands createrawvmdk -filename ''/path/to/file.vmdk'' -rawdisk ''/dev/sdb'' -register <br />
<br />
Adapt the above command to your need, especially the path and filename of the VMDK location and the raw disk location to map which contain your Arch Linux installation.<br />
<br />
; On a Windows host:<br />
<br />
Open a command prompt must be run as administrator. {{Tip|On Windows, open your start menu/start screen, type {{ic|cmd}}, and type {{ic|Ctrl+Shift+Enter}}, this is a shortcut to execute the selected program with admin rights.}}<br />
<br />
On Windows, as the disk filename convention is different from UNIX, use this command to determine what drives you have in your Windows system and their location:{{hc|# wmic diskdrive get name,size,model|<br />
Model Name Size<br />
WDC WD40EZRX-00SPEB0 ATA Device \\.\PHYSICALDRIVE1 4000783933440<br />
KINGSTON SVP100S296G ATA Device \\.\PHYSICALDRIVE0 96024821760<br />
Hitachi HDT721010SLA360 ATA Device \\.\PHYSICALDRIVE2 1000202273280<br />
Innostor Ext. HDD USB Device \\.\PHYSICALDRIVE3 1000202273280}}<br />
<br />
In this example, as the Windows convention is {{ic|\\.\PhysicalDriveX}} where X is a number from 0, {{ic|\\.\PHYSICALDRIVE1}} could be analogous to {{ic|/dev/sdb}} from the Linux disk terminology.<br />
<br />
To use the {{ic|VBoxManage}} command on Windows, you can either, change the current directory to your VirtualBox installation folder first with {{ic|cd C:\Program Files\Oracle\VirtualBox\}}<br />
<br />
# .\VBoxManage.exe internalcommands createrawvmdk -filename C:\file.vmdk -rawdisk \\.\PHYSICALDRIVE1<br />
<br />
or use the absolute path name: <br />
<br />
# "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands createrawvmdk -filename C:\file.vmdk -rawdisk \\.\PHYSICALDRIVE1<br />
<br />
; On another OS host:<br />
<br />
There are other limitations regarding the aforementioned command when used in other operating systems like OS X, please thus [https://www.virtualbox.org/manual/ch09.html#rawdisk read carefully the manual page], if you are concerned.<br />
<br />
===== Create the VM configuration file =====<br />
<br />
{{Note|<br />
* To make use of the VBoxManage command on Windows, you need to change the current directory to your VirtualBox installation folder first: cd C:\Program Files\Oracle\VirtualBox\.<br />
* Windows makes use of backslashes instead of slashes, please replace all slashes / occurrences by backslashes \ in the commands that follow when you will use them.}}<br />
<br />
After, we need to create a new machine (replace the ''VM_name'' to your convenience) and register it with VirtualBox.<br />
<br />
$ VBoxManage createvm -name ''VM_name'' -register<br />
<br />
Then, the newly raw disk needs to be attached to the machine. This will depend if your computer or actually the root of your native Arch Linux installation is on an IDE or a SATA controller.<br />
<br />
If you need an IDE controller:<br />
<br />
$ VBoxManage storagectl ''VM_name'' --name "IDE Controller" --add ide<br />
$ VBoxManage storageattach ''VM_name'' --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /path/to/file.vmdk<br />
<br />
otherwise:<br />
<br />
$ VBoxManage storagectl ''VM_name'' --name "SATA Controller" --add sata<br />
$ VBoxManage storageattach ''VM_name'' --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium /path/to/file.vmdk<br />
<br />
While you continue using the CLI, it is recommended to use the VirtualBox GUI, to personalise the virtual machine configuration. Indeed, you must specify its hardware configuration as close as possible as your native machine: turning on the 3D acceleration, increasing video memory, setting the network interface, etc.<br />
<br />
==== Install the Guest Additions ====<br />
<br />
Finally, you may want to seamlessly integrate your Arch Linux with your host operating system and allow copy pasting between both OSes. Please refer to [[#Install the Guest Additions]] for that, since this Arch Linux virtual machine is basically an Arch Linux guest.<br />
<br />
{{Warning|For [[Xorg]] to work in natively and in the virtual machine, since obviously it will be using different drivers, it is best if there is no {{ic|/etc/X11/xorg.conf}}, so Xorg will pick up everything it needs on the fly. However, if you really do need your own Xorg configuration, maybe is it worth to set your default systemd target to {{ic|multi-user.target}} with {{ic|systemctl isolate graphical.target}} as root (more details at [[Systemd#Targets table]] and [[Systemd#Change current target]]). In that way, the graphical interface is disabled (i.e. Xorg is not launched) and after you logged in, you can {{ic|startx}}} manually with a custom {{ic|xorg.conf}}.}}<br />
<br />
=== Install a native Arch Linux system from VirtualBox ===<br />
<br />
In some cases it may be useful to install a native Arch Linux system while running another operating system: one way to accomplish this is to perform the installation through VirtualBox on a [http://www.virtualbox.org/manual/ch09.html#rawdisk raw disk]. If the existing operating system is Linux based, you may want to consider following [[Install from Existing Linux]] instead.<br />
<br />
This scenario is very similar to [[#Run a native Arch Linux installation inside VirtualBox]], but will follow those steps in a different order: start by [[#Create a raw disk .vmdk image]], then [[#Create the VM configuration file]].<br />
<br />
Now, you should have a working VM configuration whose virtual VMDK disk is tied to a real disk. The installation process is exactly the same as the steps described in [[#Installation steps for Arch Linux guests]], but [[#Make sure you have a persistent naming scheme]] and [[#Make sure your mkinitcpio image is correct]].<br />
<br />
{{Warning|<br />
*For BIOS systems and MBR disks, do not install a bootloader inside your virtual machine, this will not work since the MBR is not linked to the MBR of your real machine and your virtual disk is only mapped to a real partition without the MBR.<br />
*For UEFI systems without [[Wikipedia:Compatibility Support Module#CSM|CSM]] and GPT disks, the installation will not work at all since:<br />
:*the [[Wikipedia:EFI System partition|ESP]] partition is not mapped to your virtual disk and Arch Linux requires to have the Linux kernel on it to boot as an EFI application (see [[EFISTUB]] for details);<br />
:*and the efivars, if you are installing Arch Linux using the EFI mode brought by VirtualBox, are not the one of your real system: the bootmanager entries will hence not be registered.<br />
*This is why, it is recommended to create your partitions in a native installation first, otherwize the partitions will not be taken into consideration in your MBR/GPT partition table.}}<br />
<br />
After completing the installation, boot your computer natively with an GNU/Linux installation media (whether it be Arch Linux or not), [[Beginner's Guide#Chroot and configure the base system|chroot]] into your installed Arch Linux installation and [[Beginner's Guide#Install and configure a bootloader|#Install and configure a bootloader]].<br />
<br />
=== Move a native Windows installation to a virtual machine ===<br />
<br />
If you want to migrate an existing native Windows installation to a virtual machine which will be used with VirtualBox on GNU/Linux, this use case is for you. This section only covers native Windows installation using the MSDOS/Intel partition scheme. Your Windows installation must reside on the first MBR partition for this operation to success. Operation for other partitions are available but have been untested (see [[#Known limitations]] for details).<br />
<br />
{{Warning|If you are using an OEM version of Windows, this process is unauthorized by the end user license license. Indeed, the OEM license typically states the Windows install is tied with the hardware together. Transferring a Windows install to a virtual machine removes this link. Make thus sure you have a full Windows install or a volume license model before continuing. If you have a full Windows license but the latter is not coming in volume, nor as a special license for several PCs, this means you will have to remove the native installation after the transfer operation has been achieved.}}<br />
<br />
A couple of tasks are required to be done inside your native Windows installation first, then on your GNU/Linux host.<br />
<br />
==== Tasks on Windows ====<br />
<br />
The first three following points comes from [https://www.virtualbox.org/wiki/Migrate_Windows#HAL this outdated VirtualBox wiki page], but are updated here.<br />
<br />
* Remove IDE/ATA controllers checks (Windows XP only): Windows memorize the IDE/ATA drive controllers it has been installed on and will not boot if it detects these have changed. The solution proposed by Microsoft is to reuse the same controller or use one of the same serial, which is impossible to achieve since we are using a Virtual Machine. [https://www.virtualbox.org/wiki/Migrate_Windows#HardDiskSupport MergeIDE], a German tool, developped upon another other solution proposed by Microsoft can be used. That solution basically consists in taking all IDE/ATA controller drivers supported by Windows XP from the initial driver archive (the location is hard coded, or specify it as the first argument to the {{ic|.bat}} script), installing them and registering them with the regedit database.<br />
<br />
* Use the right type of Hardware Abstraction Layer (old 32 bits Windows versions): Microsoft ships 3 default versions: {{ic|Hal.dll}} (Standard PC), {{ic|Halacpi.dll}} (ACPI HAL) and {{ic|Halaacpi.dll}} (ACPI HAL with IO APIC). Your Windows install could come installed with the first or the second version. In that way, please [https://www.virtualbox.org/manual/ch08.html#idp56927888 disable the ''Enable IO/APIC'' VirtualBox extended feature].<br />
<br />
* Disable any AGP device driver (only outdated Windows versions): If you have the files {{ic|agp440.sys}} or {{ic|intelppm.sys}} inside the {{ic|C:\Windows\SYSTEM32\drivers\}} directory, remove it. As VirtualBox uses a PCI virtual graphic card, this can cause problems when this AGP driver is used.<br />
<br />
* Create a Windows recovery disk: In the following steps, if things turn bad, you will need to repair your Windows installation. Make sure you have an install media at hand, or create one with ''Create a recovery disk'' from Vista SP1, ''Create a system repair disc'' on Windows 7 or ''Create a recovery drive'' on Windows 8.x).<br />
<br />
==== Using Disk2vhd to clone Windows partition ====<br />
Boot into Windows, clean up the installation (with [http://www.piriform.com/ccleaner CCleaner] for example), use [https://technet.microsoft.com/en-us/library/ee656415.aspx disk2vhd] tool to create a VHD image. Include a reserved system partition (if present) and the actual Windows partition (usually disk C:). The size of Disk2vhd-created image will be the sum of the actual files on the partition (used space), not the size of a whole partition. If all goes well, the image should just boot in a VM and you won't have to go through the hassle with MBR and Windows bootloader, as in the case of cloning an entire partition.<br />
<br />
==== Tasks on GNU/Linux ====<br />
<br />
{{Tip|Skip the partition-related parts if you created VHD image with [[#Using Disk2vhd to clone Windows partition|Disk2vhd]].}}<br />
<br />
* Reduce the native Windows partition size to the size Windows actually needs with {{ic|ntfsresize}} available from {{Pkg|ntfs-3g}}. The size you will specify will be the same size of the VDI that will be created in the next step. If this size is too low, you may break your Windows install and the latter might not boot at all.<br />
<br />
:Use the {{ic|--no-action}} option first to run a test:<br />
:{{bc|# ntfsresize --no-action --size ''52Gi'' ''/dev/sda1''}}<br />
<br />
:If only the previous test succeeded, execute this command again, but this time without the aforementioned test flag.<br />
<br />
* Install VirtualBox on your GNU/Linux host (see [[#Installation steps for Arch Linux hosts]] if your host is Arch Linux).<br />
<br />
* Create the Windows disk image from the beginning of the drive to the end of the first partition where is located your Windows installation. Copying from the beginning of the disk is necessary because the MBR space at the beginning of the drive needs to be on the virtual drive along with the Windows partition. In this example two following partitions {{ic|sda2}} and {{ic|sda3}}will be later removed from the partition table and the MBR bootloader will be updated.<br />
<br />
:{{bc|<nowiki># sectnum=$(( $(cat /sys/block/''sda/sda1''/start) + $(cat /sys/block/''sda/sda1''/size) ))</nowiki>}}<br />
:Using {{ic|cat /sys/block/''sda/sda1''/size}} will output the number of total sectors of the first partition of the disk {{ic|sda}}. Adapt where necessary.<br />
<br />
:{{bc|<nowiki># dd if=''/dev/sda'' bs=512 count=$sectnum | VBoxManage convertfromraw stdin ''windows.vdi'' $(( $sectnum * 512 ))</nowiki>}}<br />
:We need to display the size in byte, {{ic|$(( $sectnum * 512 ))}} will convert the sector numbers to bytes.<br />
<br />
* Since you created your disk image as root, set the right ownership to the virtual disk image: {{bc|# chown ''your_user'':''your_group'' windows.vdi}}<br />
<br />
* Create your virtual machine configuration file and use the virtual disk created previously as the main virtual hard disk.<br />
<br />
* Try to boot your Windows VM, it may just work. First though remove and repair disks from the boot process as it may interfere (and likely will) booting into safe-mode.<br />
<br />
* Attempt to boot your Windows virtual machine in safe mode (press the F8 key before the Windows logo shows up)... if running into boot issues, read [[#Fix MBR and Microsoft bootloader]]. In safe-mode, drivers will be installed likely by the Windows plug-and-play detection mechanism [http://i.imgur.com/hh1RrSp.png view]. Additionally, install the VirtualBox Guest Additions via the menu ''Devices'' > ''Insert Guest Additions CD image...''. If a new disk dialog does not appear, navigate to the CD drive and start the installer manually.<br />
<br />
* You should finally have a working Windows virtual machine. Do not forget to read the [[#Known limitations]].<br />
<br />
* Performance tip: according to [http://www.virtualbox.org/manual/ch05.html#harddiskcontrollers VirtualBox manual], SATA controller has a better performance than IDE. If you can't boot Windows off virtual SATA controller right away, it is probably due to the lack of SATA drivers. Attach virtual disk to IDE controller, create an empty SATA controller and boot the VM - Windows should automatically install SATA drivers for the controller. You can then shutdown VM, detach virtual disk from IDE controller and attach it to SATA controller instead.<br />
<br />
==== Fix MBR and Microsoft bootloader ====<br />
<br />
If your Windows virtual machine refuses to boot, you may need to apply the following modifications to your virtual machine.<br />
<br />
*Boot a GNU/Live live distribution inside your virtual machine before Windows starts up.<br />
<br />
*Remove other partitions entries from the virtual disk MBR. Indeed, since we copied the MBR and only the Windows partition, the entries of the other partitions are still present in the MBR, but the partitions are not available anymore. Use {{ic|fdisk}} to achieve this for example.<br />
:{{bc|<nowiki>fdisk ''/dev/sda''<br />
Command (m for help): a<br />
Partition number (''1-3'', default ''3''): ''1''</nowiki>}}<br />
<br />
*Write the updated partition table to the disk (this will recreate the MBR) using the {{ic|m}} command inside {{ic|fdisk}}.<br />
<br />
*Use {{Pkg|testdisk}} (see [http://www.cgsecurity.org/index.html?testdisk.html here] for details) to add a generic MBR:<br />
:{{bc|# testdisk > ''Disk /dev/sda...''' > [Proceed] > [Intel] Intel/PC partition > [MBR Code] Write TestDisk MBR to first sector > Write a new copy of MBR code to first sector? (Y/n) > Y > Write a new copy of MBR code, confirm? (Y/N) > A new copy of MBR code has been written. You have to reboot for the change to take effect. > [OK]}}<br />
<br />
*With the new MBR and updated partition table, your Windows virtual machine should be able to boot. If you are still encountering issues, boot your Windows recovery disk from on of the previous step, and inside your Windows RE environment, execute the commands [http://support.microsoft.com/kb/927392 described here].<br />
<br />
==== Known limitations ====<br />
<br />
*Your virtual machine can sometimes hang and overrun your RAM, this can be caused by conflicting drivers still installed inside your Windows virtual machine. Good luck to find them!<br />
*Additional software expecting a given driver beneath may either not be disabled/uninstalled or needs to be uninstalled first as the drivers that are no longer available.<br />
*Your Windows installation must reside on the first partition for the above process to work. If this requirement is not met, the process might be achieved too, but this had not been tested. This will require either copying the MBR and editing in hexadecimal see [http://superuser.com/questions/237782/virtualbox-booting-cloned-disk/253417#253417 VirtualBox: booting cloned disk] or will require to fix the partition table [http://gparted.org/h2-fix-msdos-pt.php manually] or by repairing Windows with the recovery disk you created in a previous step. Let us consider our Windows installation on the second partition; we will copy the MBR, then the second partition where to the disk image. {{ic|VBoxManage convertfromraw}} needs the total number of bytes that will be written: calculated thanks to the size of the MBR (the start of the first partition) plus the size of the second (Windows) partition. {{ic|<nowiki>{ dd if=/dev/sda bs=512 count=$(cat /sys/block/sda/sda1/start) ; dd if=/dev/sda2 bs=512 count=$(cat /sys/block/sda/sda2/size) ; } | VBoxManage convertfromraw stdin windows.vdi $(( ($(cat /sys/block/sda/sda1/start) + $(cat /sys/block/sda/sda2/size)) * 512 ))</nowiki>}}.<br />
<br />
== Troubleshooting ==<br />
<br />
=== VERR_ACCESS_DENIED ===<br />
<br />
To access the raw vmdk image on a windows host, run the VirtualBox GUI as administrator.<br />
<br />
=== Keyboard and mouse are blocked in my virtual machine ===<br />
<br />
This means your virtual machine has captured the input of your keyboard and your mouse. Simply press the right {{ic|Ctrl}} key and your input should control your host again.<br />
<br />
To control transparently your virtual machine with your mouse going back and forth your host, without having to press any key, and thus have a seamless integration, install the guest additions inside the guest. Read from the [[#Install the Guest Additions]] step if you guest is Arch Linux, otherwise read the official VirtualBox help.<br />
<br />
=== Cannot send CTRL+ALT+Fn key to my virtual machine ===<br />
<br />
Your guest operating system is a GNU/Linux distribution and you want to open a new TTY shell by hitting {{ic|Ctrl+Alt+F2}} or exit your current X session with {{ic|Ctrl+Alt+Backspace}}. If you type these keyboard shortcuts without any adaptation, the guest will not receive any input and the host (if it is a GNU/Linux distribution too) will intercept these shortcut keys. To send {{ic|Ctrl+Alt+F2}} to the guest for example, simply hit your ''Host Key'' (usually the right {{ic|Ctrl}} key) and press {{ic|F2}} simultaneously.<br />
<br />
=== Fix ISO images problems ===<br />
<br />
While VirtualBox can mount ISO images without problem, there are some image formats which cannot reliably be converted to ISO. For instance, ccd2iso ignores .ccd and .sub files, which can give disk images with broken files. <br />
<br />
In this case, you will either have to use [[CDEmu]] for Linux inside VirtualBox or any other utility used to mount disk images.<br />
<br />
=== VirtualBox GUI does not match my GTK Theme ===<br />
<br />
See [[Uniform Look for Qt and GTK Applications]] for information about theming Qt based applications like Virtualbox.<br />
<br />
=== OpenBSD unusable when virtualisation instructions unavailable ===<br />
<br />
While OpenBSD is reported to work fine on other hypervisors without virtualisation instructions (VT-x AMD-V) enabled, an OpenBSD virtual machine running on VirtualBox without these instructions will be unusable, manifesting with a bunch of segmentation faults. Starting VirtualBox with the ''-norawr0'' argument [https://www.virtualbox.org/ticket/3947 may solve the problem]. You can do it like this:<br />
$ VBoxSDL -norawr0 -vm ''name_of_OpenBSD_VM''<br />
<br />
=== VBOX_E_INVALID_OBJECT_STATE (0x80BB0007) ===<br />
<br />
This can occur if a VM is exited ungracefully. The solution to unlock the VM is trivial:<br />
$ VBoxManage controlvm ''virtual_machine_name'' poweroff<br />
<br />
=== USB subsystem is not working on the host or guest ===<br />
<br />
Your user must be in the {{ic|vboxusers}} group, and you need to install the [[#Extension pack|extension pack]] if you want USB 2 support. Then you will be able to enable USB 2 in the VM settings and add one or several filters for the devices you want to access from the guest OS.<br />
<br />
If {{ic|VBoxManage list usbhost}} does not show any USB devices even if run as root, make sure that there is no old udev rules (from VirtualBox 4.x) in ''/etc/udev/rules.d/''. VirtualBox 5.0 installs udev rules to ''/usr/lib/udev/rules.d/''. You can use command like {{ic|pacman -Qo /usr/lib/udev/rules.d/60-vboxdrv.rules}} to determine if the udev rule file is outdated.<br />
<br />
Sometimes, on old Linux hosts, the USB subsystem is not auto-detected resulting in an error {{ic|Could not load the Host USB Proxy service: VERR_NOT_FOUND}} or in a not visible USB drive on the host, [https://bbs.archlinux.org/viewtopic.php?id=121377 even when the user is in the '''vboxusers''' group]. This problem is due to the fact that VirtualBox switched from ''usbfs'' to ''sysfs'' in version 3.0.8. If the host does not understand this change, you can revert to the old behaviour by defining the following environment variable in any file that is sourced by your shell (e.g. your {{ic|~/.bashrc}} if you are using ''bash''):<br />
<br />
{{hc|~/.bashrc|VBOX_USB<nowiki>=</nowiki>usbfs}}<br />
<br />
Then make sure, the environment has been made aware of this change (reconnect, source the file manually, launch a new shell instance or reboot).<br />
<br />
Also make sure that your user is a member of the {{ic|storage}} group.<br />
<br />
=== Failed to create the host-only network interface ===<br />
<br />
Make sure all required kernel modules are loaded. See [[#Load the VirtualBox kernel modules]].<br />
<br />
=== WinXP: Bit-depth cannot be greater than 16 ===<br />
<br />
If you are running at 16-bit color depth, then the icons may appear fuzzy/choppy. However, upon attempting to change the color depth to a higher level, the system may restrict you to a lower resolution or simply not enable you to change the depth at all. To fix this, run {{ic|regedit}} in Windows and add the following key to the Windows XP VM's registry:<br />
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]<br />
"ColorDepth"=dword:00000004<br />
<br />
Then update the color depth in the "desktop properties" window. If nothing happens, force the screen to redraw through some method (i.e. {{ic|Host+f}} to redraw/enter full screen).<br />
<br />
=== Use serial port in guest OS ===<br />
<br />
Check you permission for the serial port:<br />
$ /bin/ls -l /dev/ttyS*<br />
crw-rw---- 1 root uucp 4, 64 Feb 3 09:12 /dev/ttyS0<br />
crw-rw---- 1 root uucp 4, 65 Feb 3 09:12 /dev/ttyS1<br />
crw-rw---- 1 root uucp 4, 66 Feb 3 09:12 /dev/ttyS2<br />
crw-rw---- 1 root uucp 4, 67 Feb 3 09:12 /dev/ttyS3<br />
<br />
Add your user to the {{ic|uucp}} group.<br />
# gpasswd -a $USER uucp <br />
and log out and log in again.<br />
<br />
=== Windows 8.x Error Code 0x000000C4===<br />
<br />
If you get this error code while booting, even if you choose OS Type Win 8, try to enable the {{ic|CMPXCHG16B}} CPU instruction:<br />
<br />
$ vboxmanage setextradata ''virtual_machine_name'' VBoxInternal/CPUM/CMPXCHG16B 1<br />
<br />
=== Windows 8, 8.1 or 10 fails to install, boot or has error "ERR_DISK_FULL" ===<br />
Update the VM's settings by going to ''Settings > Storage > Controller:SATA'' and check "Use Host I/O Cache".<br />
<br />
=== Linux guests have slow/distorted audio ===<br />
<br />
The AC97 audio driver within the Linux kernel occasionally guesses the wrong clock settings when running inside Virtual Box, leading to audio that is either too slow or too fast. To fix this, create a file in {{ic|/etc/modprobe.d}} with the following line:<br />
<br />
options snd-intel8x0 ac97_clock=48000<br />
<br />
=== Guest freezes after starting Xorg ===<br />
<br />
Faulty or missing drivers may cause the guest to freeze after starting Xorg, see for example [https://bbs.archlinux.org/viewtopic.php?pid=1167838] and [https://bbs.archlinux.org/viewtopic.php?id=156079]. Try disabling 3D acceleration in ''Settings > Display'', and check if all [[Xorg]] drivers are installed.<br />
<br />
=== "NS_ERROR_FAILURE" and missing menu items ===<br />
<br />
If you encounter this message when first time starting the virtual machine:<br />
<br />
{{bc|Failed to open a session for the virtual machine debian.<br />
Could not open the medium '/home/.../VirtualBox VMs/debian/debian.qcow'.<br />
QCow: Reading the L1 table for image '/home/.../VirtualBox VMs/debian/debian.qcow' failed (VERR_EOF).<br />
VD: error VERR_EOF opening image file '/home/.../VirtualBox VMs/debian/debian.qcow' (VERR_EOF).<br />
<br />
Result Code: <br />
NS_ERROR_FAILURE (0x80004005)<br />
Component: <br />
Medium<br />
}}<br />
<br />
Exit VirtualBox, delete all files of the new machine and from virtualbox config file remove the last line in {{ic|MachineRegistry}} menu (or the offending machine you are creating):<br />
<br />
{{hc|~/.config/VirtualBox/VirtualBox.xml|2=<br />
...<br />
<MachineRegistry><br />
<MachineEntry uuid="{00000000-0000-0000-0000-000000000000}" src="/home/void/VirtualBox VMs/debian/debian.vbox"/><br />
<MachineEntry uuid="{00000000-0000-0000-0000-000000000000}" src="/home/void/VirtualBox VMs/ubuntu/ubuntu.vbox"/><br />
<strike><MachineEntry uuid="{00000000-0000-0000-0000-000000000000}" src="/home/void/VirtualBox VMs/lastvmcausingproblems/lastvmcausingproblems.qcow"/></strike><br />
</MachineRegistry><br />
...<br />
}}<br />
<br />
This happens sometimes when selecting ''QCOW''/''QCOW2''/''QED'' disk format when creating a new virutal disk.<br />
<br />
=== USB modem ===<br />
<br />
If you have a USB modem which is being used by the guest OS, killing the guest OS can cause the modem to become unusable by the host system. Killing and restarting {{ic|VBoxSVC}} should fix this problem.<br />
<br />
=== "The specified path does not exist. Check the path and then try again." error in Windows guests ===<br />
<br />
This error message often appears when running an .exe file which requires administrator priviliges from a shared folder in windows guests. See [https://www.virtualbox.org/ticket/5732 the bug report] for details.<br />
<br />
There are several workarounds:<br />
<br />
# Disable UAC from Control Panel -> Action Center -> "Change User Account Control settings" from left side pane -> set slider to "Never notify" -> OK and reboot<br />
# Copy the file from the shared folder to the guest and run from there<br />
# Control Panel -> Network and Internet -> Internet Options -> Security -> Trusted Sites -> Sites -> Add "VBOXSVR" as a website<br />
# Start -> type "gpedit.msc" and press Enter -> Computer Configuration -> Administrative Templates -> Windows Components -> Internet Explorer -> Internet Control Panel -> Security Page -> Size to Zone Assignment List -> Add "VBOXSVR" to "2" and reboot<br />
<br />
{{Accuracy|Haven't tested#3 and #4 workarounds myself. If someone can confirm that they are working as well, please delete this note/template.}}<br />
<br />
=== No 64-bit OS client options ===<br />
<br />
When launching a VM client, and no 64-bit options are available, make sure your CPU virtualization capabilities (usually named {{ic|VT-x}}) are enabled in the BIOS.<br />
<br />
=== Host OS freezes on Virtual Machine start ===<br />
<br />
{{Expansion|Needs a link to a bug report; vague expressions like "currently" and "at the moment of writing" are of no help.}}<br />
<br />
Possible causes/solutions :<br />
* SMAP<br />
This is a known incompatiblity with SMAP enabled kernels affecting (mostly) Intel Broadwell chipsets. The matter is currently being investigated, with a wide variety of WIP vboxhost module patches out in the wild that are meant to solve the issue. At the moment of writing though, the only 100% guaranteed solution to this problem is disabling SMAP support in your kernel by appending the "nosmap" option to your kernel boot command line.<br />
* Hardware Virtualisation<br />
Disabling hardware virtualisation (VT-x/AMD-V) may solve the problem.<br />
* Various Kernel bugs<br />
** Fuse mounted partitions (like ntfs) [https://bbs.archlinux.org/viewtopic.php?id=185841], [https://bugzilla.kernel.org/show_bug.cgi?id=82951#c12]<br />
<br />
Generally, such issues are observed after upgrading VirtualBox or linux kernel. Downgrading them to the previous versions of theirs might solve the problem.<br />
<br />
<br />
=== The virtual machine has terminated unexpectedly during startup with exit code 1 (0x1) ===<br />
<br />
When trying to launch a virtual machine, an error message like the following appears:<br />
<br />
{{bc|The virtual machine has terminated unexpectedly during startup with exit code 1 (0x1)<br />
NS_ERROR_FAILURE 0x80004005<br />
Component: MachineWrap<br />
Interface: IMachine}}<br />
<br />
This may occur after upgrading the {{Pkg|virtualbox}} or {{Pkg|virtualbox-host-modules}} package. Try reloading the {{ic|vboxdrv}} module:<br />
<br />
{{bc|# modprobe -r vboxdrv<br />
# modprobe vboxdrv<br />
}}<br />
<br />
== See also ==<br />
<br />
* [https://www.virtualbox.org/manual/UserManual.html VirtualBox User Manual]<br />
* [[Wikipedia:VirtualBox]]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Arch_Rollback_Machine&diff=380629Arch Rollback Machine2015-07-01T15:48:54Z<p>Emlun: Replace "This article is about..." notice with "ARM redirects here...", since the title is in fact unambiguous</p>
<hr />
<div>: ''[[ARM]] redirects here. For the ARM processor architecture, see [[:Category:ARM architecture]].''<br />
<br />
[[Category:Package management]]<br />
[[fr:Arch Rollback Machine]]<br />
[[ja:Arch Rollback Machine]]<br />
{{Related articles start}}<br />
{{Related|Archive}}<br />
{{Related|Downgrading packages}}<br />
{{Related articles end}}<br />
<br />
The Arch Rollback Machine (ARM) is a daily snapshot of official Arch Linux mirrors.<br />
You can use it to find an old version of a package or to change the way you upgrade your system.<br />
<br />
== Location ==<br />
<br />
The ARM is available at http://seblu.net/a/arm or ftp://seblu.net/archlinux/arm<br />
<br />
== Architecture ==<br />
<br />
The ARM stores a snapshot of each day in a filesystem hierarchy like the following.<br />
In addition there are 3 symbolic links pointing to special snapshots and one packages directory.<br />
<br />
├── 2013<br />
│ ├── 08<br />
│ │ └── 31<br />
│ ├── 09<br />
│ │ ├── 01<br />
│ │ ├── 02<br />
│ │ ├── ...<br />
│ │ ├── 21<br />
│ │ └── 22<br />
│ └── 10<br />
│ ├── 01<br />
│ ├── 02<br />
│ ├── ...<br />
│<br />
├── packages<br />
│ ├── a<br />
│ │ ├── awesome<br />
│ │ │ ├── awesome-3.5.0-1-i686.pkg.tar.xz<br />
│ │ │ ├── awesome-3.5.0-1-x86_64.pkg.tar.xz<br />
│ │ │ ├── awesome-3.5.1-1-i686.pkg.tar.xz<br />
│ │ │ ├── ...<br />
│ │ │ <br />
│ │ ├── ...<br />
│ │ ├── awstats<br />
│ │ └── axel<br />
│ │ <br />
│ ├── b<br />
│ ├── ...<br />
│ └── z<br />
│<br />
├── all<br />
│ ├── awesome-3.5.1-1-i686.pkg.tar.xz<br />
│ ├── ...<br />
│ ├── zsh-5.0.2-3-i686.pkg.tar.xz<br />
│ ├── zsh-5.0.2-4-i686.pkg.tar.xz<br />
│ └── ...<br />
│<br />
├── last -> 2013/09/22<br />
├── month -> 2013/09/01<br />
└── week -> 2013/09/16<br />
<br />
* The {{ic|20xx}} hierarchy contains daily snapshots of official mirror organized by date.<br />
* The [http://seblu.net/a/arm/packages packages] hierarchy contains symlinks to all versions of each package. One directory by package.<br />
* The [http://seblu.net/a/arm/all all] hierarchy contains symlinks to all versions of each package in one flat directory. No listing.<br />
* The [http://seblu.net/a/arm/last last] symlink is updated every day and points to the last finished mirror snapshot.<br />
* The [http://seblu.net/a/arm/week week] symlink is updated every week and points to the monday of the current week.<br />
* The [http://seblu.net/a/arm/month month] symlink is updated every month and points to the first day of the current month.<br />
<br />
== Time travel ==<br />
<br />
This feature allows you to get packages and databases at a given date. You can use it to:<br />
# download an old package;<br />
# use pacman stuck on a particular day.<br />
<br />
To have [[pacman]] be stuck on 11th September 2013, edit your {{ic|/etc/pacman.conf}} and use the following server directive:<br />
<br />
{{bc|<nowiki><br />
[core]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
<br />
[extra]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
<br />
[community]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
or replace your {{ic|/etc/pacman.d/mirrorlist}} by the following content:<br />
<br />
{{bc|<nowiki><br />
## <br />
## Arch Linux repository mirrorlist <br />
## Generated on 2042-01-01 <br />
##<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
Then downgrade the entire system:<br />
<br />
# pacman -Syyuu<br />
<br />
{{Note|It's not safe to mix ARM and up-to-date mirrors. In case of download failure, you can fall-back on an upstream package and you will have packages not from the same epoch as the rest of the system.}}<br />
<br />
== Time relativity ==<br />
<br />
This feature allows you to assign a fixed delay before receiving package updates.<br />
To upgrade your computer on a weekly or a monthly basis, edit your {{ic|/etc/pacman.conf}} and use the following server directive:<br />
<br />
{{bc|<nowiki><br />
[core]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
<br />
[extra]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
<br />
[community]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
or by replace your {{ic|/etc/pacman.d/mirrorlist}} by the following content:<br />
<br />
{{bc|<nowiki><br />
## <br />
## Arch Linux repository mirrorlist <br />
## Generated on 2042-01-01 <br />
##<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
{{Note|It's not safe to mix ARM and up-to-date mirrors. In case of download failure, you can fall-back on an upstream package and you will have packages not from the same epoch than the rest of the system.}}<br />
<br />
== Past ==<br />
<br />
The original ARM was closed on 2013-08-18 [https://bbs.archlinux.org/viewtopic.php?pid=1313360#p1313360].<br />
<br />
The new one is hosted on [http://seblu.net seblu.net] since 2013-08-31.</div>Emlunhttps://wiki.archlinux.org/index.php?title=Arch_Rollback_Machine&diff=380531Arch Rollback Machine2015-06-30T16:43:55Z<p>Emlun: Add redirection hint for ARM architecture</p>
<hr />
<div>{{About|the Arch Rollback Machine|the ARM processor architecture|:Category:ARM architecture|Category:ARM architecture}}<br />
<br />
[[Category:Package management]]<br />
[[fr:Arch Rollback Machine]]<br />
[[ja:Arch Rollback Machine]]<br />
{{Related articles start}}<br />
{{Related|Archive}}<br />
{{Related|Downgrading packages}}<br />
{{Related articles end}}<br />
<br />
The Arch Rollback Machine (ARM) is a daily snapshot of official Arch Linux mirrors.<br />
You can use it to find an old version of a package or to change the way you upgrade your system.<br />
<br />
== Location ==<br />
<br />
The ARM is available at http://seblu.net/a/arm or ftp://seblu.net/archlinux/arm<br />
<br />
== Architecture ==<br />
<br />
The ARM stores a snapshot of each day in a filesystem hierarchy like the following.<br />
In addition there are 3 symbolic links pointing to special snapshots and one packages directory.<br />
<br />
├── 2013<br />
│ ├── 08<br />
│ │ └── 31<br />
│ ├── 09<br />
│ │ ├── 01<br />
│ │ ├── 02<br />
│ │ ├── ...<br />
│ │ ├── 21<br />
│ │ └── 22<br />
│ └── 10<br />
│ ├── 01<br />
│ ├── 02<br />
│ ├── ...<br />
│<br />
├── packages<br />
│ ├── a<br />
│ │ ├── awesome<br />
│ │ │ ├── awesome-3.5.0-1-i686.pkg.tar.xz<br />
│ │ │ ├── awesome-3.5.0-1-x86_64.pkg.tar.xz<br />
│ │ │ ├── awesome-3.5.1-1-i686.pkg.tar.xz<br />
│ │ │ ├── ...<br />
│ │ │ <br />
│ │ ├── ...<br />
│ │ ├── awstats<br />
│ │ └── axel<br />
│ │ <br />
│ ├── b<br />
│ ├── ...<br />
│ └── z<br />
│<br />
├── all<br />
│ ├── awesome-3.5.1-1-i686.pkg.tar.xz<br />
│ ├── ...<br />
│ ├── zsh-5.0.2-3-i686.pkg.tar.xz<br />
│ ├── zsh-5.0.2-4-i686.pkg.tar.xz<br />
│ └── ...<br />
│<br />
├── last -> 2013/09/22<br />
├── month -> 2013/09/01<br />
└── week -> 2013/09/16<br />
<br />
* The {{ic|20xx}} hierarchy contains daily snapshots of official mirror organized by date.<br />
* The [http://seblu.net/a/arm/packages packages] hierarchy contains symlinks to all versions of each package. One directory by package.<br />
* The [http://seblu.net/a/arm/all all] hierarchy contains symlinks to all versions of each package in one flat directory. No listing.<br />
* The [http://seblu.net/a/arm/last last] symlink is updated every day and points to the last finished mirror snapshot.<br />
* The [http://seblu.net/a/arm/week week] symlink is updated every week and points to the monday of the current week.<br />
* The [http://seblu.net/a/arm/month month] symlink is updated every month and points to the first day of the current month.<br />
<br />
== Time travel ==<br />
<br />
This feature allows you to get packages and databases at a given date. You can use it to:<br />
# download an old package;<br />
# use pacman stuck on a particular day.<br />
<br />
To have [[pacman]] be stuck on 11th September 2013, edit your {{ic|/etc/pacman.conf}} and use the following server directive:<br />
<br />
{{bc|<nowiki><br />
[core]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
<br />
[extra]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
<br />
[community]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
or replace your {{ic|/etc/pacman.d/mirrorlist}} by the following content:<br />
<br />
{{bc|<nowiki><br />
## <br />
## Arch Linux repository mirrorlist <br />
## Generated on 2042-01-01 <br />
##<br />
Server=http://seblu.net/a/arm/2013/09/11/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
Then downgrade the entire system:<br />
<br />
# pacman -Syyuu<br />
<br />
{{Note|It's not safe to mix ARM and up-to-date mirrors. In case of download failure, you can fall-back on an upstream package and you will have packages not from the same epoch as the rest of the system.}}<br />
<br />
== Time relativity ==<br />
<br />
This feature allows you to assign a fixed delay before receiving package updates.<br />
To upgrade your computer on a weekly or a monthly basis, edit your {{ic|/etc/pacman.conf}} and use the following server directive:<br />
<br />
{{bc|<nowiki><br />
[core]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
<br />
[extra]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
<br />
[community]<br />
SigLevel = PackageRequired<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
or by replace your {{ic|/etc/pacman.d/mirrorlist}} by the following content:<br />
<br />
{{bc|<nowiki><br />
## <br />
## Arch Linux repository mirrorlist <br />
## Generated on 2042-01-01 <br />
##<br />
Server=http://seblu.net/a/arm/month/$repo/os/$arch<br />
#Server=http://seblu.net/a/arm/week/$repo/os/$arch<br />
</nowiki>}}<br />
<br />
{{Note|It's not safe to mix ARM and up-to-date mirrors. In case of download failure, you can fall-back on an upstream package and you will have packages not from the same epoch than the rest of the system.}}<br />
<br />
== Past ==<br />
<br />
The original ARM was closed on 2013-08-18 [https://bbs.archlinux.org/viewtopic.php?pid=1313360#p1313360].<br />
<br />
The new one is hosted on [http://seblu.net seblu.net] since 2013-08-31.</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=327363Resilio Sync2014-07-28T14:49:39Z<p>Emlun: /* Usage */ You will also need to create the {{ic|storage_path}} directory.</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:BitTorrent_Sync]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relies on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon. This package creates a default /etc/btsync.conf for system/root operation. Before enabling with systemctl review this file and make desired changes, e.g. to the login id and password. <br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. You will also need to create the {{ic|storage_path}} directory. When that is done, start and (if you want it to start on boot) enable the service:<br />
$ systemctl --user start btsync<br />
$ systemctl --user enable btsync<br />
The service will run as the user invoking the command.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|--user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You should review the configuration settings especially user and password, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The {{ic|btsync}} executable does not create the {{ic|storage_path}} directory if it doesn't exist, you will have to do this manually or use [[#Automatic_config_file_creation]].}}<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{AUR|btsync-autoconfig}} package provides a systemd user service ({{ic|btsync-autoconfig.service}}) which, if enabled, triggers when a user's {{ic|btsync.service}} starts and creates a config file with default values if it does not already exist. The install script enables the service for all users by default. Although disabling it defeats most of its purpose, it can be disabled using<br />
<br />
# systemctl --global disable btsync-autoconfig.service<br />
<br />
Individual users can then enable it if they like:<br />
<br />
$ systemctl --user enable btsync-autoconfig.service<br />
<br />
{{ic|btsync-autoconfig.service}} creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER/password}}<br />
<br />
The script also creates the {{ic|storage_path}} directory set in the config file if it does not exist. This is done intependently from the creation of the config file.<br />
<br />
== Unofficial GUI ==<br />
The {{AUR|btsync-gui}} package provices an unofficial clone of the GUI interface for BTSync available for Windows. By default it disables the WebGUI interface for security reasons. If you want to migrate your existing BTSync setup - move the contents of your current storage folder (probably ~/.config/btsync) to ~/.btsync and disable the btsync@user Systemd service, that you're using currently.<br />
<br />
==Troubleshooting==<br />
<br />
===Missing storage path===<br />
<br />
If you start the service but can't reach the WebUI, check the status of the btsync by entering {{ic|systemctl --user status btsync}} (or {{ic|systemctl status btsync}} for the system-wide instance).<br />
<br />
A common error is {{ic|Storage path specified in config file does not exist.}}. This is easily fixed by {{ic|mkdir ~/.btsync}}, or whatever your {{ic|storage_path}} is set to.<br />
<br />
===WebUI is not running on port 8888===<br />
<br />
If the config file was generated by {{AUR|btsync-autoconfig}} it will be configured with a different port. Rather than 8888, the port for the user's instance of {{ic|btsync}} will be {{ic|7889 + $UID}}. If your {{ic|$UID}} is "1000", the port will be 8889.<br />
<br />
===Ignore some files/folders syncronization===<br />
<br />
If you have files in your sync folder that you don't want BitTorrent Sync to track, you can use .SyncIgnore. .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules for ignoring during the synchronization job. It supports '?' and '*' wildcard symbols.<br />
<br />
Note that .SyncIgnore is applied only to the folder where it is contained and will not work with the files that have already been synced. If you add indexed files to .SyncIgnore, they will be deleted on other syncing devices. In order to avoid this:<br />
<br />
* Remove the folder from sync on all the devices.<br />
* Modify .SyncIgnore file on all of them so that it contains same info.<br />
* Re-add the modified folders.<br />
<br />
===ARM alignment error===<br />
<br />
Add the line {{ic|w /proc/cpu/alignment - - - - 2}} to {{ic|/etc/tmpfiles.d/btsync.conf}}. (You need to create the file).<br><br />
Note that this may lead to performance degradation.<br />
<br />
==See Also==<br />
<br />
[http://www.bittorrent.com/help/faq/sync Official BitTorrent Sync FAQ]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=327362Resilio Sync2014-07-28T14:49:28Z<p>Emlun: /* Usage */ Update to agree with current release</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:BitTorrent_Sync]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relies on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon. This package creates a default /etc/btsync.conf for system/root operation. Before enabling with systemctl review this file and make desired changes, e.g. to the login id and password. <br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
$ systemctl --user start btsync<br />
$ systemctl --user enable btsync<br />
The service will run as the user invoking the command.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|--user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You should review the configuration settings especially user and password, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The {{ic|btsync}} executable does not create the {{ic|storage_path}} directory if it doesn't exist, you will have to do this manually or use [[#Automatic_config_file_creation]].}}<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{AUR|btsync-autoconfig}} package provides a systemd user service ({{ic|btsync-autoconfig.service}}) which, if enabled, triggers when a user's {{ic|btsync.service}} starts and creates a config file with default values if it does not already exist. The install script enables the service for all users by default. Although disabling it defeats most of its purpose, it can be disabled using<br />
<br />
# systemctl --global disable btsync-autoconfig.service<br />
<br />
Individual users can then enable it if they like:<br />
<br />
$ systemctl --user enable btsync-autoconfig.service<br />
<br />
{{ic|btsync-autoconfig.service}} creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER/password}}<br />
<br />
The script also creates the {{ic|storage_path}} directory set in the config file if it does not exist. This is done intependently from the creation of the config file.<br />
<br />
== Unofficial GUI ==<br />
The {{AUR|btsync-gui}} package provices an unofficial clone of the GUI interface for BTSync available for Windows. By default it disables the WebGUI interface for security reasons. If you want to migrate your existing BTSync setup - move the contents of your current storage folder (probably ~/.config/btsync) to ~/.btsync and disable the btsync@user Systemd service, that you're using currently.<br />
<br />
==Troubleshooting==<br />
<br />
===Missing storage path===<br />
<br />
If you start the service but can't reach the WebUI, check the status of the btsync by entering {{ic|systemctl --user status btsync}} (or {{ic|systemctl status btsync}} for the system-wide instance).<br />
<br />
A common error is {{ic|Storage path specified in config file does not exist.}}. This is easily fixed by {{ic|mkdir ~/.btsync}}, or whatever your {{ic|storage_path}} is set to.<br />
<br />
===WebUI is not running on port 8888===<br />
<br />
If the config file was generated by {{AUR|btsync-autoconfig}} it will be configured with a different port. Rather than 8888, the port for the user's instance of {{ic|btsync}} will be {{ic|7889 + $UID}}. If your {{ic|$UID}} is "1000", the port will be 8889.<br />
<br />
===Ignore some files/folders syncronization===<br />
<br />
If you have files in your sync folder that you don't want BitTorrent Sync to track, you can use .SyncIgnore. .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules for ignoring during the synchronization job. It supports '?' and '*' wildcard symbols.<br />
<br />
Note that .SyncIgnore is applied only to the folder where it is contained and will not work with the files that have already been synced. If you add indexed files to .SyncIgnore, they will be deleted on other syncing devices. In order to avoid this:<br />
<br />
* Remove the folder from sync on all the devices.<br />
* Modify .SyncIgnore file on all of them so that it contains same info.<br />
* Re-add the modified folders.<br />
<br />
===ARM alignment error===<br />
<br />
Add the line {{ic|w /proc/cpu/alignment - - - - 2}} to {{ic|/etc/tmpfiles.d/btsync.conf}}. (You need to create the file).<br><br />
Note that this may lead to performance degradation.<br />
<br />
==See Also==<br />
<br />
[http://www.bittorrent.com/help/faq/sync Official BitTorrent Sync FAQ]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=327361Resilio Sync2014-07-28T14:46:40Z<p>Emlun: /* Missing storage path */ Update systemctl commands to current format (btsync@user.service is no longer present in current package release)</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:BitTorrent_Sync]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relies on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon. This package creates a default /etc/btsync.conf for system/root operation. Before enabling with systemctl review this file and make desired changes, e.g. to the login id and password. <br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You should review the configuration settings especially user and password, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The {{ic|btsync}} executable does not create the {{ic|storage_path}} directory if it doesn't exist, you will have to do this manually or use [[#Automatic_config_file_creation]].}}<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{AUR|btsync-autoconfig}} package provides a systemd user service ({{ic|btsync-autoconfig.service}}) which, if enabled, triggers when a user's {{ic|btsync.service}} starts and creates a config file with default values if it does not already exist. The install script enables the service for all users by default. Although disabling it defeats most of its purpose, it can be disabled using<br />
<br />
# systemctl --global disable btsync-autoconfig.service<br />
<br />
Individual users can then enable it if they like:<br />
<br />
$ systemctl --user enable btsync-autoconfig.service<br />
<br />
{{ic|btsync-autoconfig.service}} creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER/password}}<br />
<br />
The script also creates the {{ic|storage_path}} directory set in the config file if it does not exist. This is done intependently from the creation of the config file.<br />
<br />
== Unofficial GUI ==<br />
The {{AUR|btsync-gui}} package provices an unofficial clone of the GUI interface for BTSync available for Windows. By default it disables the WebGUI interface for security reasons. If you want to migrate your existing BTSync setup - move the contents of your current storage folder (probably ~/.config/btsync) to ~/.btsync and disable the btsync@user Systemd service, that you're using currently.<br />
<br />
==Troubleshooting==<br />
<br />
===Missing storage path===<br />
<br />
If you start the service but can't reach the WebUI, check the status of the btsync by entering {{ic|systemctl --user status btsync}} (or {{ic|systemctl status btsync}} for the system-wide instance).<br />
<br />
A common error is {{ic|Storage path specified in config file does not exist.}}. This is easily fixed by {{ic|mkdir ~/.btsync}}, or whatever your {{ic|storage_path}} is set to.<br />
<br />
===WebUI is not running on port 8888===<br />
<br />
If the config file was generated by {{AUR|btsync-autoconfig}} it will be configured with a different port. Rather than 8888, the port for the user's instance of {{ic|btsync}} will be {{ic|7889 + $UID}}. If your {{ic|$UID}} is "1000", the port will be 8889.<br />
<br />
===Ignore some files/folders syncronization===<br />
<br />
If you have files in your sync folder that you don't want BitTorrent Sync to track, you can use .SyncIgnore. .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules for ignoring during the synchronization job. It supports '?' and '*' wildcard symbols.<br />
<br />
Note that .SyncIgnore is applied only to the folder where it is contained and will not work with the files that have already been synced. If you add indexed files to .SyncIgnore, they will be deleted on other syncing devices. In order to avoid this:<br />
<br />
* Remove the folder from sync on all the devices.<br />
* Modify .SyncIgnore file on all of them so that it contains same info.<br />
* Re-add the modified folders.<br />
<br />
===ARM alignment error===<br />
<br />
Add the line {{ic|w /proc/cpu/alignment - - - - 2}} to {{ic|/etc/tmpfiles.d/btsync.conf}}. (You need to create the file).<br><br />
Note that this may lead to performance degradation.<br />
<br />
==See Also==<br />
<br />
[http://www.bittorrent.com/help/faq/sync Official BitTorrent Sync FAQ]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=327360Resilio Sync2014-07-28T14:44:16Z<p>Emlun: /* Missing storage path */ btsync-autoconfig now creates storage_path if needed</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:BitTorrent_Sync]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relies on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon. This package creates a default /etc/btsync.conf for system/root operation. Before enabling with systemctl review this file and make desired changes, e.g. to the login id and password. <br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You should review the configuration settings especially user and password, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The {{ic|btsync}} executable does not create the {{ic|storage_path}} directory if it doesn't exist, you will have to do this manually or use [[#Automatic_config_file_creation]].}}<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{AUR|btsync-autoconfig}} package provides a systemd user service ({{ic|btsync-autoconfig.service}}) which, if enabled, triggers when a user's {{ic|btsync.service}} starts and creates a config file with default values if it does not already exist. The install script enables the service for all users by default. Although disabling it defeats most of its purpose, it can be disabled using<br />
<br />
# systemctl --global disable btsync-autoconfig.service<br />
<br />
Individual users can then enable it if they like:<br />
<br />
$ systemctl --user enable btsync-autoconfig.service<br />
<br />
{{ic|btsync-autoconfig.service}} creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER/password}}<br />
<br />
The script also creates the {{ic|storage_path}} directory set in the config file if it does not exist. This is done intependently from the creation of the config file.<br />
<br />
== Unofficial GUI ==<br />
The {{AUR|btsync-gui}} package provices an unofficial clone of the GUI interface for BTSync available for Windows. By default it disables the WebGUI interface for security reasons. If you want to migrate your existing BTSync setup - move the contents of your current storage folder (probably ~/.config/btsync) to ~/.btsync and disable the btsync@user Systemd service, that you're using currently.<br />
<br />
==Troubleshooting==<br />
<br />
===Missing storage path===<br />
<br />
If you start the service but can't reach the WebUI, check the status of the btsync by entering {{ic|systemctl status btsync@user}}.<br />
<br />
A common error is {{ic|Storage path specified in config file does not exist.}}. This is easily fixed by {{ic|mkdir ~/.btsync}}, or whatever your {{ic|storage_path}} is set to.<br />
<br />
===WebUI is not running on port 8888===<br />
<br />
If the config file was generated by {{AUR|btsync-autoconfig}} it will be configured with a different port. Rather than 8888, the port for the user's instance of {{ic|btsync}} will be {{ic|7889 + $UID}}. If your {{ic|$UID}} is "1000", the port will be 8889.<br />
<br />
===Ignore some files/folders syncronization===<br />
<br />
If you have files in your sync folder that you don't want BitTorrent Sync to track, you can use .SyncIgnore. .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules for ignoring during the synchronization job. It supports '?' and '*' wildcard symbols.<br />
<br />
Note that .SyncIgnore is applied only to the folder where it is contained and will not work with the files that have already been synced. If you add indexed files to .SyncIgnore, they will be deleted on other syncing devices. In order to avoid this:<br />
<br />
* Remove the folder from sync on all the devices.<br />
* Modify .SyncIgnore file on all of them so that it contains same info.<br />
* Re-add the modified folders.<br />
<br />
===ARM alignment error===<br />
<br />
Add the line {{ic|w /proc/cpu/alignment - - - - 2}} to {{ic|/etc/tmpfiles.d/btsync.conf}}. (You need to create the file).<br><br />
Note that this may lead to performance degradation.<br />
<br />
==See Also==<br />
<br />
[http://www.bittorrent.com/help/faq/sync Official BitTorrent Sync FAQ]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=327359Resilio Sync2014-07-28T14:42:06Z<p>Emlun: /* WebUI is not running on {{ic|7889 + $UID}} */ Delete section - btsync-autoconfig now creates the storage_path directory if needed</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:BitTorrent_Sync]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relies on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon. This package creates a default /etc/btsync.conf for system/root operation. Before enabling with systemctl review this file and make desired changes, e.g. to the login id and password. <br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You should review the configuration settings especially user and password, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The {{ic|btsync}} executable does not create the {{ic|storage_path}} directory if it doesn't exist, you will have to do this manually or use [[#Automatic_config_file_creation]].}}<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{AUR|btsync-autoconfig}} package provides a systemd user service ({{ic|btsync-autoconfig.service}}) which, if enabled, triggers when a user's {{ic|btsync.service}} starts and creates a config file with default values if it does not already exist. The install script enables the service for all users by default. Although disabling it defeats most of its purpose, it can be disabled using<br />
<br />
# systemctl --global disable btsync-autoconfig.service<br />
<br />
Individual users can then enable it if they like:<br />
<br />
$ systemctl --user enable btsync-autoconfig.service<br />
<br />
{{ic|btsync-autoconfig.service}} creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER/password}}<br />
<br />
The script also creates the {{ic|storage_path}} directory set in the config file if it does not exist. This is done intependently from the creation of the config file.<br />
<br />
== Unofficial GUI ==<br />
The {{AUR|btsync-gui}} package provices an unofficial clone of the GUI interface for BTSync available for Windows. By default it disables the WebGUI interface for security reasons. If you want to migrate your existing BTSync setup - move the contents of your current storage folder (probably ~/.config/btsync) to ~/.btsync and disable the btsync@user Systemd service, that you're using currently.<br />
<br />
==Troubleshooting==<br />
<br />
===Missing storage path===<br />
<br />
If you start the service but can't reach the WebUI, check the status of the btsync by entering {{ic|systemctl status btsync@user}}.<br />
<br />
A common error is {{ic|Storage path specified in config file does not exist.}}. {{AUR|btsync-autoconfig}} does generate a config file, but not the storage directory, do so by entering e.g. {{ic|mkdir ~/.btsync}}.<br />
<br />
===WebUI is not running on port 8888===<br />
<br />
If the config file was generated by {{AUR|btsync-autoconfig}} it will be configured with a different port. Rather than 8888, the port for the user's instance of {{ic|btsync}} will be {{ic|7889 + $UID}}. If your {{ic|$UID}} is "1000", the port will be 8889.<br />
<br />
===Ignore some files/folders syncronization===<br />
<br />
If you have files in your sync folder that you don't want BitTorrent Sync to track, you can use .SyncIgnore. .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules for ignoring during the synchronization job. It supports '?' and '*' wildcard symbols.<br />
<br />
Note that .SyncIgnore is applied only to the folder where it is contained and will not work with the files that have already been synced. If you add indexed files to .SyncIgnore, they will be deleted on other syncing devices. In order to avoid this:<br />
<br />
* Remove the folder from sync on all the devices.<br />
* Modify .SyncIgnore file on all of them so that it contains same info.<br />
* Re-add the modified folders.<br />
<br />
===ARM alignment error===<br />
<br />
Add the line {{ic|w /proc/cpu/alignment - - - - 2}} to {{ic|/etc/tmpfiles.d/btsync.conf}}. (You need to create the file).<br><br />
Note that this may lead to performance degradation.<br />
<br />
==See Also==<br />
<br />
[http://www.bittorrent.com/help/faq/sync Official BitTorrent Sync FAQ]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=327358Resilio Sync2014-07-28T14:39:51Z<p>Emlun: /* Configuration */ Add notice about btsync not creating storage_path automatically</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:BitTorrent_Sync]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relies on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon. This package creates a default /etc/btsync.conf for system/root operation. Before enabling with systemctl review this file and make desired changes, e.g. to the login id and password. <br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You should review the configuration settings especially user and password, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The {{ic|btsync}} executable does not create the {{ic|storage_path}} directory if it doesn't exist, you will have to do this manually or use [[#Automatic_config_file_creation]].}}<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{AUR|btsync-autoconfig}} package provides a systemd user service ({{ic|btsync-autoconfig.service}}) which, if enabled, triggers when a user's {{ic|btsync.service}} starts and creates a config file with default values if it does not already exist. The install script enables the service for all users by default. Although disabling it defeats most of its purpose, it can be disabled using<br />
<br />
# systemctl --global disable btsync-autoconfig.service<br />
<br />
Individual users can then enable it if they like:<br />
<br />
$ systemctl --user enable btsync-autoconfig.service<br />
<br />
{{ic|btsync-autoconfig.service}} creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER/password}}<br />
<br />
The script also creates the {{ic|storage_path}} directory set in the config file if it does not exist. This is done intependently from the creation of the config file.<br />
<br />
== Unofficial GUI ==<br />
The {{AUR|btsync-gui}} package provices an unofficial clone of the GUI interface for BTSync available for Windows. By default it disables the WebGUI interface for security reasons. If you want to migrate your existing BTSync setup - move the contents of your current storage folder (probably ~/.config/btsync) to ~/.btsync and disable the btsync@user Systemd service, that you're using currently.<br />
<br />
==Troubleshooting==<br />
<br />
===Missing storage path===<br />
<br />
If you start the service but can't reach the WebUI, check the status of the btsync by entering {{ic|systemctl status btsync@user}}.<br />
<br />
A common error is {{ic|Storage path specified in config file does not exist.}}. {{AUR|btsync-autoconfig}} does generate a config file, but not the storage directory, do so by entering e.g. {{ic|mkdir ~/.btsync}}.<br />
<br />
===WebUI is not running on port 8888===<br />
<br />
If the config file was generated by {{AUR|btsync-autoconfig}} it will be configured with a different port. Rather than 8888, the port for the user's instance of {{ic|btsync}} will be {{ic|7889 + $UID}}. If your {{ic|$UID}} is "1000", the port will be 8889.<br />
<br />
===WebUI is not running on {{ic|7889 + $UID}}===<br />
<br />
The {{AUR|btsync-autoconfig}} does not create $HOME/.btsync directory. This will cause the start up to fail.<br />
<br />
===Ignore some files/folders syncronization===<br />
<br />
If you have files in your sync folder that you don't want BitTorrent Sync to track, you can use .SyncIgnore. .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules for ignoring during the synchronization job. It supports '?' and '*' wildcard symbols.<br />
<br />
Note that .SyncIgnore is applied only to the folder where it is contained and will not work with the files that have already been synced. If you add indexed files to .SyncIgnore, they will be deleted on other syncing devices. In order to avoid this:<br />
<br />
* Remove the folder from sync on all the devices.<br />
* Modify .SyncIgnore file on all of them so that it contains same info.<br />
* Re-add the modified folders.<br />
<br />
===ARM alignment error===<br />
<br />
Add the line {{ic|w /proc/cpu/alignment - - - - 2}} to {{ic|/etc/tmpfiles.d/btsync.conf}}. (You need to create the file).<br><br />
Note that this may lead to performance degradation.<br />
<br />
==See Also==<br />
<br />
[http://www.bittorrent.com/help/faq/sync Official BitTorrent Sync FAQ]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=327357Resilio Sync2014-07-28T14:36:00Z<p>Emlun: /* Automatic config file creation */ Update description of btsync-autoconfig functionality</p>
<hr />
<div>[[Category:Internet applications]]<br />
[[ja:BitTorrent_Sync]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relies on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon. This package creates a default /etc/btsync.conf for system/root operation. Before enabling with systemctl review this file and make desired changes, e.g. to the login id and password. <br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You should review the configuration settings especially user and password, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{AUR|btsync-autoconfig}} package provides a systemd user service ({{ic|btsync-autoconfig.service}}) which, if enabled, triggers when a user's {{ic|btsync.service}} starts and creates a config file with default values if it does not already exist. The install script enables the service for all users by default. Although disabling it defeats most of its purpose, it can be disabled using<br />
<br />
# systemctl --global disable btsync-autoconfig.service<br />
<br />
Individual users can then enable it if they like:<br />
<br />
$ systemctl --user enable btsync-autoconfig.service<br />
<br />
{{ic|btsync-autoconfig.service}} creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER/password}}<br />
<br />
The script also creates the {{ic|storage_path}} directory set in the config file if it does not exist. This is done intependently from the creation of the config file.<br />
<br />
== Unofficial GUI ==<br />
The {{AUR|btsync-gui}} package provices an unofficial clone of the GUI interface for BTSync available for Windows. By default it disables the WebGUI interface for security reasons. If you want to migrate your existing BTSync setup - move the contents of your current storage folder (probably ~/.config/btsync) to ~/.btsync and disable the btsync@user Systemd service, that you're using currently.<br />
<br />
==Troubleshooting==<br />
<br />
===Missing storage path===<br />
<br />
If you start the service but can't reach the WebUI, check the status of the btsync by entering {{ic|systemctl status btsync@user}}.<br />
<br />
A common error is {{ic|Storage path specified in config file does not exist.}}. {{AUR|btsync-autoconfig}} does generate a config file, but not the storage directory, do so by entering e.g. {{ic|mkdir ~/.btsync}}.<br />
<br />
===WebUI is not running on port 8888===<br />
<br />
If the config file was generated by {{AUR|btsync-autoconfig}} it will be configured with a different port. Rather than 8888, the port for the user's instance of {{ic|btsync}} will be {{ic|7889 + $UID}}. If your {{ic|$UID}} is "1000", the port will be 8889.<br />
<br />
===WebUI is not running on {{ic|7889 + $UID}}===<br />
<br />
The {{AUR|btsync-autoconfig}} does not create $HOME/.btsync directory. This will cause the start up to fail.<br />
<br />
===Ignore some files/folders syncronization===<br />
<br />
If you have files in your sync folder that you don't want BitTorrent Sync to track, you can use .SyncIgnore. .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules for ignoring during the synchronization job. It supports '?' and '*' wildcard symbols.<br />
<br />
Note that .SyncIgnore is applied only to the folder where it is contained and will not work with the files that have already been synced. If you add indexed files to .SyncIgnore, they will be deleted on other syncing devices. In order to avoid this:<br />
<br />
* Remove the folder from sync on all the devices.<br />
* Modify .SyncIgnore file on all of them so that it contains same info.<br />
* Re-add the modified folders.<br />
<br />
===ARM alignment error===<br />
<br />
Add the line {{ic|w /proc/cpu/alignment - - - - 2}} to {{ic|/etc/tmpfiles.d/btsync.conf}}. (You need to create the file).<br><br />
Note that this may lead to performance degradation.<br />
<br />
==See Also==<br />
<br />
[http://www.bittorrent.com/help/faq/sync Official BitTorrent Sync FAQ]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Input_Japanese_using_uim&diff=306679Input Japanese using uim2014-03-23T04:48:23Z<p>Emlun: /* Using systemd */ D'oh, put </nowiki> back in first file listing</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[ja:Input Japanese using uim]]<br />
This page explains how to get the Japanese input to work using [http://code.google.com/p/uim/ uim].<br />
<br />
If you use SCIM, see [[Smart Common Input Method platform]].<br />
<br />
If you use IBus, see [[Ibus]].<br />
<br />
== Installation ==<br />
<br />
You need the following packages to input Japanese.<br />
<br />
* Japanese fonts<br />
* Japanese input method (Kana to Kanji conversion engine)<br />
* Input method framework: uim<br />
<br />
=== Japanese fonts ===<br />
<br />
''see also [[Fonts]] and [[Font Configuration]] for configuration or more detail.''<br />
<br />
Recommended Japanese fonts are as follows.<br />
* [http://ossipedia.ipa.go.jp/ipafont/ IPA fonts] || {{Pkg|otf-ipafont}}<br />
: A high quality and formal style opensource font set including Gothic (sans-serif) and Mincho (serif) glyphs. Default font of openSUSE-ja.<br />
* [http://dicey.org/vlgothic/ VL Gothic] ([[Arch User Repository|AUR]]: {{AUR|ttf-vlgothic}})<br />
: Default Gothic font of Debian-ja, Fedora-ja, Vine Linux, et al.<br />
* [http://www.geocities.jp/ep3797/modified_fonts_01.html UmePlus Gothic] (AUR: {{AUR|ttf-umeplus}})<br />
: Default Gothic font of Mandriva Linux ja environment.<br />
<br />
If you want to show [http://en.wikipedia.org/wiki/2channel_Shift_JIS_art 2channel Shift JIS art] properly, use one of the following fonts:<br />
* ipamona font (AUR: {{AUR|ttf-ipa-mona}})<br />
* Monapo font (AUR: {{AUR|ttf-monapo}})<br />
<br />
=== uim ===<br />
<br />
==== Using pacman ====<br />
<br />
[[pacman|Install]] {{Pkg|uim}} from the [[official repositories]].<br />
<br />
==== Compiling uim from source using PKGBUILD ====<br />
<br />
If you want to build uim with your configurationin, you can compile from source, using [[ABS]] for istance. See [http://code.google.com/p/uim/wiki/InstallUim official wiki] for all configure options.<br />
<br />
In Arch official repositories, uim is built with the following custom configuration (as of 1.8.6):<br />
* {{ic|--with-anthy-utf8}} - Enable Anthy(UTF-8) support<br />
* {{ic|--with-qt4-immodule}} - Build Qt4 immodule<br />
* {{ic|--with-qt4}} - Build uim-tools for Qt4<br />
<br />
If you want KDE4 plasma widget, install {{Pkg|automoc4}} for making dependency, and add {{ic|--enable-kde4-applet}} option to PKGBUILD file.<br />
<br />
=== Input method ===<br />
<br />
==== Anthy ====<br />
<br />
Anthy is one of the most popular Japanese input methods in the open source world. However, it has not been maintained for a long time. [http://wiki.debian.org/Teams/DebianAnthy Debian succeeds it] from May 2010.<br />
<br />
Install {{Pkg|anthy}} from the official repositories.<br />
<br />
===== Extra dictionary =====<br />
<br />
Anthy's default dictionary does not include several characters which are not specified on EUC-JP (JIS X 0208) such as "①", "♥", etc. [http://en.sourceforge.jp/projects/alt-cannadic/ alt-cannadic] provides extra dictionaries including those characters.<br />
<br />
Get [http://en.sourceforge.jp/projects/alt-cannadic/releases/?package_id=6129 alt-cannadic dictionary] and put them under your {{Ic|~/.anthy/imported_words_default.d}}.<br />
$ tar jxvf alt-cannadic-091230.tar.bz2<br />
$ mkdir ~/.anthy/imported_words_default.d (if not exist)<br />
$ cp alt-cannadic-091230/extra/*.t ~/.anthy/imported_words_default.d/<br />
<br />
Please see [http://sourceforge.jp/projects/alt-cannadic/wiki/%E4%BD%BF%E3%81%84%E6%96%B9_Anthy-UTF-8 official wiki] for more detail (Japanese).<br />
<br />
{{Warning|If you will be using this extra dictionary, choose '''Anthy (UTF-8)''' for default input method on uim.}}<br />
<br />
==== Modified Anthy (anthy-ut) ====<br />
<br />
[http://www.geocities.jp/ep3797/anthy_dict_01.html Modified Anthy] is a set of patches and huge extended dictionaries which aims to improve the Kana to Kanji conversion quality of original Anthy.<br />
<br />
Modified Anthy consists two different upstreams:<br />
* Patched source of Anthy by [http://www.fenix.ne.jp/~G-HAL/soft/nosettle/#anthy G-HAL]<br />
* Huge extended dictionalies by [http://www.geocities.jp/ep3797/anthy_dict_01.html UTSUMI]<br />
<br />
{{Warning|<br />
* Modified Anthy applies to only Anthy (UTF-8). So you have to choose '''Anthy (UTF-8)''' for default input method on uim.<br />
* Modified Anthy does not have compatibility of the dictionaries and learning data with original Anthy.<br />
}}<br />
<br />
===== Compiling modified Anthy using PKGBUILD =====<br />
<br />
Modified Anthy is available on AUR named {{AUR|anthy-ut}}.<br />
<br />
Get anthy-ut tarball and makepkg to make and install package:<br />
$ wget https://aur.archlinux.org/packages/anthy-ut/anthy-ut.tar.gz<br />
$ tar xvf anthy-ut.tar.gz<br />
$ cd anthy-ut<br />
$ makepkg -s -i<br />
<br />
If you already use original Anthy, you have to convert the existing learning data format.<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
(Though this step repeats the same commands twice, it is not mistypes.)<br />
<br />
==== Anthy Kaomoji ====<br />
<br />
[http://sourceforge.jp/projects/anthy/ Anthy Kaomoji] is a modified version of Anthy that converts Hiragana text to Kana Kanji mixed text and has emoticon (顔文字) and 2ch dictionaries.<br />
It can be found in the AUR ({{AUR|anthy-kaomoji}}).<br />
<br />
==== Mozc ====<br />
<br />
''See [[Mozc]].''<br />
<br />
[http://code.google.com/p/mozc/ Mozc] is a Japanese Input Method Editor (IME) designed for multi-platform such as Chromium OS, Windows, Mac and Linux which originates from [http://www.google.com/intl/ja/ime/ Google Japanese Input].<br />
<br />
Though {{AUR|Mozc}} adapts to only ibus input method framework, [http://code.google.com/p/macuim/ macuim] provides uim-mozc plugin.<br />
<br />
===== Mozc (Vanilla) =====<br />
<br />
{{AUR|uim-mozc}} is available on AUR.<br />
{{Note|This does not support kill_line feature of uim-mozc.}}<br />
You can install this from unofficial user repository. Add the following into your /etc/pacman.conf:<br />
[pnsft-pur]<br />
SigLevel = Optional TrustAll<br />
Server = http://downloads.sourceforge.net/project/pnsft-aur/pur/$arch<br />
{{Note|This repo provides x86_64 packages only now.}}<br />
And refresh package database:<br />
# pacman -Syy<br />
You can choose install packages specifying group name as follows:<br />
# pacman -S mozc-im<br />
Or, specify package names directly. For example:<br />
# pacman -S uim-mozc<br />
<br />
===== mozc-ut and mozc-svn =====<br />
<br />
{{AUR|mozc-ut}} and {{AUR|mozc-svn}} can be built uim-mozc.<br />
{{Note|mozc-ut can work with {{AUR|uim-mozc}}.}}<br />
To build uim-mozc, edit PKGBUILD like follow, i,e. uncomment {{Ic|1=_uim_mozc=}} line:<br />
## If you will not be using ibus, comment out below.<br />
_ibus_mozc="yes"<br />
## If you will be using uim, uncomment below.<br />
_uim_mozc="yes"<br />
## If applying patch for uim-mozc fails, try to uncomment below.<br />
#_kill_kill_line="yes"<br />
## This will disable the 'kill-line' function of uim-mozc.<br />
{{Tip|If you will never be using ibus-mozc, comment out the {{Ic|1=_ibus_mozc=}} line.}}<br />
<br />
===== Registering Mozc =====<br />
<br />
{{Warning|You '''must''' run the following command whenever you upgrade or (re-)install uim.<br/><br />
# uim-module-manager --register mozc}}<br />
<br />
==== Google CGI API for Japanese input ====<br />
<br />
[http://www.google.co.jp/ime/cgiapi.html Google CGI API for Japanese Input] (Google-CGIAPI-Jp) is CGI service to provide Japanese conversion on the Internet by Google. It can be used on [http://www.google.com/transliterate web browser]. Its conversion engine seems to be equivalent to Google Japanese Input, so conversion quality is probably better than Mozc.<br />
<br />
{{Note|This service sends/receives preedits and candidates as plain text (as of 2012-09).}}<br />
<br />
You can use it via uim. Choose "Google-CGIAPI-Jp" on uim-im-switcher-gtk/gtk3/qt4 or uim-pref-gtk/gtk3/qt4.<br />
<br />
== Settings ==<br />
<br />
=== Environment variables ===<br />
<br />
Add the following to ~/.[[xprofile]], ~/.[[xinitrc]] or ~/.xsession:<br />
<br />
export GTK_IM_MODULE='uim'<br />
export QT_IM_MODULE='uim'<br />
uim-xim &<br />
export XMODIFIERS='@im=uim'<br />
<br />
{{Note|The variables should be exported before starting your desktop environment, i.e. before "exec startxfce4" or similar. [[#Using_systemd|See below]] if you're using systemd to manage your X session. }}<br />
<br />
=== Toolbar utilities ===<br />
<br />
If you want to use UimToolbar utilities which shows and controls uim mode, add '''one''' of the followings, too.<br />
<br />
==== uim-toolbar-gtk/qt ====<br />
<br />
Using toolbar appears as a window.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3 &<br />
For Qt4:<br />
uim-toolbar-qt4 &<br />
<br />
==== uim-toolbar-gtk-systray ====<br />
<br />
Using toolbar for system tray.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk-systray &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3-systray &<br />
<br />
==== Panel applet ====<br />
<br />
Or, if you use GNOME, KDE or Xfce, you can use uim-toolbar panel applet (Xfce requires xfce4-xfapplet-plugin to use uim-applet-gnome).<br />
<br />
=== Using systemd ===<br />
<br />
If you are [[Systemd/User#Using_.2Fusr.2Flib.2Fsystemd.2Fsystemd_--user_To_Manage_Your_Session|using systemd to manage your X session]], you'll need to set the environment variables in your systemd session rather than an init script.<br />
<br />
{{hc|~/.config/systemd/user/uim-env.service|<nowiki><br />
[Unit]<br />
Description=uim environment initialization<br />
Before=xorg.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/systemctl --user set-environment XMODIFIERS=@im=uim<br />
ExecStart=/usr/bin/systemctl --user set-environment GTK_IM_MODULE=uim<br />
ExecStart=/usr/bin/systemctl --user set-environment QT_IM_MODULE=uim<br />
</nowiki>}}<br />
<br />
{{hc|~/.config/systemd/user/uim.service|<nowiki><br />
[Unit]<br />
Description=uim daemon<br />
Wants=uim-env.service<br />
After=xorg.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-xim<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=xorg.target</nowiki><br />
}}<br />
<br />
{{hc|~/.config/systemd/user/uim-toolbar.service|<nowiki><br />
[Unit]<br />
Description=uim toolbar<br />
PartOf=uim.service<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-toolbar-of-your-choice<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=uim.service</nowiki><br />
}}<br />
<br />
Lastly, you'll need to enable the services:<br />
$ systemctl --user enable uim.service uim-toolbar.service<br />
<br />
=== uim preferences ===<br />
<br />
Configure uim preferences by running :<br />
$ uim-pref-gtk (Or, uim-pref-gtk3/uim-pref-qt4)<br />
which brings forth a GUI.<br />
<br />
Choose your preferring input method as 'Default input method'.<br />
{{Note|Mozc will be not listed in 'Default input method' at first time so you will need to add it into 'Enabled input methods' to use.}}<br />
<br />
You can run {{ic|uim-xim}} or restart X to test your settings.<br />
<br />
Provided everything went well you should be able to input Japanese in X.<br />
<br />
=== Input Japanese on Emacs ===<br />
<br />
uim provides uim.el the bridge software between Emacs and uim. Here is a sample to use uim on Emacs with utf-8 encoding. <br />
<br />
Please see [http://code.google.com/p/uim/wiki/UimEl Official wiki] for more detail.<br />
<br />
==== LEIM or minor-mode ====<br />
<br />
You can call uim.el from Emacs in two ways; directly or with the LEIM (Library of Emacs Input Method) framework. Though settings of them are different, basic functions are same. If you want to switch between uim.el and other Emacs IMs frequently, you should use LEIM framework.<br />
<br />
===== Settings for the minor-mode =====<br />
<br />
If you will be using on minor-mode, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; read uim.el<br />
(require 'uim)<br />
;; uncomment next and comment out previous to load uim.el on-demand<br />
;; (autoload 'uim-mode "uim" nil t)<br />
<br />
;; key-binding for activate uim (ex. C-\)<br />
(global-set-key "\C-\\" 'uim-mode)<br />
<br />
===== Settings for the LEIM =====<br />
<br />
If you will be using via LEIM, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing and choose default input method.<br />
;; read uim.el with LEIM initializing<br />
(require 'uim-leim)<br />
<br />
;; set default IM. Uncomment the one of the followings.<br />
;(setq default-input-method "japanese-anthy-utf8-uim") ; Anthy (UTF-8)<br />
;(setq default-input-method "japanese-google-cgiapi-jp-uim") ; Google-CGIAPI-Jp<br />
;(setq default-input-method "japanese-mozc-uim") ; Mozc<br />
<br />
==== Preferred character encoding ====<br />
<br />
uim.el uses euc-jp character encoding by default. To set UTF-8 as preferred encodings, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; Set UTF-8 as preferred character encoding (default is euc-jp).<br />
(setq uim-lang-code-alist<br />
(cons '("Japanese" "Japanese" utf-8 "UTF-8")<br />
(delete (assoc "Japanese" uim-lang-code-alist) <br />
uim-lang-code-alist)))<br />
<br />
==== Enable inline candidates displaying mode by default ====<br />
<br />
The inline candidates displaying mode displays conversion candidates just below (or above) preedit text vertically instead of echo area. If you want to enable inline candidates displaying mode by default, write as follows.<br />
;; set inline candidates displaying mode as default<br />
(setq uim-candidate-display-inline t)<br />
<br />
==== Set Hiragana input mode by default ====<br />
<br />
To set Hiragana input mode at activting uim, add the settings like follows:<br />
<br />
;; Set Hiragana input mode at activating uim.<br />
(setq uim-default-im-prop '("action_anthy_utf8_hiragana"<br />
"action_google-cgiapi-jp_hiragana"<br />
"action_mozc_hiragana"))<br />
<br />
==== Ignoring C-SPC on uim.el ====<br />
<br />
When you are assigning activation/deactivation of input method to C-SPC, C-SPC is stolen to switch input mode by uim.el while it is activated. To prevent the stealing and use for set-mark-command, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
(add-hook 'uim-load-hook<br />
'(lambda ()<br />
(define-key uim-mode-map [67108896] nil)<br />
(define-key uim-mode-map [0] nil)))<br />
<br />
==== Disabling XIM on Emacs ====<br />
<br />
When you are using input method on your desktop and assigning activation/deactivation of input method to C-SPC, you will be not able to use C-SPC/C-@ as set-mark-command on Emacs. To avoid this problem, add the following into your {{Ic|~/.Xresources}} or {{Ic|~/.Xdefaults}}. xim will be disabled on Emacs.<br />
Emacs*UseXIM: false<br />
<br />
== Troubleshooting ==<br />
<br />
=== Set the GTK_IM_MODULE variable, but uim still not works with GTK+ 2 applications ===<br />
<br />
In case you already set the GTK_IM_MODULE environmental variable, but uim still not works with GTK+ 2 applications, you need to specify the location of gtk.immodules, which is created by and can be generated with {{Ic|gtk-query-immodules-2.0}}.<br />
<br />
The default location is {{Ic|/etc/gtk-2.0/gtk.immodules}} for GTK+ 2.<br />
<br />
You can do this with either the GTK_IM_MODULE_FILE variable (''not recommended'', it causes GTK+ 3 applications to see incompatible modules) or the im_module_file setting (''recommended'').<br />
<br />
Add the following to {{Ic|/etc/gtk-2.0/gtkrc}} or {{Ic|~/.gtkrc-2.0}}:<br />
<br />
im_module_file "/etc/gtk-2.0/gtk.immodules"<br />
<br />
=== Cannot input Japanese on Opera ===<br />
<br />
If you use Opera and cannot input Japanese with uim, try to edit environment variable as follows:<br />
Make sure to add follows in the beginning of /usr/bin/opera.<br />
<br />
export XMODIFIERS='@im=uim'<br />
export QT_IM_MODULE='xim'<br />
<br />
=== Cannot type a consonant in Zenkaku mode ===<br />
<br />
If you cannot type a consonant in Zenkaku mode, add follows to your config file.<br />
<br />
e.g. vi ~/.uim.d/customs/custom-google-cgiapi-jp.scm<br />
<br />
(define ja-rk-rule-hoge<br />
(map<br />
(lambda (c)<br />
(list (cons (list c) ()) (list c c c)))<br />
'("b" "c" "d" "f" "g" "h" "j" "k" "l" "m"<br />
"p" "q" "r" "s" "t" "v" "w" "x" "y" "z"<br />
"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M"<br />
"N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")))<br />
(if (symbol-bound? 'ja-rk-rule-hoge)<br />
(set! ja-rk-rule (append ja-rk-rule-hoge ja-rk-rule)))<br />
<br />
=== uim-toolbar-gtk-systray: tray icon is crushed ===<br />
<br />
Though some of DE, WM or panel application may provide only one icon space per application on system-tray/notification-area, uim-toolbar-gtk-systray displays some icons on it by default so those icons are crushed. Choose just one of them to solve it. The steps to display only 'Input mode' icon for example as follows:<br />
# Run {{Ic|uim-pref-gtk}}.<br />
# Click 'Toolbar' on 'Group' list.<br />
# Take the all checkmarks off.<br />
# Click 'Anthy', 'Anthy (UTF-8)' or 'Mozc' which you are using on 'Group' list.<br />
# Click Edit button in 'Toolbar' box > 'Enable toolbar buttons' line.<br />
# Enable only 'Input mode' and click 'Close' button.<br />
# Click 'OK' button to close uim-pref-gtk.<br />
The tray icon will be displayed "あ" (Hiragana mode) or "ー" (Direct mode).<br />
<br />
=== I use darker theme, I cannot read the uim mode icons ===<br />
<br />
You can choose icons for darker background (uim 1.6.0 or later).<br />
# Run uim-perf-gtk<br />
# Click 'Toolbar' on 'Group' list.<br />
# Check 'Use icon for dark background'.<br />
<br />
== See also ==<br />
<br />
;uim<br />
:[http://code.google.com/p/uim/wiki/OfficialUserDocument uim official document]<br />
:[http://en.wikibooks.org/wiki/Uim uim on wikibooks]<br />
<br />
;Fonts<br />
:[http://www.geocities.jp/ep3797/japanese_fonts.html Japanese fonts showcase]<br />
:[http://www.geocities.jp/ep3797/modified_fonts_01.html modified Japanese fonts]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Input_Japanese_using_uim&diff=306678Input Japanese using uim2014-03-23T04:45:48Z<p>Emlun: /* Using systemd */ Remove GTK_IM_MODULE_FILE line</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[ja:Input Japanese using uim]]<br />
This page explains how to get the Japanese input to work using [http://code.google.com/p/uim/ uim].<br />
<br />
If you use SCIM, see [[Smart Common Input Method platform]].<br />
<br />
If you use IBus, see [[Ibus]].<br />
<br />
== Installation ==<br />
<br />
You need the following packages to input Japanese.<br />
<br />
* Japanese fonts<br />
* Japanese input method (Kana to Kanji conversion engine)<br />
* Input method framework: uim<br />
<br />
=== Japanese fonts ===<br />
<br />
''see also [[Fonts]] and [[Font Configuration]] for configuration or more detail.''<br />
<br />
Recommended Japanese fonts are as follows.<br />
* [http://ossipedia.ipa.go.jp/ipafont/ IPA fonts] || {{Pkg|otf-ipafont}}<br />
: A high quality and formal style opensource font set including Gothic (sans-serif) and Mincho (serif) glyphs. Default font of openSUSE-ja.<br />
* [http://dicey.org/vlgothic/ VL Gothic] ([[Arch User Repository|AUR]]: {{AUR|ttf-vlgothic}})<br />
: Default Gothic font of Debian-ja, Fedora-ja, Vine Linux, et al.<br />
* [http://www.geocities.jp/ep3797/modified_fonts_01.html UmePlus Gothic] (AUR: {{AUR|ttf-umeplus}})<br />
: Default Gothic font of Mandriva Linux ja environment.<br />
<br />
If you want to show [http://en.wikipedia.org/wiki/2channel_Shift_JIS_art 2channel Shift JIS art] properly, use one of the following fonts:<br />
* ipamona font (AUR: {{AUR|ttf-ipa-mona}})<br />
* Monapo font (AUR: {{AUR|ttf-monapo}})<br />
<br />
=== uim ===<br />
<br />
==== Using pacman ====<br />
<br />
[[pacman|Install]] {{Pkg|uim}} from the [[official repositories]].<br />
<br />
==== Compiling uim from source using PKGBUILD ====<br />
<br />
If you want to build uim with your configurationin, you can compile from source, using [[ABS]] for istance. See [http://code.google.com/p/uim/wiki/InstallUim official wiki] for all configure options.<br />
<br />
In Arch official repositories, uim is built with the following custom configuration (as of 1.8.6):<br />
* {{ic|--with-anthy-utf8}} - Enable Anthy(UTF-8) support<br />
* {{ic|--with-qt4-immodule}} - Build Qt4 immodule<br />
* {{ic|--with-qt4}} - Build uim-tools for Qt4<br />
<br />
If you want KDE4 plasma widget, install {{Pkg|automoc4}} for making dependency, and add {{ic|--enable-kde4-applet}} option to PKGBUILD file.<br />
<br />
=== Input method ===<br />
<br />
==== Anthy ====<br />
<br />
Anthy is one of the most popular Japanese input methods in the open source world. However, it has not been maintained for a long time. [http://wiki.debian.org/Teams/DebianAnthy Debian succeeds it] from May 2010.<br />
<br />
Install {{Pkg|anthy}} from the official repositories.<br />
<br />
===== Extra dictionary =====<br />
<br />
Anthy's default dictionary does not include several characters which are not specified on EUC-JP (JIS X 0208) such as "①", "♥", etc. [http://en.sourceforge.jp/projects/alt-cannadic/ alt-cannadic] provides extra dictionaries including those characters.<br />
<br />
Get [http://en.sourceforge.jp/projects/alt-cannadic/releases/?package_id=6129 alt-cannadic dictionary] and put them under your {{Ic|~/.anthy/imported_words_default.d}}.<br />
$ tar jxvf alt-cannadic-091230.tar.bz2<br />
$ mkdir ~/.anthy/imported_words_default.d (if not exist)<br />
$ cp alt-cannadic-091230/extra/*.t ~/.anthy/imported_words_default.d/<br />
<br />
Please see [http://sourceforge.jp/projects/alt-cannadic/wiki/%E4%BD%BF%E3%81%84%E6%96%B9_Anthy-UTF-8 official wiki] for more detail (Japanese).<br />
<br />
{{Warning|If you will be using this extra dictionary, choose '''Anthy (UTF-8)''' for default input method on uim.}}<br />
<br />
==== Modified Anthy (anthy-ut) ====<br />
<br />
[http://www.geocities.jp/ep3797/anthy_dict_01.html Modified Anthy] is a set of patches and huge extended dictionaries which aims to improve the Kana to Kanji conversion quality of original Anthy.<br />
<br />
Modified Anthy consists two different upstreams:<br />
* Patched source of Anthy by [http://www.fenix.ne.jp/~G-HAL/soft/nosettle/#anthy G-HAL]<br />
* Huge extended dictionalies by [http://www.geocities.jp/ep3797/anthy_dict_01.html UTSUMI]<br />
<br />
{{Warning|<br />
* Modified Anthy applies to only Anthy (UTF-8). So you have to choose '''Anthy (UTF-8)''' for default input method on uim.<br />
* Modified Anthy does not have compatibility of the dictionaries and learning data with original Anthy.<br />
}}<br />
<br />
===== Compiling modified Anthy using PKGBUILD =====<br />
<br />
Modified Anthy is available on AUR named {{AUR|anthy-ut}}.<br />
<br />
Get anthy-ut tarball and makepkg to make and install package:<br />
$ wget https://aur.archlinux.org/packages/anthy-ut/anthy-ut.tar.gz<br />
$ tar xvf anthy-ut.tar.gz<br />
$ cd anthy-ut<br />
$ makepkg -s -i<br />
<br />
If you already use original Anthy, you have to convert the existing learning data format.<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
(Though this step repeats the same commands twice, it is not mistypes.)<br />
<br />
==== Anthy Kaomoji ====<br />
<br />
[http://sourceforge.jp/projects/anthy/ Anthy Kaomoji] is a modified version of Anthy that converts Hiragana text to Kana Kanji mixed text and has emoticon (顔文字) and 2ch dictionaries.<br />
It can be found in the AUR ({{AUR|anthy-kaomoji}}).<br />
<br />
==== Mozc ====<br />
<br />
''See [[Mozc]].''<br />
<br />
[http://code.google.com/p/mozc/ Mozc] is a Japanese Input Method Editor (IME) designed for multi-platform such as Chromium OS, Windows, Mac and Linux which originates from [http://www.google.com/intl/ja/ime/ Google Japanese Input].<br />
<br />
Though {{AUR|Mozc}} adapts to only ibus input method framework, [http://code.google.com/p/macuim/ macuim] provides uim-mozc plugin.<br />
<br />
===== Mozc (Vanilla) =====<br />
<br />
{{AUR|uim-mozc}} is available on AUR.<br />
{{Note|This does not support kill_line feature of uim-mozc.}}<br />
You can install this from unofficial user repository. Add the following into your /etc/pacman.conf:<br />
[pnsft-pur]<br />
SigLevel = Optional TrustAll<br />
Server = http://downloads.sourceforge.net/project/pnsft-aur/pur/$arch<br />
{{Note|This repo provides x86_64 packages only now.}}<br />
And refresh package database:<br />
# pacman -Syy<br />
You can choose install packages specifying group name as follows:<br />
# pacman -S mozc-im<br />
Or, specify package names directly. For example:<br />
# pacman -S uim-mozc<br />
<br />
===== mozc-ut and mozc-svn =====<br />
<br />
{{AUR|mozc-ut}} and {{AUR|mozc-svn}} can be built uim-mozc.<br />
{{Note|mozc-ut can work with {{AUR|uim-mozc}}.}}<br />
To build uim-mozc, edit PKGBUILD like follow, i,e. uncomment {{Ic|1=_uim_mozc=}} line:<br />
## If you will not be using ibus, comment out below.<br />
_ibus_mozc="yes"<br />
## If you will be using uim, uncomment below.<br />
_uim_mozc="yes"<br />
## If applying patch for uim-mozc fails, try to uncomment below.<br />
#_kill_kill_line="yes"<br />
## This will disable the 'kill-line' function of uim-mozc.<br />
{{Tip|If you will never be using ibus-mozc, comment out the {{Ic|1=_ibus_mozc=}} line.}}<br />
<br />
===== Registering Mozc =====<br />
<br />
{{Warning|You '''must''' run the following command whenever you upgrade or (re-)install uim.<br/><br />
# uim-module-manager --register mozc}}<br />
<br />
==== Google CGI API for Japanese input ====<br />
<br />
[http://www.google.co.jp/ime/cgiapi.html Google CGI API for Japanese Input] (Google-CGIAPI-Jp) is CGI service to provide Japanese conversion on the Internet by Google. It can be used on [http://www.google.com/transliterate web browser]. Its conversion engine seems to be equivalent to Google Japanese Input, so conversion quality is probably better than Mozc.<br />
<br />
{{Note|This service sends/receives preedits and candidates as plain text (as of 2012-09).}}<br />
<br />
You can use it via uim. Choose "Google-CGIAPI-Jp" on uim-im-switcher-gtk/gtk3/qt4 or uim-pref-gtk/gtk3/qt4.<br />
<br />
== Settings ==<br />
<br />
=== Environment variables ===<br />
<br />
Add the following to ~/.[[xprofile]], ~/.[[xinitrc]] or ~/.xsession:<br />
<br />
export GTK_IM_MODULE='uim'<br />
export QT_IM_MODULE='uim'<br />
uim-xim &<br />
export XMODIFIERS='@im=uim'<br />
<br />
{{Note|The variables should be exported before starting your desktop environment, i.e. before "exec startxfce4" or similar. [[#Using_systemd|See below]] if you're using systemd to manage your X session. }}<br />
<br />
=== Toolbar utilities ===<br />
<br />
If you want to use UimToolbar utilities which shows and controls uim mode, add '''one''' of the followings, too.<br />
<br />
==== uim-toolbar-gtk/qt ====<br />
<br />
Using toolbar appears as a window.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3 &<br />
For Qt4:<br />
uim-toolbar-qt4 &<br />
<br />
==== uim-toolbar-gtk-systray ====<br />
<br />
Using toolbar for system tray.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk-systray &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3-systray &<br />
<br />
==== Panel applet ====<br />
<br />
Or, if you use GNOME, KDE or Xfce, you can use uim-toolbar panel applet (Xfce requires xfce4-xfapplet-plugin to use uim-applet-gnome).<br />
<br />
=== Using systemd ===<br />
<br />
If you are [[Systemd/User#Using_.2Fusr.2Flib.2Fsystemd.2Fsystemd_--user_To_Manage_Your_Session|using systemd to manage your X session]], you'll need to set the environment variables in your systemd session rather than an init script.<br />
<br />
{{hc|~/.config/systemd/user/uim-env.service|<nowiki><br />
[Unit]<br />
Description=uim environment initialization<br />
Before=xorg.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/systemctl --user set-environment XMODIFIERS=@im=uim<br />
ExecStart=/usr/bin/systemctl --user set-environment GTK_IM_MODULE=uim<br />
ExecStart=/usr/bin/systemctl --user set-environment QT_IM_MODULE=uim<br />
}}<br />
<br />
{{hc|~/.config/systemd/user/uim.service|<nowiki><br />
[Unit]<br />
Description=uim daemon<br />
Wants=uim-env.service<br />
After=xorg.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-xim<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=xorg.target</nowiki><br />
}}<br />
<br />
{{hc|~/.config/systemd/user/uim-toolbar.service|<nowiki><br />
[Unit]<br />
Description=uim toolbar<br />
PartOf=uim.service<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-toolbar-of-your-choice<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=uim.service</nowiki><br />
}}<br />
<br />
Lastly, you'll need to enable the services:<br />
$ systemctl --user enable uim.service uim-toolbar.service<br />
<br />
=== uim preferences ===<br />
<br />
Configure uim preferences by running :<br />
$ uim-pref-gtk (Or, uim-pref-gtk3/uim-pref-qt4)<br />
which brings forth a GUI.<br />
<br />
Choose your preferring input method as 'Default input method'.<br />
{{Note|Mozc will be not listed in 'Default input method' at first time so you will need to add it into 'Enabled input methods' to use.}}<br />
<br />
You can run {{ic|uim-xim}} or restart X to test your settings.<br />
<br />
Provided everything went well you should be able to input Japanese in X.<br />
<br />
=== Input Japanese on Emacs ===<br />
<br />
uim provides uim.el the bridge software between Emacs and uim. Here is a sample to use uim on Emacs with utf-8 encoding. <br />
<br />
Please see [http://code.google.com/p/uim/wiki/UimEl Official wiki] for more detail.<br />
<br />
==== LEIM or minor-mode ====<br />
<br />
You can call uim.el from Emacs in two ways; directly or with the LEIM (Library of Emacs Input Method) framework. Though settings of them are different, basic functions are same. If you want to switch between uim.el and other Emacs IMs frequently, you should use LEIM framework.<br />
<br />
===== Settings for the minor-mode =====<br />
<br />
If you will be using on minor-mode, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; read uim.el<br />
(require 'uim)<br />
;; uncomment next and comment out previous to load uim.el on-demand<br />
;; (autoload 'uim-mode "uim" nil t)<br />
<br />
;; key-binding for activate uim (ex. C-\)<br />
(global-set-key "\C-\\" 'uim-mode)<br />
<br />
===== Settings for the LEIM =====<br />
<br />
If you will be using via LEIM, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing and choose default input method.<br />
;; read uim.el with LEIM initializing<br />
(require 'uim-leim)<br />
<br />
;; set default IM. Uncomment the one of the followings.<br />
;(setq default-input-method "japanese-anthy-utf8-uim") ; Anthy (UTF-8)<br />
;(setq default-input-method "japanese-google-cgiapi-jp-uim") ; Google-CGIAPI-Jp<br />
;(setq default-input-method "japanese-mozc-uim") ; Mozc<br />
<br />
==== Preferred character encoding ====<br />
<br />
uim.el uses euc-jp character encoding by default. To set UTF-8 as preferred encodings, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; Set UTF-8 as preferred character encoding (default is euc-jp).<br />
(setq uim-lang-code-alist<br />
(cons '("Japanese" "Japanese" utf-8 "UTF-8")<br />
(delete (assoc "Japanese" uim-lang-code-alist) <br />
uim-lang-code-alist)))<br />
<br />
==== Enable inline candidates displaying mode by default ====<br />
<br />
The inline candidates displaying mode displays conversion candidates just below (or above) preedit text vertically instead of echo area. If you want to enable inline candidates displaying mode by default, write as follows.<br />
;; set inline candidates displaying mode as default<br />
(setq uim-candidate-display-inline t)<br />
<br />
==== Set Hiragana input mode by default ====<br />
<br />
To set Hiragana input mode at activting uim, add the settings like follows:<br />
<br />
;; Set Hiragana input mode at activating uim.<br />
(setq uim-default-im-prop '("action_anthy_utf8_hiragana"<br />
"action_google-cgiapi-jp_hiragana"<br />
"action_mozc_hiragana"))<br />
<br />
==== Ignoring C-SPC on uim.el ====<br />
<br />
When you are assigning activation/deactivation of input method to C-SPC, C-SPC is stolen to switch input mode by uim.el while it is activated. To prevent the stealing and use for set-mark-command, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
(add-hook 'uim-load-hook<br />
'(lambda ()<br />
(define-key uim-mode-map [67108896] nil)<br />
(define-key uim-mode-map [0] nil)))<br />
<br />
==== Disabling XIM on Emacs ====<br />
<br />
When you are using input method on your desktop and assigning activation/deactivation of input method to C-SPC, you will be not able to use C-SPC/C-@ as set-mark-command on Emacs. To avoid this problem, add the following into your {{Ic|~/.Xresources}} or {{Ic|~/.Xdefaults}}. xim will be disabled on Emacs.<br />
Emacs*UseXIM: false<br />
<br />
== Troubleshooting ==<br />
<br />
=== Set the GTK_IM_MODULE variable, but uim still not works with GTK+ 2 applications ===<br />
<br />
In case you already set the GTK_IM_MODULE environmental variable, but uim still not works with GTK+ 2 applications, you need to specify the location of gtk.immodules, which is created by and can be generated with {{Ic|gtk-query-immodules-2.0}}.<br />
<br />
The default location is {{Ic|/etc/gtk-2.0/gtk.immodules}} for GTK+ 2.<br />
<br />
You can do this with either the GTK_IM_MODULE_FILE variable (''not recommended'', it causes GTK+ 3 applications to see incompatible modules) or the im_module_file setting (''recommended'').<br />
<br />
Add the following to {{Ic|/etc/gtk-2.0/gtkrc}} or {{Ic|~/.gtkrc-2.0}}:<br />
<br />
im_module_file "/etc/gtk-2.0/gtk.immodules"<br />
<br />
=== Cannot input Japanese on Opera ===<br />
<br />
If you use Opera and cannot input Japanese with uim, try to edit environment variable as follows:<br />
Make sure to add follows in the beginning of /usr/bin/opera.<br />
<br />
export XMODIFIERS='@im=uim'<br />
export QT_IM_MODULE='xim'<br />
<br />
=== Cannot type a consonant in Zenkaku mode ===<br />
<br />
If you cannot type a consonant in Zenkaku mode, add follows to your config file.<br />
<br />
e.g. vi ~/.uim.d/customs/custom-google-cgiapi-jp.scm<br />
<br />
(define ja-rk-rule-hoge<br />
(map<br />
(lambda (c)<br />
(list (cons (list c) ()) (list c c c)))<br />
'("b" "c" "d" "f" "g" "h" "j" "k" "l" "m"<br />
"p" "q" "r" "s" "t" "v" "w" "x" "y" "z"<br />
"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M"<br />
"N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")))<br />
(if (symbol-bound? 'ja-rk-rule-hoge)<br />
(set! ja-rk-rule (append ja-rk-rule-hoge ja-rk-rule)))<br />
<br />
=== uim-toolbar-gtk-systray: tray icon is crushed ===<br />
<br />
Though some of DE, WM or panel application may provide only one icon space per application on system-tray/notification-area, uim-toolbar-gtk-systray displays some icons on it by default so those icons are crushed. Choose just one of them to solve it. The steps to display only 'Input mode' icon for example as follows:<br />
# Run {{Ic|uim-pref-gtk}}.<br />
# Click 'Toolbar' on 'Group' list.<br />
# Take the all checkmarks off.<br />
# Click 'Anthy', 'Anthy (UTF-8)' or 'Mozc' which you are using on 'Group' list.<br />
# Click Edit button in 'Toolbar' box > 'Enable toolbar buttons' line.<br />
# Enable only 'Input mode' and click 'Close' button.<br />
# Click 'OK' button to close uim-pref-gtk.<br />
The tray icon will be displayed "あ" (Hiragana mode) or "ー" (Direct mode).<br />
<br />
=== I use darker theme, I cannot read the uim mode icons ===<br />
<br />
You can choose icons for darker background (uim 1.6.0 or later).<br />
# Run uim-perf-gtk<br />
# Click 'Toolbar' on 'Group' list.<br />
# Check 'Use icon for dark background'.<br />
<br />
== See also ==<br />
<br />
;uim<br />
:[http://code.google.com/p/uim/wiki/OfficialUserDocument uim official document]<br />
:[http://en.wikibooks.org/wiki/Uim uim on wikibooks]<br />
<br />
;Fonts<br />
:[http://www.geocities.jp/ep3797/japanese_fonts.html Japanese fonts showcase]<br />
:[http://www.geocities.jp/ep3797/modified_fonts_01.html modified Japanese fonts]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Systemd/Services&diff=306677Systemd/Services2014-03-23T04:43:40Z<p>Emlun: /* uim */ Move to Input_Japanese_using_uim#Using_systemd</p>
<hr />
<div>{{Deletion|Please don't add any new elements to this page. All services must/will be relocated on their dedicated corresponding main article.}}<br />
{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd FAQ}}<br />
{{Related|Daemons List}}<br />
{{Related articles end}}<br />
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the [[official repositories]] or the [[AUR]]. These files can be copied from other distributions or created by yourself.<br />
<br />
== darkhttpd ==<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.service|<nowiki><br />
[Unit]<br />
Description=Darkhttpd Webserver<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/darkhttpd<br />
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_OPTS<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.socket|<nowiki><br />
[Unit]<br />
Conflicts=darkhttpd.service<br />
<br />
[Socket]<br />
ListenStream=80<br />
Accept=no<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/darkhttpd|<nowiki><br />
DARKHTTPD_ROOT="/srv/http"<br />
DARKHTTPD_OPTS="--uid nobody --gid nobody --chroot"<br />
</nowiki>}}<br />
<br />
== screen ==<br />
<br />
{{Merge|GNU Screen}}<br />
<br />
Autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Static Ethernet network ==<br />
<br />
This is a custom service file for static Ethernet configurations.<br />
<br />
{{hc|/etc/conf.d/network|<nowiki><br />
address=192.168.0.15<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for <interface><br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-<interface>.device <br />
After=sys-subsystem-net-devices-<interface>.device <br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network<br />
ExecStart=/usr/bin/ip link set dev <interface> up<br />
ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev <interface><br />
ExecStart=/usr/bin/ip route add default via ${gateway}<br />
ExecStop=/usr/bin/ip addr flush dev <interface><br />
ExecStop=/usr/bin/ip link set dev <interface> down<br />
Execstop=/sbin/ip addr delete ${address}/${netmask} dev <interface><br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
To set static IP on {{ic|enp3s0}} interface you will need to create {{ic|/etc/conf.d/network@enp3s0}} config file and run:<br />
<br />
# systemctl enable network@enp3s0.service<br />
<br />
== Set network interface in promiscuous mode ==<br />
<br />
{{hc|/etc/systemd/system/promiscuous@.service|<nowiki><br />
[Unit]<br />
Description=Set %i interface in promiscuous mode<br />
After=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/ip link set dev %i promisc on<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
If you want to enable promiscuous mode on interface {{ic|eth0}} run:<br />
<br />
# systemctl enable promiscuous@eth0.service<br />
<br />
== tpfand ==<br />
<br />
{{hc|/etc/systemd/system/tpfand.service|<nowiki><br />
[Unit]<br />
Description=ThinkPad Fan Control<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/tpfand.pid<br />
ExecStart=/usr/sbin/tpfand<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== MPD socket activation ==<br />
<br />
{{Merge|MPD}}<br />
<br />
If the following {{ic|mpd.socket}} file is enabled while {{ic|mpd.service}} (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start {{ic|mpd.service}} and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} ''AND'' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for more details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
<br />
{{hc|/usr/lib/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
== VideoLAN 2.0 ==<br />
<br />
Change the {{ic|1=User=}} parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|<nowiki><br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=nobody<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Xvfb ==<br />
<br />
Change the {{ic|1=User=}} and {{ic|1=Group=}} parameters:<br />
<br />
{{hc|/etc/systemd/system/xinit.service|<nowiki><br />
[Unit]<br />
Description=xinit with xvfb<br />
After=network.target<br />
<br />
[Service]<br />
User=bitlbee<br />
Group=bitlbee<br />
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Cisco AnyConnect VPN ==<br />
<br />
{{Expansion|Which package provides ''vpnagentd''?}}<br />
<br />
{{hc|/etc/systemd/system/ciscovpn.service|<nowiki><br />
[Unit]<br />
Description=Cisco AnyConnect Secure Mobility Client Agent<br />
Requires=network.target remote-fs.target<br />
After=network.target remote-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/vpnagentd.pid<br />
ExecStart=/opt/cisco/anyconnect/bin/vpnagentd<br />
ExecStop=/usr/bin/killall /opt/cisco/anyconnect/bin/vpnagentd<br />
Restart=on-abort<br />
<br />
[Install]<br />
# one may want to use multi-user.target instead<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== Turn off the automatic screensaver ==<br />
<br />
{{Stub|1=Very hackish solution, you'd better use something like [https://bbs.archlinux.org/viewtopic.php?id=130447 this] (needs to be modified to work with XBMC).}}<br />
<br />
Arch Linux has a 10 minute screensaver set as standard. XBMC for CuBox does not disable this when watching movies, and this is a rather hackish workaround. Tested on the [http://archlinuxarm.org/platforms/armv7/cubox CuBox].<br />
<br />
{{hc|/etc/systemd/system/screensaveroff.service|<nowiki><br />
[Unit]<br />
Description=Disables the screensaver in X<br />
After=graphical.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/xset s off -d :0<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== slock ==<br />
<br />
Locks the system with the help of {{Pkg|slock}}. Very handy when closing the laptop lid for example.<br />
<br />
{{hc|/etc/systemd/system/screenlock.service|<nowiki><br />
[Unit]<br />
Description=Lock X session using slock<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/slock<br />
<br />
[Install]<br />
WantedBy=sleep.target<br />
</nowiki>}}<br />
<br />
== xautolock ==<br />
<br />
Automatically lock the screen after a timeout of 10 minutes.<br />
<br />
{{hc|/etc/systemd/system/xautolock.service|<nowiki><br />
[Unit]<br />
Description=Lock the screen automatically after a timeout<br />
<br />
[Service]<br />
Type=simple<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/xautolock -time 10 -locker slock -detectsleep<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== VDE2 interface ==<br />
<br />
Create and activate a vde2 tap interface for use in the {{ic|users}} user group.<br />
<br />
{{hc|/etc/systemd/system/vde2@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/vde_switch -tap %i -daemon -mod 660 -group users<br />
ExecStart=/usr/bin/ip link set dev %i up<br />
ExecStop=/usr/bin/ip addr flush dev %i<br />
ExecStop=/usr/bin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Crashplan PROe server ==<br />
<br />
{{hc|/etc/systemd/system/proserver.service|<nowiki><br />
[Unit]<br />
Description=CrashPlanPROe Backup Server<br />
After=network.target<br />
<br />
[Service]<br />
<br />
Type=forking<br />
<br />
ExecStart=/opt/proserver/bin/proserver start<br />
ExecStop=/opt/proserver/bin/proserver stop<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== ncdc ==<br />
<br />
{{hc|/etc/systemd/system/ncdc@.service|<br />
<nowiki>[Unit]<br />
Description=ncdc<br />
Requires=network.target local-fs.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
KillMode=none<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc<br />
ExecStop=/usr/bin/tmux send-keys -t dcpp:ncdc "/quit" C-m<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
== Squeezelite ==<br />
<br />
{{hc|/etc/conf.d/squeezelite|<nowiki><br />
server="<server>:<port>" # amend as appropriate<br />
name="<device_name>" # amend as appropriate<br />
mac="<your_mac_here>" # amend as appropriate<br />
device="default" # amend as appropriate<br />
logtype="all"<br />
loglevel="info"<br />
logfile="/var/log/squeezelite.log"<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/squeezelite.service|<nowiki><br />
[Unit]<br />
Description=Squeezelite Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
EnvironmentFile=/etc/conf.d/squeezelite<br />
ExecStart=/usr/bin/squeezelite -n ${name} -m ${mac} -d ${logtype}=${loglevel} -f ${logfile} -o ${device} -s ${server}<br />
RestartSec=5<br />
Restart=on-failure<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== freeswitch ==<br />
<br />
<br />
{{hc|/etc/systemd/system/freeswitch.service|<nowiki><br />
[Unit]<br />
Description=freeswitch<br />
After=syslog.target network.target local-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/run/freeswitch/freeswitch.pid<br />
EnvironmentFile=/etc/conf.d/freeswitch<br />
PermissionsStartOnly=true<br />
ExecStartPre=/bin/mkdir -p /run/freeswitch<br />
ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch<br />
ExecStart=/usr/bin/freeswitch $FREESWITCH_OPTS<br />
TimeoutSec=45s<br />
Restart=always<br />
User=freeswitch<br />
Group=freeswitch<br />
UMask=0007<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/freeswitch|<nowiki><br />
# options to start freeswitch with<br />
# We default to -nonat, if you need nat, remove it<br />
FREESWITCH_OPTS="-nc"<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [[Pacman_Tips#Backing_up_Local_database_with_Systemd|Backing up local pacman database with systemd]]<br />
* [http://wiki.gentoo.org/wiki/Systemd systemd at gentoo wiki]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Input_Japanese_using_uim&diff=306676Input Japanese using uim2014-03-23T04:41:33Z<p>Emlun: /* Settings */ Add systemd service files</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[ja:Input Japanese using uim]]<br />
This page explains how to get the Japanese input to work using [http://code.google.com/p/uim/ uim].<br />
<br />
If you use SCIM, see [[Smart Common Input Method platform]].<br />
<br />
If you use IBus, see [[Ibus]].<br />
<br />
== Installation ==<br />
<br />
You need the following packages to input Japanese.<br />
<br />
* Japanese fonts<br />
* Japanese input method (Kana to Kanji conversion engine)<br />
* Input method framework: uim<br />
<br />
=== Japanese fonts ===<br />
<br />
''see also [[Fonts]] and [[Font Configuration]] for configuration or more detail.''<br />
<br />
Recommended Japanese fonts are as follows.<br />
* [http://ossipedia.ipa.go.jp/ipafont/ IPA fonts] || {{Pkg|otf-ipafont}}<br />
: A high quality and formal style opensource font set including Gothic (sans-serif) and Mincho (serif) glyphs. Default font of openSUSE-ja.<br />
* [http://dicey.org/vlgothic/ VL Gothic] ([[Arch User Repository|AUR]]: {{AUR|ttf-vlgothic}})<br />
: Default Gothic font of Debian-ja, Fedora-ja, Vine Linux, et al.<br />
* [http://www.geocities.jp/ep3797/modified_fonts_01.html UmePlus Gothic] (AUR: {{AUR|ttf-umeplus}})<br />
: Default Gothic font of Mandriva Linux ja environment.<br />
<br />
If you want to show [http://en.wikipedia.org/wiki/2channel_Shift_JIS_art 2channel Shift JIS art] properly, use one of the following fonts:<br />
* ipamona font (AUR: {{AUR|ttf-ipa-mona}})<br />
* Monapo font (AUR: {{AUR|ttf-monapo}})<br />
<br />
=== uim ===<br />
<br />
==== Using pacman ====<br />
<br />
[[pacman|Install]] {{Pkg|uim}} from the [[official repositories]].<br />
<br />
==== Compiling uim from source using PKGBUILD ====<br />
<br />
If you want to build uim with your configurationin, you can compile from source, using [[ABS]] for istance. See [http://code.google.com/p/uim/wiki/InstallUim official wiki] for all configure options.<br />
<br />
In Arch official repositories, uim is built with the following custom configuration (as of 1.8.6):<br />
* {{ic|--with-anthy-utf8}} - Enable Anthy(UTF-8) support<br />
* {{ic|--with-qt4-immodule}} - Build Qt4 immodule<br />
* {{ic|--with-qt4}} - Build uim-tools for Qt4<br />
<br />
If you want KDE4 plasma widget, install {{Pkg|automoc4}} for making dependency, and add {{ic|--enable-kde4-applet}} option to PKGBUILD file.<br />
<br />
=== Input method ===<br />
<br />
==== Anthy ====<br />
<br />
Anthy is one of the most popular Japanese input methods in the open source world. However, it has not been maintained for a long time. [http://wiki.debian.org/Teams/DebianAnthy Debian succeeds it] from May 2010.<br />
<br />
Install {{Pkg|anthy}} from the official repositories.<br />
<br />
===== Extra dictionary =====<br />
<br />
Anthy's default dictionary does not include several characters which are not specified on EUC-JP (JIS X 0208) such as "①", "♥", etc. [http://en.sourceforge.jp/projects/alt-cannadic/ alt-cannadic] provides extra dictionaries including those characters.<br />
<br />
Get [http://en.sourceforge.jp/projects/alt-cannadic/releases/?package_id=6129 alt-cannadic dictionary] and put them under your {{Ic|~/.anthy/imported_words_default.d}}.<br />
$ tar jxvf alt-cannadic-091230.tar.bz2<br />
$ mkdir ~/.anthy/imported_words_default.d (if not exist)<br />
$ cp alt-cannadic-091230/extra/*.t ~/.anthy/imported_words_default.d/<br />
<br />
Please see [http://sourceforge.jp/projects/alt-cannadic/wiki/%E4%BD%BF%E3%81%84%E6%96%B9_Anthy-UTF-8 official wiki] for more detail (Japanese).<br />
<br />
{{Warning|If you will be using this extra dictionary, choose '''Anthy (UTF-8)''' for default input method on uim.}}<br />
<br />
==== Modified Anthy (anthy-ut) ====<br />
<br />
[http://www.geocities.jp/ep3797/anthy_dict_01.html Modified Anthy] is a set of patches and huge extended dictionaries which aims to improve the Kana to Kanji conversion quality of original Anthy.<br />
<br />
Modified Anthy consists two different upstreams:<br />
* Patched source of Anthy by [http://www.fenix.ne.jp/~G-HAL/soft/nosettle/#anthy G-HAL]<br />
* Huge extended dictionalies by [http://www.geocities.jp/ep3797/anthy_dict_01.html UTSUMI]<br />
<br />
{{Warning|<br />
* Modified Anthy applies to only Anthy (UTF-8). So you have to choose '''Anthy (UTF-8)''' for default input method on uim.<br />
* Modified Anthy does not have compatibility of the dictionaries and learning data with original Anthy.<br />
}}<br />
<br />
===== Compiling modified Anthy using PKGBUILD =====<br />
<br />
Modified Anthy is available on AUR named {{AUR|anthy-ut}}.<br />
<br />
Get anthy-ut tarball and makepkg to make and install package:<br />
$ wget https://aur.archlinux.org/packages/anthy-ut/anthy-ut.tar.gz<br />
$ tar xvf anthy-ut.tar.gz<br />
$ cd anthy-ut<br />
$ makepkg -s -i<br />
<br />
If you already use original Anthy, you have to convert the existing learning data format.<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
(Though this step repeats the same commands twice, it is not mistypes.)<br />
<br />
==== Anthy Kaomoji ====<br />
<br />
[http://sourceforge.jp/projects/anthy/ Anthy Kaomoji] is a modified version of Anthy that converts Hiragana text to Kana Kanji mixed text and has emoticon (顔文字) and 2ch dictionaries.<br />
It can be found in the AUR ({{AUR|anthy-kaomoji}}).<br />
<br />
==== Mozc ====<br />
<br />
''See [[Mozc]].''<br />
<br />
[http://code.google.com/p/mozc/ Mozc] is a Japanese Input Method Editor (IME) designed for multi-platform such as Chromium OS, Windows, Mac and Linux which originates from [http://www.google.com/intl/ja/ime/ Google Japanese Input].<br />
<br />
Though {{AUR|Mozc}} adapts to only ibus input method framework, [http://code.google.com/p/macuim/ macuim] provides uim-mozc plugin.<br />
<br />
===== Mozc (Vanilla) =====<br />
<br />
{{AUR|uim-mozc}} is available on AUR.<br />
{{Note|This does not support kill_line feature of uim-mozc.}}<br />
You can install this from unofficial user repository. Add the following into your /etc/pacman.conf:<br />
[pnsft-pur]<br />
SigLevel = Optional TrustAll<br />
Server = http://downloads.sourceforge.net/project/pnsft-aur/pur/$arch<br />
{{Note|This repo provides x86_64 packages only now.}}<br />
And refresh package database:<br />
# pacman -Syy<br />
You can choose install packages specifying group name as follows:<br />
# pacman -S mozc-im<br />
Or, specify package names directly. For example:<br />
# pacman -S uim-mozc<br />
<br />
===== mozc-ut and mozc-svn =====<br />
<br />
{{AUR|mozc-ut}} and {{AUR|mozc-svn}} can be built uim-mozc.<br />
{{Note|mozc-ut can work with {{AUR|uim-mozc}}.}}<br />
To build uim-mozc, edit PKGBUILD like follow, i,e. uncomment {{Ic|1=_uim_mozc=}} line:<br />
## If you will not be using ibus, comment out below.<br />
_ibus_mozc="yes"<br />
## If you will be using uim, uncomment below.<br />
_uim_mozc="yes"<br />
## If applying patch for uim-mozc fails, try to uncomment below.<br />
#_kill_kill_line="yes"<br />
## This will disable the 'kill-line' function of uim-mozc.<br />
{{Tip|If you will never be using ibus-mozc, comment out the {{Ic|1=_ibus_mozc=}} line.}}<br />
<br />
===== Registering Mozc =====<br />
<br />
{{Warning|You '''must''' run the following command whenever you upgrade or (re-)install uim.<br/><br />
# uim-module-manager --register mozc}}<br />
<br />
==== Google CGI API for Japanese input ====<br />
<br />
[http://www.google.co.jp/ime/cgiapi.html Google CGI API for Japanese Input] (Google-CGIAPI-Jp) is CGI service to provide Japanese conversion on the Internet by Google. It can be used on [http://www.google.com/transliterate web browser]. Its conversion engine seems to be equivalent to Google Japanese Input, so conversion quality is probably better than Mozc.<br />
<br />
{{Note|This service sends/receives preedits and candidates as plain text (as of 2012-09).}}<br />
<br />
You can use it via uim. Choose "Google-CGIAPI-Jp" on uim-im-switcher-gtk/gtk3/qt4 or uim-pref-gtk/gtk3/qt4.<br />
<br />
== Settings ==<br />
<br />
=== Environment variables ===<br />
<br />
Add the following to ~/.[[xprofile]], ~/.[[xinitrc]] or ~/.xsession:<br />
<br />
export GTK_IM_MODULE='uim'<br />
export QT_IM_MODULE='uim'<br />
uim-xim &<br />
export XMODIFIERS='@im=uim'<br />
<br />
{{Note|The variables should be exported before starting your desktop environment, i.e. before "exec startxfce4" or similar. [[#Using_systemd|See below]] if you're using systemd to manage your X session. }}<br />
<br />
=== Toolbar utilities ===<br />
<br />
If you want to use UimToolbar utilities which shows and controls uim mode, add '''one''' of the followings, too.<br />
<br />
==== uim-toolbar-gtk/qt ====<br />
<br />
Using toolbar appears as a window.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3 &<br />
For Qt4:<br />
uim-toolbar-qt4 &<br />
<br />
==== uim-toolbar-gtk-systray ====<br />
<br />
Using toolbar for system tray.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk-systray &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3-systray &<br />
<br />
==== Panel applet ====<br />
<br />
Or, if you use GNOME, KDE or Xfce, you can use uim-toolbar panel applet (Xfce requires xfce4-xfapplet-plugin to use uim-applet-gnome).<br />
<br />
=== Using systemd ===<br />
<br />
If you are [[Systemd/User#Using_.2Fusr.2Flib.2Fsystemd.2Fsystemd_--user_To_Manage_Your_Session|using systemd to manage your X session]], you'll need to set the environment variables in your systemd session rather than an init script.<br />
<br />
{{hc|~/.config/systemd/user/uim-env.service|<nowiki><br />
[Unit]<br />
Description=uim environment initialization<br />
Before=xorg.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/systemctl --user set-environment XMODIFIERS=@im=uim<br />
ExecStart=/usr/bin/systemctl --user set-environment GTK_IM_MODULE=uim<br />
ExecStart=/usr/bin/systemctl --user set-environment QT_IM_MODULE=uim<br />
ExecStart=/usr/bin/systemctl --user set-environment GTK_IM_MODULE_FILE=%h/.immodules</nowiki><br />
}}<br />
Depending on your setup, the 2nd-4th ExecStart lines may or may not be needed.<br />
<br />
{{hc|~/.config/systemd/user/uim.service|<nowiki><br />
[Unit]<br />
Description=uim daemon<br />
Wants=uim-env.service<br />
After=xorg.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-xim<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=xorg.target</nowiki><br />
}}<br />
<br />
{{hc|~/.config/systemd/user/uim-toolbar.service|<nowiki><br />
[Unit]<br />
Description=uim toolbar<br />
PartOf=uim.service<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-toolbar-of-your-choice<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=uim.service</nowiki><br />
}}<br />
<br />
Lastly, you'll need to enable the services:<br />
$ systemctl --user enable uim.service uim-toolbar.service<br />
<br />
=== uim preferences ===<br />
<br />
Configure uim preferences by running :<br />
$ uim-pref-gtk (Or, uim-pref-gtk3/uim-pref-qt4)<br />
which brings forth a GUI.<br />
<br />
Choose your preferring input method as 'Default input method'.<br />
{{Note|Mozc will be not listed in 'Default input method' at first time so you will need to add it into 'Enabled input methods' to use.}}<br />
<br />
You can run {{ic|uim-xim}} or restart X to test your settings.<br />
<br />
Provided everything went well you should be able to input Japanese in X.<br />
<br />
=== Input Japanese on Emacs ===<br />
<br />
uim provides uim.el the bridge software between Emacs and uim. Here is a sample to use uim on Emacs with utf-8 encoding. <br />
<br />
Please see [http://code.google.com/p/uim/wiki/UimEl Official wiki] for more detail.<br />
<br />
==== LEIM or minor-mode ====<br />
<br />
You can call uim.el from Emacs in two ways; directly or with the LEIM (Library of Emacs Input Method) framework. Though settings of them are different, basic functions are same. If you want to switch between uim.el and other Emacs IMs frequently, you should use LEIM framework.<br />
<br />
===== Settings for the minor-mode =====<br />
<br />
If you will be using on minor-mode, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; read uim.el<br />
(require 'uim)<br />
;; uncomment next and comment out previous to load uim.el on-demand<br />
;; (autoload 'uim-mode "uim" nil t)<br />
<br />
;; key-binding for activate uim (ex. C-\)<br />
(global-set-key "\C-\\" 'uim-mode)<br />
<br />
===== Settings for the LEIM =====<br />
<br />
If you will be using via LEIM, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing and choose default input method.<br />
;; read uim.el with LEIM initializing<br />
(require 'uim-leim)<br />
<br />
;; set default IM. Uncomment the one of the followings.<br />
;(setq default-input-method "japanese-anthy-utf8-uim") ; Anthy (UTF-8)<br />
;(setq default-input-method "japanese-google-cgiapi-jp-uim") ; Google-CGIAPI-Jp<br />
;(setq default-input-method "japanese-mozc-uim") ; Mozc<br />
<br />
==== Preferred character encoding ====<br />
<br />
uim.el uses euc-jp character encoding by default. To set UTF-8 as preferred encodings, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; Set UTF-8 as preferred character encoding (default is euc-jp).<br />
(setq uim-lang-code-alist<br />
(cons '("Japanese" "Japanese" utf-8 "UTF-8")<br />
(delete (assoc "Japanese" uim-lang-code-alist) <br />
uim-lang-code-alist)))<br />
<br />
==== Enable inline candidates displaying mode by default ====<br />
<br />
The inline candidates displaying mode displays conversion candidates just below (or above) preedit text vertically instead of echo area. If you want to enable inline candidates displaying mode by default, write as follows.<br />
;; set inline candidates displaying mode as default<br />
(setq uim-candidate-display-inline t)<br />
<br />
==== Set Hiragana input mode by default ====<br />
<br />
To set Hiragana input mode at activting uim, add the settings like follows:<br />
<br />
;; Set Hiragana input mode at activating uim.<br />
(setq uim-default-im-prop '("action_anthy_utf8_hiragana"<br />
"action_google-cgiapi-jp_hiragana"<br />
"action_mozc_hiragana"))<br />
<br />
==== Ignoring C-SPC on uim.el ====<br />
<br />
When you are assigning activation/deactivation of input method to C-SPC, C-SPC is stolen to switch input mode by uim.el while it is activated. To prevent the stealing and use for set-mark-command, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
(add-hook 'uim-load-hook<br />
'(lambda ()<br />
(define-key uim-mode-map [67108896] nil)<br />
(define-key uim-mode-map [0] nil)))<br />
<br />
==== Disabling XIM on Emacs ====<br />
<br />
When you are using input method on your desktop and assigning activation/deactivation of input method to C-SPC, you will be not able to use C-SPC/C-@ as set-mark-command on Emacs. To avoid this problem, add the following into your {{Ic|~/.Xresources}} or {{Ic|~/.Xdefaults}}. xim will be disabled on Emacs.<br />
Emacs*UseXIM: false<br />
<br />
== Troubleshooting ==<br />
<br />
=== Set the GTK_IM_MODULE variable, but uim still not works with GTK+ 2 applications ===<br />
<br />
In case you already set the GTK_IM_MODULE environmental variable, but uim still not works with GTK+ 2 applications, you need to specify the location of gtk.immodules, which is created by and can be generated with {{Ic|gtk-query-immodules-2.0}}.<br />
<br />
The default location is {{Ic|/etc/gtk-2.0/gtk.immodules}} for GTK+ 2.<br />
<br />
You can do this with either the GTK_IM_MODULE_FILE variable (''not recommended'', it causes GTK+ 3 applications to see incompatible modules) or the im_module_file setting (''recommended'').<br />
<br />
Add the following to {{Ic|/etc/gtk-2.0/gtkrc}} or {{Ic|~/.gtkrc-2.0}}:<br />
<br />
im_module_file "/etc/gtk-2.0/gtk.immodules"<br />
<br />
=== Cannot input Japanese on Opera ===<br />
<br />
If you use Opera and cannot input Japanese with uim, try to edit environment variable as follows:<br />
Make sure to add follows in the beginning of /usr/bin/opera.<br />
<br />
export XMODIFIERS='@im=uim'<br />
export QT_IM_MODULE='xim'<br />
<br />
=== Cannot type a consonant in Zenkaku mode ===<br />
<br />
If you cannot type a consonant in Zenkaku mode, add follows to your config file.<br />
<br />
e.g. vi ~/.uim.d/customs/custom-google-cgiapi-jp.scm<br />
<br />
(define ja-rk-rule-hoge<br />
(map<br />
(lambda (c)<br />
(list (cons (list c) ()) (list c c c)))<br />
'("b" "c" "d" "f" "g" "h" "j" "k" "l" "m"<br />
"p" "q" "r" "s" "t" "v" "w" "x" "y" "z"<br />
"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M"<br />
"N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")))<br />
(if (symbol-bound? 'ja-rk-rule-hoge)<br />
(set! ja-rk-rule (append ja-rk-rule-hoge ja-rk-rule)))<br />
<br />
=== uim-toolbar-gtk-systray: tray icon is crushed ===<br />
<br />
Though some of DE, WM or panel application may provide only one icon space per application on system-tray/notification-area, uim-toolbar-gtk-systray displays some icons on it by default so those icons are crushed. Choose just one of them to solve it. The steps to display only 'Input mode' icon for example as follows:<br />
# Run {{Ic|uim-pref-gtk}}.<br />
# Click 'Toolbar' on 'Group' list.<br />
# Take the all checkmarks off.<br />
# Click 'Anthy', 'Anthy (UTF-8)' or 'Mozc' which you are using on 'Group' list.<br />
# Click Edit button in 'Toolbar' box > 'Enable toolbar buttons' line.<br />
# Enable only 'Input mode' and click 'Close' button.<br />
# Click 'OK' button to close uim-pref-gtk.<br />
The tray icon will be displayed "あ" (Hiragana mode) or "ー" (Direct mode).<br />
<br />
=== I use darker theme, I cannot read the uim mode icons ===<br />
<br />
You can choose icons for darker background (uim 1.6.0 or later).<br />
# Run uim-perf-gtk<br />
# Click 'Toolbar' on 'Group' list.<br />
# Check 'Use icon for dark background'.<br />
<br />
== See also ==<br />
<br />
;uim<br />
:[http://code.google.com/p/uim/wiki/OfficialUserDocument uim official document]<br />
:[http://en.wikibooks.org/wiki/Uim uim on wikibooks]<br />
<br />
;Fonts<br />
:[http://www.geocities.jp/ep3797/japanese_fonts.html Japanese fonts showcase]<br />
:[http://www.geocities.jp/ep3797/modified_fonts_01.html modified Japanese fonts]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Systemd/Services&diff=306358Systemd/Services2014-03-21T19:58:37Z<p>Emlun: Add uim services</p>
<hr />
<div>{{Deletion|Please don't add any new elements to this page. All services must/will be relocated on their dedicated corresponding main article.}}<br />
{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd FAQ}}<br />
{{Related|Daemons List}}<br />
{{Related articles end}}<br />
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the [[official repositories]] or the [[AUR]]. These files can be copied from other distributions or created by yourself.<br />
<br />
== darkhttpd ==<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.service|<nowiki><br />
[Unit]<br />
Description=Darkhttpd Webserver<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/darkhttpd<br />
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_OPTS<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.socket|<nowiki><br />
[Unit]<br />
Conflicts=darkhttpd.service<br />
<br />
[Socket]<br />
ListenStream=80<br />
Accept=no<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/darkhttpd|<nowiki><br />
DARKHTTPD_ROOT="/srv/http"<br />
DARKHTTPD_OPTS="--uid nobody --gid nobody --chroot"<br />
</nowiki>}}<br />
<br />
== screen ==<br />
<br />
{{Merge|GNU Screen}}<br />
<br />
Autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Static Ethernet network ==<br />
<br />
This is a custom service file for static Ethernet configurations.<br />
<br />
{{hc|/etc/conf.d/network|<nowiki><br />
address=192.168.0.15<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for <interface><br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-<interface>.device <br />
After=sys-subsystem-net-devices-<interface>.device <br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network<br />
ExecStart=/usr/bin/ip link set dev <interface> up<br />
ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev <interface><br />
ExecStart=/usr/bin/ip route add default via ${gateway}<br />
ExecStop=/usr/bin/ip addr flush dev <interface><br />
ExecStop=/usr/bin/ip link set dev <interface> down<br />
Execstop=/sbin/ip addr delete ${address}/${netmask} dev <interface><br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
To set static IP on {{ic|enp3s0}} interface you will need to create {{ic|/etc/conf.d/network@enp3s0}} config file and run:<br />
<br />
# systemctl enable network@enp3s0.service<br />
<br />
== Set network interface in promiscuous mode ==<br />
<br />
{{hc|/etc/systemd/system/promiscuous@.service|<nowiki><br />
[Unit]<br />
Description=Set %i interface in promiscuous mode<br />
After=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/ip link set dev %i promisc on<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
If you want to enable promiscuous mode on interface {{ic|eth0}} run:<br />
<br />
# systemctl enable promiscuous@eth0.service<br />
<br />
== tpfand ==<br />
<br />
{{hc|/etc/systemd/system/tpfand.service|<nowiki><br />
[Unit]<br />
Description=ThinkPad Fan Control<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/tpfand.pid<br />
ExecStart=/usr/sbin/tpfand<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== MPD socket activation ==<br />
<br />
{{Merge|MPD}}<br />
<br />
If the following {{ic|mpd.socket}} file is enabled while {{ic|mpd.service}} (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start {{ic|mpd.service}} and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} ''AND'' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for more details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
<br />
{{hc|/usr/lib/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
== VideoLAN 2.0 ==<br />
<br />
Change the {{ic|1=User=}} parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|<nowiki><br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=nobody<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Xvfb ==<br />
<br />
Change the {{ic|1=User=}} and {{ic|1=Group=}} parameters:<br />
<br />
{{hc|/etc/systemd/system/xinit.service|<nowiki><br />
[Unit]<br />
Description=xinit with xvfb<br />
After=network.target<br />
<br />
[Service]<br />
User=bitlbee<br />
Group=bitlbee<br />
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Gitlab ==<br />
<br />
{{hc|/etc/systemd/system/gitlab.service|<nowiki><br />
[Unit]<br />
Description=Self Hosted Git Management<br />
Requires=postgresql.service redis.service<br />
After=postgresql.service redis.service<br />
Wants=postfix.service gitlab-worker.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/home/gitlab/gitlab/script/rails server -d -e production<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/server.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/gitlab-worker.service|<nowiki><br />
[Unit]<br />
Description=Gitlab Resque Worker<br />
Requires=redis.service<br />
After=redis.service<br />
Wants=postfix.service postgresql.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/bin/bash -c '. ~/.bashrc; . ./resque.sh'<br />
ExecStopPost=/usr/bin/rm /home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
</nowiki>}}<br />
<br />
== Cisco AnyConnect VPN ==<br />
<br />
{{hc|/etc/systemd/system/ciscovpn.service|<nowiki><br />
[Unit]<br />
Description=Cisco AnyConnect Secure Mobility Client Agent<br />
Requires=network.target remote-fs.target<br />
After=network.target remote-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/vpnagentd.pid<br />
ExecStart=/opt/cisco/anyconnect/bin/vpnagentd<br />
ExecStop=/usr/bin/killall /opt/cisco/anyconnect/bin/vpnagentd<br />
Restart=on-abort<br />
<br />
[Install]<br />
# one may want to use multi-user.target instead<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== redmine ==<br />
<br />
{{hc|/etc/systemd/system/redmine.service|<nowiki><br />
[Unit]<br />
Description=Redmine server<br />
After=syslog.target<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
User=redmine2<br />
Group=redmine2<br />
Environment=GEM_HOME=/home/redmine2/.gem/<br />
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production<br />
<br />
# Give a reasonable amount of time for the server to start up/shut down<br />
TimeoutSec=300<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Turn off the automatic screensaver ==<br />
<br />
{{Stub|1=Very hackish solution, you'd better use something like [https://bbs.archlinux.org/viewtopic.php?id=130447 this] (needs to be modified to work with XBMC).}}<br />
<br />
Arch Linux has a 10 minute screensaver set as standard. XBMC for CuBox does not disable this when watching movies, and this is a rather hackish workaround. Tested on the [http://archlinuxarm.org/platforms/armv7/cubox CuBox].<br />
<br />
{{hc|/etc/systemd/system/screensaveroff.service|<nowiki><br />
[Unit]<br />
Description=Disables the screensaver in X<br />
After=graphical.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/xset s off -d :0<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== slock ==<br />
<br />
Locks the system with the help of {{Pkg|slock}}. Very handy when closing the laptop lid for example.<br />
<br />
{{hc|/etc/systemd/system/screenlock.service|<nowiki><br />
[Unit]<br />
Description=Lock X session using slock<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/slock<br />
<br />
[Install]<br />
WantedBy=sleep.target<br />
</nowiki>}}<br />
<br />
== xautolock ==<br />
<br />
Automatically lock the screen after a timeout of 10 minutes.<br />
<br />
{{hc|/etc/systemd/system/xautolock.service|<nowiki><br />
[Unit]<br />
Description=Lock the screen automatically after a timeout<br />
<br />
[Service]<br />
Type=simple<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/xautolock -time 10 -locker slock -detectsleep<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== VDE2 interface ==<br />
<br />
Create and activate a vde2 tap interface for use in the {{ic|users}} user group.<br />
<br />
{{hc|/etc/systemd/system/vde2@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/vde_switch -tap %i -daemon -mod 660 -group users<br />
ExecStart=/usr/bin/ip link set dev %i up<br />
ExecStop=/usr/bin/ip addr flush dev %i<br />
ExecStop=/usr/bin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== BitTorrent Sync ==<br />
<br />
Run BitTorrent Sync as user ''username'':<br />
<br />
{{bc|<nowiki><br />
# systemctl start btsync@''username''<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/btsync@.service|<nowiki><br />
[Unit]<br />
Description=BitTorrent Sync application<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.config --nodaemon<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
This assumes existence of the following files:<br />
<br />
* {{ic|/usr/bin/btsync}} - the {{ic|btsync}} executable or a symlink pointing to it.<br />
* {{ic|/home/username/.config/btsync/btsync.config}} - the user's config file. Consult the [http://labs.bittorrent.com/experiments/sync/get-started.html#config-file official instructions] for creating one.<br />
<br />
=== User instance ===<br />
<br />
Allows you to start the daemon without root privileges.<br />
<br />
{{hc|~/.config/systemd/user/btsync.service|<nowiki><br />
[Unit]<br />
Description=Bittorent Sync service for %u<br />
After=network.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.conf --nodaemon<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
This makes the same assumptions as above. Invoke it as {{ic|$ systemctl --user start btsync}}. If enabled with {{ic|$ systemctl --user enable btsync}}, the daemon will start on login, unless [[Systemd/User#Automatic_start-up_of_systemd_user_instances|lingering]] is enabled for the user.<br />
<br />
== Crashplan PROe server ==<br />
<br />
{{hc|/etc/systemd/system/proserver.service|<nowiki><br />
[Unit]<br />
Description=CrashPlanPROe Backup Server<br />
After=network.target<br />
<br />
[Service]<br />
<br />
Type=forking<br />
<br />
ExecStart=/opt/proserver/bin/proserver start<br />
ExecStop=/opt/proserver/bin/proserver stop<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== ncdc ==<br />
<br />
{{hc|/etc/systemd/system/ncdc@.service|<br />
<nowiki>[Unit]<br />
Description=ncdc<br />
Requires=network.target local-fs.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
KillMode=none<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc<br />
ExecStop=/usr/bin/tmux send-keys -t dcpp:ncdc "/quit" C-m<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
== XBMC Socket Activation ==<br />
<br />
{{Merge|XBMC}}<br />
<br />
This can be used to start XBMC automatically when you start a remote control app or connect to its html control port. Start listening with ''systemctl start xbmc@user.socket'' (replace ''user'' with the user you want XBMC to be started as). You might have to change the port in ''xbmc@.socket''.<br />
<br />
{{hc|/etc/systemd/system/xbmc@.service|<br />
<nowiki>[Unit]<br />
Description=Launch XBMC on main display<br />
<br />
[Service]<br />
Type=oneshot<br />
Environment=DISPLAY=:0.0<br />
Nice=-1<br />
ExecStart=/usr/bin/su %i /usr/bin/xbmc<br />
ExecStartPost=/usr/bin/bash -c "sleep 15 && systemctl start xbmc@%i.socket"<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/xbmc@.socket|<br />
<nowiki>[Unit]<br />
Conflicts=xbmc@%i.service<br />
<br />
[Socket]<br />
#ListenDatagram=9 # listen for WOL packets<br />
ListenStream=8082 # change this to XBMC's http control port<br />
<br />
[Install]<br />
WantedBy=sockets.target</nowiki>}}<br />
<br />
== Squeezelite ==<br />
<br />
{{hc|/etc/conf.d/squeezelite|<nowiki><br />
server="<server>:<port>" # amend as appropriate<br />
name="<device_name>" # amend as appropriate<br />
mac="<your_mac_here>" # amend as appropriate<br />
device="default" # amend as appropriate<br />
logtype="all"<br />
loglevel="info"<br />
logfile="/var/log/squeezelite.log"<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/squeezelite.service|<nowiki><br />
[Unit]<br />
Description=Squeezelite Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
EnvironmentFile=/etc/conf.d/squeezelite<br />
ExecStart=/usr/bin/squeezelite -n ${name} -m ${mac} -d ${logtype}=${loglevel} -f ${logfile} -o ${device} -s ${server}<br />
RestartSec=5<br />
Restart=on-failure<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== freeswitch ==<br />
<br />
<br />
{{hc|/etc/systemd/system/freeswitch.service|<nowiki><br />
[Unit]<br />
Description=freeswitch<br />
After=syslog.target network.target local-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/run/freeswitch/freeswitch.pid<br />
EnvironmentFile=/etc/conf.d/freeswitch<br />
PermissionsStartOnly=true<br />
ExecStartPre=/bin/mkdir -p /run/freeswitch<br />
ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch<br />
ExecStart=/usr/bin/freeswitch $FREESWITCH_OPTS<br />
TimeoutSec=45s<br />
Restart=always<br />
User=freeswitch<br />
Group=freeswitch<br />
UMask=0007<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/freeswitch|<nowiki><br />
# options to start freeswitch with<br />
# We default to -nonat, if you need nat, remove it<br />
FREESWITCH_OPTS="-nc"<br />
</nowiki>}}<br />
<br />
<br />
== uim ==<br />
<br />
If you're [[Systemd/User#Using_.2Fusr.2Flib.2Fsystemd.2Fsystemd_--user_To_Manage_Your_Session|using systemd to manage your X session]].<br />
<br />
{{hc|~/.config/systemd/user/uim-env.service|<nowiki><br />
[Unit]<br />
Description=uim environment initialization<br />
Before=xorg.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/systemctl --user set-environment XMODIFIERS=@im=uim<br />
#ExecStart=/usr/bin/systemctl --user set-environment GTK_IM_MODULE=uim<br />
#ExecStart=/usr/bin/systemctl --user set-environment QT_IM_MODULE=uim<br />
#ExecStart=/usr/bin/systemctl --user set-environment GTK_IM_MODULE_FILE=%h/.immodules<br />
</nowiki>}}<br />
<br />
Follow the [http://code.google.com/p/uim/wiki/UimSystemConfiguration official instructions] and uncomment the extra ExecStart lines as/if needed.<br />
<br />
{{hc|~/.config/systemd/user/uim.service|<nowiki><br />
[Unit]<br />
Description=uim daemon<br />
Wants=uim-env.service<br />
After=xorg.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-xim<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=xorg.target<br />
</nowiki>}}<br />
<br />
If you want a systray toolbar for easy configuration:<br />
<br />
{{hc|~/.config/systemd/user/uim-toolbar.service|<nowiki><br />
[Unit]<br />
Description=uim toolbar<br />
PartOf=uim.service<br />
<br />
[Service]<br />
ExecStart=/usr/bin/uim-toolbar-gtk3-systray<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=uim.service<br />
</nowiki>}}<br />
<br />
There are a few toolbars to choose from. Again, refer to the official documentation.<br />
<br />
<br />
<br />
== See also ==<br />
<br />
* [[Pacman_Tips#Backing_up_Local_database_with_Systemd|Backing up local pacman database with systemd]]<br />
* [http://wiki.gentoo.org/wiki/Systemd systemd at gentoo wiki]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Systemd/Services&diff=306332Systemd/Services2014-03-21T18:15:48Z<p>Emlun: /* User instance */ Remove</p>
<hr />
<div>{{Deletion|Please don't add any new elements to this page. All services must/will be relocated on their dedicated corresponding main article.}}<br />
{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd FAQ}}<br />
{{Related|Daemons List}}<br />
{{Related articles end}}<br />
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the [[official repositories]] or the [[AUR]]. These files can be copied from other distributions or created by yourself.<br />
<br />
== darkhttpd ==<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.service|<nowiki><br />
[Unit]<br />
Description=Darkhttpd Webserver<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/darkhttpd<br />
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_OPTS<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.socket|<nowiki><br />
[Unit]<br />
Conflicts=darkhttpd.service<br />
<br />
[Socket]<br />
ListenStream=80<br />
Accept=no<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/darkhttpd|<nowiki><br />
DARKHTTPD_ROOT="/srv/http"<br />
DARKHTTPD_OPTS="--uid nobody --gid nobody --chroot"<br />
</nowiki>}}<br />
<br />
== screen ==<br />
<br />
{{Merge|GNU Screen}}<br />
<br />
Autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Static Ethernet network ==<br />
<br />
This is a custom service file for static Ethernet configurations.<br />
<br />
{{hc|/etc/conf.d/network|<nowiki><br />
address=192.168.0.15<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for <interface><br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-<interface>.device <br />
After=sys-subsystem-net-devices-<interface>.device <br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network<br />
ExecStart=/usr/bin/ip link set dev <interface> up<br />
ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev <interface><br />
ExecStart=/usr/bin/ip route add default via ${gateway}<br />
ExecStop=/usr/bin/ip addr flush dev <interface><br />
ExecStop=/usr/bin/ip link set dev <interface> down<br />
Execstop=/sbin/ip addr delete ${address}/${netmask} dev <interface><br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
To set static IP on {{ic|enp3s0}} interface you will need to create {{ic|/etc/conf.d/network@enp3s0}} config file and run:<br />
<br />
# systemctl enable network@enp3s0.service<br />
<br />
== Set network interface in promiscuous mode ==<br />
<br />
{{hc|/etc/systemd/system/promiscuous@.service|<nowiki><br />
[Unit]<br />
Description=Set %i interface in promiscuous mode<br />
After=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/ip link set dev %i promisc on<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
If you want to enable promiscuous mode on interface {{ic|eth0}} run:<br />
<br />
# systemctl enable promiscuous@eth0.service<br />
<br />
== tpfand ==<br />
<br />
{{hc|/etc/systemd/system/tpfand.service|<nowiki><br />
[Unit]<br />
Description=ThinkPad Fan Control<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/tpfand.pid<br />
ExecStart=/usr/sbin/tpfand<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== MPD socket activation ==<br />
<br />
{{Merge|MPD}}<br />
<br />
If the following {{ic|mpd.socket}} file is enabled while {{ic|mpd.service}} (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start {{ic|mpd.service}} and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} ''AND'' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for more details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
<br />
{{hc|/usr/lib/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
== VideoLAN 2.0 ==<br />
<br />
Change the {{ic|1=User=}} parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|<nowiki><br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=nobody<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Xvfb ==<br />
<br />
Change the {{ic|1=User=}} and {{ic|1=Group=}} parameters:<br />
<br />
{{hc|/etc/systemd/system/xinit.service|<nowiki><br />
[Unit]<br />
Description=xinit with xvfb<br />
After=network.target<br />
<br />
[Service]<br />
User=bitlbee<br />
Group=bitlbee<br />
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Gitlab ==<br />
<br />
{{hc|/etc/systemd/system/gitlab.service|<nowiki><br />
[Unit]<br />
Description=Self Hosted Git Management<br />
Requires=postgresql.service redis.service<br />
After=postgresql.service redis.service<br />
Wants=postfix.service gitlab-worker.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/home/gitlab/gitlab/script/rails server -d -e production<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/server.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/gitlab-worker.service|<nowiki><br />
[Unit]<br />
Description=Gitlab Resque Worker<br />
Requires=redis.service<br />
After=redis.service<br />
Wants=postfix.service postgresql.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/bin/bash -c '. ~/.bashrc; . ./resque.sh'<br />
ExecStopPost=/usr/bin/rm /home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
</nowiki>}}<br />
<br />
== Cisco AnyConnect VPN ==<br />
<br />
{{hc|/etc/systemd/system/ciscovpn.service|<nowiki><br />
[Unit]<br />
Description=Cisco AnyConnect Secure Mobility Client Agent<br />
Requires=network.target remote-fs.target<br />
After=network.target remote-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/vpnagentd.pid<br />
ExecStart=/opt/cisco/anyconnect/bin/vpnagentd<br />
ExecStop=/usr/bin/killall /opt/cisco/anyconnect/bin/vpnagentd<br />
Restart=on-abort<br />
<br />
[Install]<br />
# one may want to use multi-user.target instead<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== redmine ==<br />
<br />
{{hc|/etc/systemd/system/redmine.service|<nowiki><br />
[Unit]<br />
Description=Redmine server<br />
After=syslog.target<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
User=redmine2<br />
Group=redmine2<br />
Environment=GEM_HOME=/home/redmine2/.gem/<br />
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production<br />
<br />
# Give a reasonable amount of time for the server to start up/shut down<br />
TimeoutSec=300<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Turn off the automatic screensaver ==<br />
<br />
{{Stub|1=Very hackish solution, you'd better use something like [https://bbs.archlinux.org/viewtopic.php?id=130447 this] (needs to be modified to work with XBMC).}}<br />
<br />
Arch Linux has a 10 minute screensaver set as standard. XBMC for CuBox does not disable this when watching movies, and this is a rather hackish workaround. Tested on the [http://archlinuxarm.org/platforms/armv7/cubox CuBox].<br />
<br />
{{hc|/etc/systemd/system/screensaveroff.service|<nowiki><br />
[Unit]<br />
Description=Disables the screensaver in X<br />
After=graphical.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/xset s off -d :0<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== slock ==<br />
<br />
Locks the system with the help of {{Pkg|slock}}. Very handy when closing the laptop lid for example.<br />
<br />
{{hc|/etc/systemd/system/screenlock.service|<nowiki><br />
[Unit]<br />
Description=Lock X session using slock<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/slock<br />
<br />
[Install]<br />
WantedBy=sleep.target<br />
</nowiki>}}<br />
<br />
== xautolock ==<br />
<br />
Automatically lock the screen after a timeout of 10 minutes.<br />
<br />
{{hc|/etc/systemd/system/xautolock.service|<nowiki><br />
[Unit]<br />
Description=Lock the screen automatically after a timeout<br />
<br />
[Service]<br />
Type=simple<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/xautolock -time 10 -locker slock -detectsleep<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== VDE2 interface ==<br />
<br />
Create and activate a vde2 tap interface for use in the {{ic|users}} user group.<br />
<br />
{{hc|/etc/systemd/system/vde2@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/vde_switch -tap %i -daemon -mod 660 -group users<br />
ExecStart=/usr/bin/ip link set dev %i up<br />
ExecStop=/usr/bin/ip addr flush dev %i<br />
ExecStop=/usr/bin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== BitTorrent Sync ==<br />
<br />
Run BitTorrent Sync as user ''username'':<br />
<br />
{{bc|<nowiki><br />
# systemctl start btsync@''username''<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/btsync@.service|<nowiki><br />
[Unit]<br />
Description=BitTorrent Sync application<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.config --nodaemon<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
This assumes existence of the following files:<br />
<br />
* {{ic|/usr/bin/btsync}} - the {{ic|btsync}} executable or a symlink pointing to it.<br />
* {{ic|/home/username/.config/btsync/btsync.config}} - the user's config file. Consult the [http://labs.bittorrent.com/experiments/sync/get-started.html#config-file official instructions] for creating one.<br />
<br />
=== User instance ===<br />
<br />
Allows you to start the daemon without root privileges.<br />
<br />
{{hc|~/.config/systemd/user/btsync.service|<nowiki><br />
[Unit]<br />
Description=Bittorent Sync service for %u<br />
After=network.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.conf --nodaemon<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
This makes the same assumptions as above. Invoke it as {{ic|$ systemctl --user start btsync}}. If enabled with {{ic|$ systemctl --user enable btsync}}, the daemon will start on login, unless [[Systemd/User#Automatic_start-up_of_systemd_user_instances|lingering]] is enabled for the user.<br />
<br />
== Crashplan PROe server ==<br />
<br />
{{hc|/etc/systemd/system/proserver.service|<nowiki><br />
[Unit]<br />
Description=CrashPlanPROe Backup Server<br />
After=network.target<br />
<br />
[Service]<br />
<br />
Type=forking<br />
<br />
ExecStart=/opt/proserver/bin/proserver start<br />
ExecStop=/opt/proserver/bin/proserver stop<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== ncdc ==<br />
<br />
{{hc|/etc/systemd/system/ncdc@.service|<br />
<nowiki>[Unit]<br />
Description=ncdc<br />
Requires=network.target local-fs.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
KillMode=none<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc<br />
ExecStop=/usr/bin/tmux send-keys -t dcpp:ncdc "/quit" C-m<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
== XBMC Socket Activation ==<br />
<br />
{{Merge|XBMC}}<br />
<br />
This can be used to start XBMC automatically when you start a remote control app or connect to its html control port. Start listening with ''systemctl start xbmc@user.socket'' (replace ''user'' with the user you want XBMC to be started as). You might have to change the port in ''xbmc@.socket''.<br />
<br />
{{hc|/etc/systemd/system/xbmc@.service|<br />
<nowiki>[Unit]<br />
Description=Launch XBMC on main display<br />
<br />
[Service]<br />
Type=oneshot<br />
Environment=DISPLAY=:0.0<br />
Nice=-1<br />
ExecStart=/usr/bin/su %i /usr/bin/xbmc<br />
ExecStartPost=/usr/bin/bash -c "sleep 15 && systemctl start xbmc@%i.socket"<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/xbmc@.socket|<br />
<nowiki>[Unit]<br />
Conflicts=xbmc@%i.service<br />
<br />
[Socket]<br />
#ListenDatagram=9 # listen for WOL packets<br />
ListenStream=8082 # change this to XBMC's http control port<br />
<br />
[Install]<br />
WantedBy=sockets.target</nowiki>}}<br />
<br />
== Squeezelite ==<br />
<br />
{{hc|/etc/conf.d/squeezelite|<nowiki><br />
server="<server>:<port>" # amend as appropriate<br />
name="<device_name>" # amend as appropriate<br />
mac="<your_mac_here>" # amend as appropriate<br />
device="default" # amend as appropriate<br />
logtype="all"<br />
loglevel="info"<br />
logfile="/var/log/squeezelite.log"<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/squeezelite.service|<nowiki><br />
[Unit]<br />
Description=Squeezelite Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
EnvironmentFile=/etc/conf.d/squeezelite<br />
ExecStart=/usr/bin/squeezelite -n ${name} -m ${mac} -d ${logtype}=${loglevel} -f ${logfile} -o ${device} -s ${server}<br />
RestartSec=5<br />
Restart=on-failure<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== freeswitch ==<br />
<br />
<br />
{{hc|/etc/systemd/system/freeswitch.service|<nowiki><br />
[Unit]<br />
Description=freeswitch<br />
After=syslog.target network.target local-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/run/freeswitch/freeswitch.pid<br />
EnvironmentFile=/etc/conf.d/freeswitch<br />
PermissionsStartOnly=true<br />
ExecStartPre=/bin/mkdir -p /run/freeswitch<br />
ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch<br />
ExecStart=/usr/bin/freeswitch $FREESWITCH_OPTS<br />
TimeoutSec=45s<br />
Restart=always<br />
User=freeswitch<br />
Group=freeswitch<br />
UMask=0007<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/freeswitch|<nowiki><br />
# options to start freeswitch with<br />
# We default to -nonat, if you need nat, remove it<br />
FREESWITCH_OPTS="-nc"<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [[Pacman_Tips#Backing_up_Local_database_with_Systemd|Backing up local pacman database with systemd]]<br />
* [http://wiki.gentoo.org/wiki/Systemd systemd at gentoo wiki]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Systemd/Services&diff=306330Systemd/Services2014-03-21T18:14:16Z<p>Emlun: /* BitTorrent Sync */ Add user instance service</p>
<hr />
<div>{{Deletion|Please don't add any new elements to this page. All services must/will be relocated on their dedicated corresponding main article.}}<br />
{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd FAQ}}<br />
{{Related|Daemons List}}<br />
{{Related articles end}}<br />
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the [[official repositories]] or the [[AUR]]. These files can be copied from other distributions or created by yourself.<br />
<br />
== darkhttpd ==<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.service|<nowiki><br />
[Unit]<br />
Description=Darkhttpd Webserver<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/darkhttpd<br />
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_OPTS<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.socket|<nowiki><br />
[Unit]<br />
Conflicts=darkhttpd.service<br />
<br />
[Socket]<br />
ListenStream=80<br />
Accept=no<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/darkhttpd|<nowiki><br />
DARKHTTPD_ROOT="/srv/http"<br />
DARKHTTPD_OPTS="--uid nobody --gid nobody --chroot"<br />
</nowiki>}}<br />
<br />
== screen ==<br />
<br />
{{Merge|GNU Screen}}<br />
<br />
Autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Static Ethernet network ==<br />
<br />
This is a custom service file for static Ethernet configurations.<br />
<br />
{{hc|/etc/conf.d/network|<nowiki><br />
address=192.168.0.15<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for <interface><br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-<interface>.device <br />
After=sys-subsystem-net-devices-<interface>.device <br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network<br />
ExecStart=/usr/bin/ip link set dev <interface> up<br />
ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev <interface><br />
ExecStart=/usr/bin/ip route add default via ${gateway}<br />
ExecStop=/usr/bin/ip addr flush dev <interface><br />
ExecStop=/usr/bin/ip link set dev <interface> down<br />
Execstop=/sbin/ip addr delete ${address}/${netmask} dev <interface><br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
To set static IP on {{ic|enp3s0}} interface you will need to create {{ic|/etc/conf.d/network@enp3s0}} config file and run:<br />
<br />
# systemctl enable network@enp3s0.service<br />
<br />
== Set network interface in promiscuous mode ==<br />
<br />
{{hc|/etc/systemd/system/promiscuous@.service|<nowiki><br />
[Unit]<br />
Description=Set %i interface in promiscuous mode<br />
After=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/ip link set dev %i promisc on<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
If you want to enable promiscuous mode on interface {{ic|eth0}} run:<br />
<br />
# systemctl enable promiscuous@eth0.service<br />
<br />
== tpfand ==<br />
<br />
{{hc|/etc/systemd/system/tpfand.service|<nowiki><br />
[Unit]<br />
Description=ThinkPad Fan Control<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/tpfand.pid<br />
ExecStart=/usr/sbin/tpfand<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== MPD socket activation ==<br />
<br />
{{Merge|MPD}}<br />
<br />
If the following {{ic|mpd.socket}} file is enabled while {{ic|mpd.service}} (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start {{ic|mpd.service}} and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} ''AND'' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for more details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
<br />
{{hc|/usr/lib/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
== VideoLAN 2.0 ==<br />
<br />
Change the {{ic|1=User=}} parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|<nowiki><br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=nobody<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Xvfb ==<br />
<br />
Change the {{ic|1=User=}} and {{ic|1=Group=}} parameters:<br />
<br />
{{hc|/etc/systemd/system/xinit.service|<nowiki><br />
[Unit]<br />
Description=xinit with xvfb<br />
After=network.target<br />
<br />
[Service]<br />
User=bitlbee<br />
Group=bitlbee<br />
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Gitlab ==<br />
<br />
{{hc|/etc/systemd/system/gitlab.service|<nowiki><br />
[Unit]<br />
Description=Self Hosted Git Management<br />
Requires=postgresql.service redis.service<br />
After=postgresql.service redis.service<br />
Wants=postfix.service gitlab-worker.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/home/gitlab/gitlab/script/rails server -d -e production<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/server.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/gitlab-worker.service|<nowiki><br />
[Unit]<br />
Description=Gitlab Resque Worker<br />
Requires=redis.service<br />
After=redis.service<br />
Wants=postfix.service postgresql.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/bin/bash -c '. ~/.bashrc; . ./resque.sh'<br />
ExecStopPost=/usr/bin/rm /home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
</nowiki>}}<br />
<br />
== Cisco AnyConnect VPN ==<br />
<br />
{{hc|/etc/systemd/system/ciscovpn.service|<nowiki><br />
[Unit]<br />
Description=Cisco AnyConnect Secure Mobility Client Agent<br />
Requires=network.target remote-fs.target<br />
After=network.target remote-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/vpnagentd.pid<br />
ExecStart=/opt/cisco/anyconnect/bin/vpnagentd<br />
ExecStop=/usr/bin/killall /opt/cisco/anyconnect/bin/vpnagentd<br />
Restart=on-abort<br />
<br />
[Install]<br />
# one may want to use multi-user.target instead<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== redmine ==<br />
<br />
{{hc|/etc/systemd/system/redmine.service|<nowiki><br />
[Unit]<br />
Description=Redmine server<br />
After=syslog.target<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
User=redmine2<br />
Group=redmine2<br />
Environment=GEM_HOME=/home/redmine2/.gem/<br />
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production<br />
<br />
# Give a reasonable amount of time for the server to start up/shut down<br />
TimeoutSec=300<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Turn off the automatic screensaver ==<br />
<br />
{{Stub|1=Very hackish solution, you'd better use something like [https://bbs.archlinux.org/viewtopic.php?id=130447 this] (needs to be modified to work with XBMC).}}<br />
<br />
Arch Linux has a 10 minute screensaver set as standard. XBMC for CuBox does not disable this when watching movies, and this is a rather hackish workaround. Tested on the [http://archlinuxarm.org/platforms/armv7/cubox CuBox].<br />
<br />
{{hc|/etc/systemd/system/screensaveroff.service|<nowiki><br />
[Unit]<br />
Description=Disables the screensaver in X<br />
After=graphical.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/xset s off -d :0<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== slock ==<br />
<br />
Locks the system with the help of {{Pkg|slock}}. Very handy when closing the laptop lid for example.<br />
<br />
{{hc|/etc/systemd/system/screenlock.service|<nowiki><br />
[Unit]<br />
Description=Lock X session using slock<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/slock<br />
<br />
[Install]<br />
WantedBy=sleep.target<br />
</nowiki>}}<br />
<br />
== xautolock ==<br />
<br />
Automatically lock the screen after a timeout of 10 minutes.<br />
<br />
{{hc|/etc/systemd/system/xautolock.service|<nowiki><br />
[Unit]<br />
Description=Lock the screen automatically after a timeout<br />
<br />
[Service]<br />
Type=simple<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/xautolock -time 10 -locker slock -detectsleep<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== VDE2 interface ==<br />
<br />
Create and activate a vde2 tap interface for use in the {{ic|users}} user group.<br />
<br />
{{hc|/etc/systemd/system/vde2@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/vde_switch -tap %i -daemon -mod 660 -group users<br />
ExecStart=/usr/bin/ip link set dev %i up<br />
ExecStop=/usr/bin/ip addr flush dev %i<br />
ExecStop=/usr/bin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== BitTorrent Sync ==<br />
<br />
Run BitTorrent Sync as user ''username'':<br />
<br />
{{bc|<nowiki><br />
# systemctl start btsync@''username''<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/btsync@.service|<nowiki><br />
[Unit]<br />
Description=BitTorrent Sync application<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.config --nodaemon<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
This assumes existence of the following files:<br />
<br />
* {{ic|/usr/bin/btsync}} - the {{ic|btsync}} executable or a symlink pointing to it.<br />
* {{ic|/home/username/.config/btsync/btsync.config}} - the user's config file. Consult the [http://labs.bittorrent.com/experiments/sync/get-started.html#config-file official instructions] for creating one.<br />
<br />
=== User instance ===<br />
<br />
Allows you to start the daemon without root privileges.<br />
<br />
{{hc|/usr/lib/systemd/user/btsync.service or ~/.config/systemd/user/btsync.service|<nowiki><br />
[Unit]<br />
Description=Bittorent Sync service for %u<br />
After=network.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.conf --nodaemon<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
This makes the same assumptions as above. Invoke it as {{ic|$ systemctl --user start btsync}}. If enabled with {{ic|$ systemctl --user enable btsync}}, the daemon will start on login, unless [[Systemd/User#Automatic_start-up_of_systemd_user_instances|lingering]] is enabled for the user.<br />
<br />
== Crashplan PROe server ==<br />
<br />
{{hc|/etc/systemd/system/proserver.service|<nowiki><br />
[Unit]<br />
Description=CrashPlanPROe Backup Server<br />
After=network.target<br />
<br />
[Service]<br />
<br />
Type=forking<br />
<br />
ExecStart=/opt/proserver/bin/proserver start<br />
ExecStop=/opt/proserver/bin/proserver stop<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== ncdc ==<br />
<br />
{{hc|/etc/systemd/system/ncdc@.service|<br />
<nowiki>[Unit]<br />
Description=ncdc<br />
Requires=network.target local-fs.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
KillMode=none<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc<br />
ExecStop=/usr/bin/tmux send-keys -t dcpp:ncdc "/quit" C-m<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
== XBMC Socket Activation ==<br />
<br />
{{Merge|XBMC}}<br />
<br />
This can be used to start XBMC automatically when you start a remote control app or connect to its html control port. Start listening with ''systemctl start xbmc@user.socket'' (replace ''user'' with the user you want XBMC to be started as). You might have to change the port in ''xbmc@.socket''.<br />
<br />
{{hc|/etc/systemd/system/xbmc@.service|<br />
<nowiki>[Unit]<br />
Description=Launch XBMC on main display<br />
<br />
[Service]<br />
Type=oneshot<br />
Environment=DISPLAY=:0.0<br />
Nice=-1<br />
ExecStart=/usr/bin/su %i /usr/bin/xbmc<br />
ExecStartPost=/usr/bin/bash -c "sleep 15 && systemctl start xbmc@%i.socket"<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/xbmc@.socket|<br />
<nowiki>[Unit]<br />
Conflicts=xbmc@%i.service<br />
<br />
[Socket]<br />
#ListenDatagram=9 # listen for WOL packets<br />
ListenStream=8082 # change this to XBMC's http control port<br />
<br />
[Install]<br />
WantedBy=sockets.target</nowiki>}}<br />
<br />
== Squeezelite ==<br />
<br />
{{hc|/etc/conf.d/squeezelite|<nowiki><br />
server="<server>:<port>" # amend as appropriate<br />
name="<device_name>" # amend as appropriate<br />
mac="<your_mac_here>" # amend as appropriate<br />
device="default" # amend as appropriate<br />
logtype="all"<br />
loglevel="info"<br />
logfile="/var/log/squeezelite.log"<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/squeezelite.service|<nowiki><br />
[Unit]<br />
Description=Squeezelite Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
EnvironmentFile=/etc/conf.d/squeezelite<br />
ExecStart=/usr/bin/squeezelite -n ${name} -m ${mac} -d ${logtype}=${loglevel} -f ${logfile} -o ${device} -s ${server}<br />
RestartSec=5<br />
Restart=on-failure<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== freeswitch ==<br />
<br />
<br />
{{hc|/etc/systemd/system/freeswitch.service|<nowiki><br />
[Unit]<br />
Description=freeswitch<br />
After=syslog.target network.target local-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/run/freeswitch/freeswitch.pid<br />
EnvironmentFile=/etc/conf.d/freeswitch<br />
PermissionsStartOnly=true<br />
ExecStartPre=/bin/mkdir -p /run/freeswitch<br />
ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch<br />
ExecStart=/usr/bin/freeswitch $FREESWITCH_OPTS<br />
TimeoutSec=45s<br />
Restart=always<br />
User=freeswitch<br />
Group=freeswitch<br />
UMask=0007<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/freeswitch|<nowiki><br />
# options to start freeswitch with<br />
# We default to -nonat, if you need nat, remove it<br />
FREESWITCH_OPTS="-nc"<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [[Pacman_Tips#Backing_up_Local_database_with_Systemd|Backing up local pacman database with systemd]]<br />
* [http://wiki.gentoo.org/wiki/Systemd systemd at gentoo wiki]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Systemd/Services&diff=306328Systemd/Services2014-03-21T18:06:26Z<p>Emlun: /* BitTorrent Sync */ Add --nodaemon option, remove bullet about pidfile</p>
<hr />
<div>{{Deletion|Please don't add any new elements to this page. All services must/will be relocated on their dedicated corresponding main article.}}<br />
{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd FAQ}}<br />
{{Related|Daemons List}}<br />
{{Related articles end}}<br />
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the [[official repositories]] or the [[AUR]]. These files can be copied from other distributions or created by yourself.<br />
<br />
== darkhttpd ==<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.service|<nowiki><br />
[Unit]<br />
Description=Darkhttpd Webserver<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/darkhttpd<br />
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_OPTS<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.socket|<nowiki><br />
[Unit]<br />
Conflicts=darkhttpd.service<br />
<br />
[Socket]<br />
ListenStream=80<br />
Accept=no<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/darkhttpd|<nowiki><br />
DARKHTTPD_ROOT="/srv/http"<br />
DARKHTTPD_OPTS="--uid nobody --gid nobody --chroot"<br />
</nowiki>}}<br />
<br />
== screen ==<br />
<br />
{{Merge|GNU Screen}}<br />
<br />
Autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Static Ethernet network ==<br />
<br />
This is a custom service file for static Ethernet configurations.<br />
<br />
{{hc|/etc/conf.d/network|<nowiki><br />
address=192.168.0.15<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/network.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for <interface><br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-<interface>.device <br />
After=sys-subsystem-net-devices-<interface>.device <br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network<br />
ExecStart=/usr/bin/ip link set dev <interface> up<br />
ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev <interface><br />
ExecStart=/usr/bin/ip route add default via ${gateway}<br />
ExecStop=/usr/bin/ip addr flush dev <interface><br />
ExecStop=/usr/bin/ip link set dev <interface> down<br />
Execstop=/sbin/ip addr delete ${address}/${netmask} dev <interface><br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
To set static IP on {{ic|enp3s0}} interface you will need to create {{ic|/etc/conf.d/network@enp3s0}} config file and run:<br />
<br />
# systemctl enable network@enp3s0.service<br />
<br />
== Set network interface in promiscuous mode ==<br />
<br />
{{hc|/etc/systemd/system/promiscuous@.service|<nowiki><br />
[Unit]<br />
Description=Set %i interface in promiscuous mode<br />
After=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/ip link set dev %i promisc on<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
If you want to enable promiscuous mode on interface {{ic|eth0}} run:<br />
<br />
# systemctl enable promiscuous@eth0.service<br />
<br />
== tpfand ==<br />
<br />
{{hc|/etc/systemd/system/tpfand.service|<nowiki><br />
[Unit]<br />
Description=ThinkPad Fan Control<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/tpfand.pid<br />
ExecStart=/usr/sbin/tpfand<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== MPD socket activation ==<br />
<br />
{{Merge|MPD}}<br />
<br />
If the following {{ic|mpd.socket}} file is enabled while {{ic|mpd.service}} (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start {{ic|mpd.service}} and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} ''AND'' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for more details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
<br />
{{hc|/usr/lib/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
== VideoLAN 2.0 ==<br />
<br />
Change the {{ic|1=User=}} parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|<nowiki><br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=nobody<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Xvfb ==<br />
<br />
Change the {{ic|1=User=}} and {{ic|1=Group=}} parameters:<br />
<br />
{{hc|/etc/systemd/system/xinit.service|<nowiki><br />
[Unit]<br />
Description=xinit with xvfb<br />
After=network.target<br />
<br />
[Service]<br />
User=bitlbee<br />
Group=bitlbee<br />
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Gitlab ==<br />
<br />
{{hc|/etc/systemd/system/gitlab.service|<nowiki><br />
[Unit]<br />
Description=Self Hosted Git Management<br />
Requires=postgresql.service redis.service<br />
After=postgresql.service redis.service<br />
Wants=postfix.service gitlab-worker.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/home/gitlab/gitlab/script/rails server -d -e production<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/server.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/gitlab-worker.service|<nowiki><br />
[Unit]<br />
Description=Gitlab Resque Worker<br />
Requires=redis.service<br />
After=redis.service<br />
Wants=postfix.service postgresql.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/bin/bash -c '. ~/.bashrc; . ./resque.sh'<br />
ExecStopPost=/usr/bin/rm /home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
</nowiki>}}<br />
<br />
== Cisco AnyConnect VPN ==<br />
<br />
{{hc|/etc/systemd/system/ciscovpn.service|<nowiki><br />
[Unit]<br />
Description=Cisco AnyConnect Secure Mobility Client Agent<br />
Requires=network.target remote-fs.target<br />
After=network.target remote-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/vpnagentd.pid<br />
ExecStart=/opt/cisco/anyconnect/bin/vpnagentd<br />
ExecStop=/usr/bin/killall /opt/cisco/anyconnect/bin/vpnagentd<br />
Restart=on-abort<br />
<br />
[Install]<br />
# one may want to use multi-user.target instead<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== redmine ==<br />
<br />
{{hc|/etc/systemd/system/redmine.service|<nowiki><br />
[Unit]<br />
Description=Redmine server<br />
After=syslog.target<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
User=redmine2<br />
Group=redmine2<br />
Environment=GEM_HOME=/home/redmine2/.gem/<br />
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production<br />
<br />
# Give a reasonable amount of time for the server to start up/shut down<br />
TimeoutSec=300<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Turn off the automatic screensaver ==<br />
<br />
{{Stub|1=Very hackish solution, you'd better use something like [https://bbs.archlinux.org/viewtopic.php?id=130447 this] (needs to be modified to work with XBMC).}}<br />
<br />
Arch Linux has a 10 minute screensaver set as standard. XBMC for CuBox does not disable this when watching movies, and this is a rather hackish workaround. Tested on the [http://archlinuxarm.org/platforms/armv7/cubox CuBox].<br />
<br />
{{hc|/etc/systemd/system/screensaveroff.service|<nowiki><br />
[Unit]<br />
Description=Disables the screensaver in X<br />
After=graphical.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/xset s off -d :0<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== slock ==<br />
<br />
Locks the system with the help of {{Pkg|slock}}. Very handy when closing the laptop lid for example.<br />
<br />
{{hc|/etc/systemd/system/screenlock.service|<nowiki><br />
[Unit]<br />
Description=Lock X session using slock<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/slock<br />
<br />
[Install]<br />
WantedBy=sleep.target<br />
</nowiki>}}<br />
<br />
== xautolock ==<br />
<br />
Automatically lock the screen after a timeout of 10 minutes.<br />
<br />
{{hc|/etc/systemd/system/xautolock.service|<nowiki><br />
[Unit]<br />
Description=Lock the screen automatically after a timeout<br />
<br />
[Service]<br />
Type=simple<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/xautolock -time 10 -locker slock -detectsleep<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== VDE2 interface ==<br />
<br />
Create and activate a vde2 tap interface for use in the {{ic|users}} user group.<br />
<br />
{{hc|/etc/systemd/system/vde2@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/vde_switch -tap %i -daemon -mod 660 -group users<br />
ExecStart=/usr/bin/ip link set dev %i up<br />
ExecStop=/usr/bin/ip addr flush dev %i<br />
ExecStop=/usr/bin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== BitTorrent Sync ==<br />
<br />
Run BitTorrent Sync as user ''username'':<br />
<br />
{{bc|<nowiki><br />
# systemctl start btsync@''username''<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/btsync@.service|<nowiki><br />
[Unit]<br />
Description=BitTorrent Sync application<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/btsync --config %h/.config/btsync/btsync.config --nodaemon<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
This assumes existence of the following files:<br />
<br />
* {{ic|/usr/bin/btsync}} - the {{ic|btsync}} executable or a symlink pointing to it.<br />
* {{ic|/home/username/.config/btsync/btsync.config}} - the user's config file. Consult the [http://labs.bittorrent.com/experiments/sync/get-started.html#config-file official instructions] for creating one.<br />
<br />
== Crashplan PROe server ==<br />
<br />
{{hc|/etc/systemd/system/proserver.service|<nowiki><br />
[Unit]<br />
Description=CrashPlanPROe Backup Server<br />
After=network.target<br />
<br />
[Service]<br />
<br />
Type=forking<br />
<br />
ExecStart=/opt/proserver/bin/proserver start<br />
ExecStop=/opt/proserver/bin/proserver stop<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== ncdc ==<br />
<br />
{{hc|/etc/systemd/system/ncdc@.service|<br />
<nowiki>[Unit]<br />
Description=ncdc<br />
Requires=network.target local-fs.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
KillMode=none<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s dcpp -n ncdc -d ncdc<br />
ExecStop=/usr/bin/tmux send-keys -t dcpp:ncdc "/quit" C-m<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
== XBMC Socket Activation ==<br />
<br />
{{Merge|XBMC}}<br />
<br />
This can be used to start XBMC automatically when you start a remote control app or connect to its html control port. Start listening with ''systemctl start xbmc@user.socket'' (replace ''user'' with the user you want XBMC to be started as). You might have to change the port in ''xbmc@.socket''.<br />
<br />
{{hc|/etc/systemd/system/xbmc@.service|<br />
<nowiki>[Unit]<br />
Description=Launch XBMC on main display<br />
<br />
[Service]<br />
Type=oneshot<br />
Environment=DISPLAY=:0.0<br />
Nice=-1<br />
ExecStart=/usr/bin/su %i /usr/bin/xbmc<br />
ExecStartPost=/usr/bin/bash -c "sleep 15 && systemctl start xbmc@%i.socket"<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/xbmc@.socket|<br />
<nowiki>[Unit]<br />
Conflicts=xbmc@%i.service<br />
<br />
[Socket]<br />
#ListenDatagram=9 # listen for WOL packets<br />
ListenStream=8082 # change this to XBMC's http control port<br />
<br />
[Install]<br />
WantedBy=sockets.target</nowiki>}}<br />
<br />
== Squeezelite ==<br />
<br />
{{hc|/etc/conf.d/squeezelite|<nowiki><br />
server="<server>:<port>" # amend as appropriate<br />
name="<device_name>" # amend as appropriate<br />
mac="<your_mac_here>" # amend as appropriate<br />
device="default" # amend as appropriate<br />
logtype="all"<br />
loglevel="info"<br />
logfile="/var/log/squeezelite.log"<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/squeezelite.service|<nowiki><br />
[Unit]<br />
Description=Squeezelite Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
EnvironmentFile=/etc/conf.d/squeezelite<br />
ExecStart=/usr/bin/squeezelite -n ${name} -m ${mac} -d ${logtype}=${loglevel} -f ${logfile} -o ${device} -s ${server}<br />
RestartSec=5<br />
Restart=on-failure<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== freeswitch ==<br />
<br />
<br />
{{hc|/etc/systemd/system/freeswitch.service|<nowiki><br />
[Unit]<br />
Description=freeswitch<br />
After=syslog.target network.target local-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/run/freeswitch/freeswitch.pid<br />
EnvironmentFile=/etc/conf.d/freeswitch<br />
PermissionsStartOnly=true<br />
ExecStartPre=/bin/mkdir -p /run/freeswitch<br />
ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch<br />
ExecStart=/usr/bin/freeswitch $FREESWITCH_OPTS<br />
TimeoutSec=45s<br />
Restart=always<br />
User=freeswitch<br />
Group=freeswitch<br />
UMask=0007<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/freeswitch|<nowiki><br />
# options to start freeswitch with<br />
# We default to -nonat, if you need nat, remove it<br />
FREESWITCH_OPTS="-nc"<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [[Pacman_Tips#Backing_up_Local_database_with_Systemd|Backing up local pacman database with systemd]]<br />
* [http://wiki.gentoo.org/wiki/Systemd systemd at gentoo wiki]</div>Emlunhttps://wiki.archlinux.org/index.php?title=User:Emlun&diff=305389User:Emlun2014-03-17T23:45:11Z<p>Emlun: </p>
<hr />
<div>Emil Lundberg; lundberg.emil at gmail; emlun on AUR and irc.freenode.net<br />
<br />
Arch user since 2010.<br />
<br />
My AUR packages:<br />
<br />
* {{AUR|btsync-autoconfig}}<br />
* {{AUR|passqr}} and {{AUR|passqr-git}}</div>Emlunhttps://wiki.archlinux.org/index.php?title=User:Emlun&diff=305388User:Emlun2014-03-17T23:44:55Z<p>Emlun: Created page with "Emil Lundberg; lundberg.emil at gmail; emlun on irc.freenode.net Arch user since 2010. My AUR packages: * {{AUR|btsync-autoconfig}} * {{AUR|passqr}} and {{AUR|passqr-git}}"</p>
<hr />
<div>Emil Lundberg; lundberg.emil at gmail; emlun on irc.freenode.net<br />
<br />
Arch user since 2010.<br />
<br />
My AUR packages:<br />
<br />
* {{AUR|btsync-autoconfig}}<br />
* {{AUR|passqr}} and {{AUR|passqr-git}}</div>Emlunhttps://wiki.archlinux.org/index.php?title=Spotify&diff=298904Spotify2014-02-19T09:33:12Z<p>Emlun: Add "Spotify won't play local files" section</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[Category:Wine]]<br />
[http://www.spotify.com/ Spotify] is a digital music service that gives you access to millions of songs.<br />
<br />
This Internet music service allows you to select any song in its database and stream for free. The service was recently introduced to the United States after previously being exclusive to Europe. The Linux client is only officially packaged for Debian and Fedora distributions, but is also available in the AUR: {{AUR|spotify}}. Officially, they recommend that Linux users run the windows client under Wine. There are also the occasional voice ads in between songs for users who do not wish to subscribe.<br />
<br />
Spotify also offers free users the ability to create playlist which can be shuffled, and set to repeat tracks. Content provided by Spotify comes in explicit versions as well as censored.<br />
<br />
<br />
== Installing The Client ==<br />
Choose which client you would prefer. The Linux client is receiving good reviews. However, if you are comfortable with wine and it's configuration, you might want to choose the windows client. Please note that you do NOT need to install both. <br />
<br />
=== Installation of Linux Client ===<br />
Follow the instructions for installing packages from the AUR: https://wiki.archlinux.org/index.php/AUR#Installing_packages and install the AUR package here: {{AUR|spotify}}. The pkgbuild will automatically download the software. It would be a good use of time to go to the spotify website and create your user account while it's building.<br />
If you wish to play local files you will need to install {{AUR|ffmpeg-spotify}} as well.<br />
You can also install {{AUR|spotify-gnome-git}} to control spotify with gnome's media keys.<br />
<br />
=== Installation of Windows Client using Wine===<br />
<br />
==== Install Wine ====<br />
First, you must ensure that you have [[Wine]] installed on your system. In addition to installing Wine you will need to take a moment to configure it for the user who will be running the application.<br />
<br />
Depending on your choice of architecture it may be necessary for you to enable the [[Official_Repositories#multilib|multilib]] repositories. This is necessary to install Wine on x86_64 systems, if not enabled [[pacman]] will inform you that the package was not found.<br />
<br />
# pacman -Syy<br />
# pacman -S wine wine_gecko<br />
<br />
==== Configure Wine ====<br />
<br />
When wine is installed you will need to change some configuration settings using the winecfg application on your every day user account (not root).<br />
<br />
$ winecfg<br />
<br />
After launching the winecfg application you will be presented with multiple tabs that can assist you in tweaking the performance of the emulator. However for this purpose your main focus will be the Audio tab.<br />
<br />
While under the audio tab, you will enable either the ALSA or OSS driver by clicking the check box next to them, depending on what software you prefer to use. Also note that the hardware acceleration will need to be changed from Full to Emulation. When done you may exit the winecfg application.<br />
<br />
Failure to perform the above task will result in the inability to hear playback.<br />
<br />
==== Run Installer ====<br />
<br />
Obtaining Spotify can be done by registering for an account on their Website, the application does not offer in-app registration.<br />
<br />
However you can obtain the application prior to registering by using the following URL. [http://download.spotify.com/Spotify%20Installer.exe]<br />
<br />
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.<br />
<br />
$ wine Spotify\ Installer.exe<br />
<br />
Once the application is successfully installed you may run Spotify by using one of the following commands in terminal, or in the ALT+F2 launcher:<br />
<br />
If you use a x86_64 copy of ArchLinux, you'll have to run it like this:<br />
<br />
$ wine "/home/username/.wine/drive_c/Program Files (x86)/Spotify/spotify.exe"<br />
<br />
If you use a x86 copy of ArchLinux, you can use this command just fine:<br />
<br />
$ wine ~/.wine/drive_c/Program\ Files/Spotify/spotify.exe<br />
<br />
If you have any additional problems, I recommend setting the winecfg to Windows XP or Windows 7 emulation.<br />
<br />
==Global Media Hotkeys==<br />
<br />
Spotify has support for media keys like {{ic|XF86AudioPlay}}, but out of the box they only work inside Spotify. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below.<br />
<br />
===Linux Client===<br />
====Using a bash-script and xdotool====<br />
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:<br />
#!/bin/sh<br />
<br />
case $1 in<br />
"play")<br />
key="XF86AudioPlay"<br />
;;<br />
"next")<br />
key="XF86AudioNext"<br />
;;<br />
"prev")<br />
key="XF86AudioPrev"<br />
;;<br />
*)<br />
echo "Usage: $0 play|next|prev"<br />
exit 1<br />
;;<br />
esac<br />
xdotool key --window $(xdotool search --name "Spotify (Premium )?- Linux Preview"|head -n1) $key<br />
exit 0<br />
<br />
Let's call it {{ic|musickeys.sh}}. Make the script executable:<br />
$ chmod +x musickeys.sh<br />
By executing {{ic|./musickeys.sh play}} you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as [[xbindkeys]]. For [[Openbox]] you can use the following example (see [[Openbox#Configuration]] for help):<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh play</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh next</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh prev</execute><br />
</action><br />
</keybind><br />
<br />
====D-Bus====<br />
<br />
An alternative to the above is [[D-Bus]], which should be available by default as it is a dependency of [[systemd]]. With D-Bus we have a consistent and reliable way to communicate with other processes, such as Spotify.<br />
To play or pause the current song in Spotify:<br />
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause<br />
<br />
In order to bind this and the other commands to the media keys you need to install [[Xbindkeys]] and edit your .xbindkeysrc and add the following lines:<br />
# Play/Pause<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"<br />
XF86AudioPlay<br />
<br />
# Next<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"<br />
XF86AudioNext<br />
<br />
# Previous<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"<br />
XF86AudioPrev<br />
<br />
# Stop<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"<br />
XF86AudioStop<br />
<br />
===Windows-Client (via wine)===<br />
If you prefer the wine-version of Spotify, you can use [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] to send actions to Spotify.<br />
<br />
==Tips & Tricks==<br />
===Mute Commercials===<br />
With [https://aur.archlinux.org/packages/blockify/ blockify] you can mute commercials you don't want to hear (only works with the Wine version of Spotify).<br />
<br />
===Remote Control===<br />
====Send Commands via SSH====<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host 'yourcommand'<br />
<br />
where yourcommand can be [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] that you installed on the server or a dbus script for the linux version, as described above.<br />
<br />
====Grab the Spotify Window via SSH====<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
$ sh vncget.sh<br />
or, for the whole desktop:<br />
$ sh vncget.sh all<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
=== Broken radio ===<br />
<br />
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning mixed locales<br />
If your radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale. Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
<br />
=== Spotify won't play local files ===<br />
<br />
Try installing {{pkg|ffmpeg-compat}}, as per [http://bbs.archlinux.org/viewtopic.php?pid=1383240 this forum discussion].<br />
<br />
==See also==<br />
*[[SpotCommander]]: A web based remote control for Spotify<br />
*http://www.spotify.com/int/help/faq/wine/<br />
*http://www.spotify.com/int/download/previews/</div>Emlunhttps://wiki.archlinux.org/index.php?title=Spotify&diff=298903Spotify2014-02-19T09:27:49Z<p>Emlun: Add Troubleshooting section encapsulating Broken radio (for extending with more instructions)</p>
<hr />
<div>[[Category:Audio/Video]]<br />
[[Category:Wine]]<br />
[http://www.spotify.com/ Spotify] is a digital music service that gives you access to millions of songs.<br />
<br />
This Internet music service allows you to select any song in its database and stream for free. The service was recently introduced to the United States after previously being exclusive to Europe. The Linux client is only officially packaged for Debian and Fedora distributions, but is also available in the AUR: {{AUR|spotify}}. Officially, they recommend that Linux users run the windows client under Wine. There are also the occasional voice ads in between songs for users who do not wish to subscribe.<br />
<br />
Spotify also offers free users the ability to create playlist which can be shuffled, and set to repeat tracks. Content provided by Spotify comes in explicit versions as well as censored.<br />
<br />
<br />
== Installing The Client ==<br />
Choose which client you would prefer. The Linux client is receiving good reviews. However, if you are comfortable with wine and it's configuration, you might want to choose the windows client. Please note that you do NOT need to install both. <br />
<br />
=== Installation of Linux Client ===<br />
Follow the instructions for installing packages from the AUR: https://wiki.archlinux.org/index.php/AUR#Installing_packages and install the AUR package here: {{AUR|spotify}}. The pkgbuild will automatically download the software. It would be a good use of time to go to the spotify website and create your user account while it's building.<br />
If you wish to play local files you will need to install {{AUR|ffmpeg-spotify}} as well.<br />
You can also install {{AUR|spotify-gnome-git}} to control spotify with gnome's media keys.<br />
<br />
=== Installation of Windows Client using Wine===<br />
<br />
==== Install Wine ====<br />
First, you must ensure that you have [[Wine]] installed on your system. In addition to installing Wine you will need to take a moment to configure it for the user who will be running the application.<br />
<br />
Depending on your choice of architecture it may be necessary for you to enable the [[Official_Repositories#multilib|multilib]] repositories. This is necessary to install Wine on x86_64 systems, if not enabled [[pacman]] will inform you that the package was not found.<br />
<br />
# pacman -Syy<br />
# pacman -S wine wine_gecko<br />
<br />
==== Configure Wine ====<br />
<br />
When wine is installed you will need to change some configuration settings using the winecfg application on your every day user account (not root).<br />
<br />
$ winecfg<br />
<br />
After launching the winecfg application you will be presented with multiple tabs that can assist you in tweaking the performance of the emulator. However for this purpose your main focus will be the Audio tab.<br />
<br />
While under the audio tab, you will enable either the ALSA or OSS driver by clicking the check box next to them, depending on what software you prefer to use. Also note that the hardware acceleration will need to be changed from Full to Emulation. When done you may exit the winecfg application.<br />
<br />
Failure to perform the above task will result in the inability to hear playback.<br />
<br />
==== Run Installer ====<br />
<br />
Obtaining Spotify can be done by registering for an account on their Website, the application does not offer in-app registration.<br />
<br />
However you can obtain the application prior to registering by using the following URL. [http://download.spotify.com/Spotify%20Installer.exe]<br />
<br />
After you have registered and downloaded your copy of the installer you will need to run the application through Wine, depending on your setup you may be able to run the application by right clicking the file. If not terminal will work just fine, as long as you run the below command in the directory of your download.<br />
<br />
$ wine Spotify\ Installer.exe<br />
<br />
Once the application is successfully installed you may run Spotify by using one of the following commands in terminal, or in the ALT+F2 launcher:<br />
<br />
If you use a x86_64 copy of ArchLinux, you'll have to run it like this:<br />
<br />
$ wine "/home/username/.wine/drive_c/Program Files (x86)/Spotify/spotify.exe"<br />
<br />
If you use a x86 copy of ArchLinux, you can use this command just fine:<br />
<br />
$ wine ~/.wine/drive_c/Program\ Files/Spotify/spotify.exe<br />
<br />
If you have any additional problems, I recommend setting the winecfg to Windows XP or Windows 7 emulation.<br />
<br />
==Global Media Hotkeys==<br />
<br />
Spotify has support for media keys like {{ic|XF86AudioPlay}}, but out of the box they only work inside Spotify. We can use for example [[xbindkeys]] to catch the global media keypresses, and then forward them to Spotify using one of the methods below.<br />
<br />
===Linux Client===<br />
====Using a bash-script and xdotool====<br />
With the help of {{ic|xdotool}} it is possible to send your hotkeys to the application. The following script is an example of how to control Spotify from the outside:<br />
#!/bin/sh<br />
<br />
case $1 in<br />
"play")<br />
key="XF86AudioPlay"<br />
;;<br />
"next")<br />
key="XF86AudioNext"<br />
;;<br />
"prev")<br />
key="XF86AudioPrev"<br />
;;<br />
*)<br />
echo "Usage: $0 play|next|prev"<br />
exit 1<br />
;;<br />
esac<br />
xdotool key --window $(xdotool search --name "Spotify (Premium )?- Linux Preview"|head -n1) $key<br />
exit 0<br />
<br />
Let's call it {{ic|musickeys.sh}}. Make the script executable:<br />
$ chmod +x musickeys.sh<br />
By executing {{ic|./musickeys.sh play}} you can now toggle playing a song. Now you can bind this script to any tool that catches keypresses, such as [[xbindkeys]]. For [[Openbox]] you can use the following example (see [[Openbox#Configuration]] for help):<br />
<keybind key="XF86AudioPlay"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh play</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioNext"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh next</execute><br />
</action><br />
</keybind><br />
<keybind key="XF86AudioPrev"><br />
<action name="Execute"><br />
<execute>~/bin/musickeys.sh prev</execute><br />
</action><br />
</keybind><br />
<br />
====D-Bus====<br />
<br />
An alternative to the above is [[D-Bus]], which should be available by default as it is a dependency of [[systemd]]. With D-Bus we have a consistent and reliable way to communicate with other processes, such as Spotify.<br />
To play or pause the current song in Spotify:<br />
$ dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause<br />
<br />
In order to bind this and the other commands to the media keys you need to install [[Xbindkeys]] and edit your .xbindkeysrc and add the following lines:<br />
# Play/Pause<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"<br />
XF86AudioPlay<br />
<br />
# Next<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next"<br />
XF86AudioNext<br />
<br />
# Previous<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous"<br />
XF86AudioPrev<br />
<br />
# Stop<br />
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop"<br />
XF86AudioStop<br />
<br />
===Windows-Client (via wine)===<br />
If you prefer the wine-version of Spotify, you can use [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] to send actions to Spotify.<br />
<br />
==Tips & Tricks==<br />
===Mute Commercials===<br />
With [https://aur.archlinux.org/packages/blockify/ blockify] you can mute commercials you don't want to hear (only works with the Wine version of Spotify).<br />
<br />
===Remote Control===<br />
====Send Commands via SSH====<br />
If you set up ssh on the server, you can send controls from a client to a remote Spotify instance with<br />
<br />
$ ssh user@host 'yourcommand'<br />
<br />
where yourcommand can be [https://aur.archlinux.org/packages/spotifycmd/ spotifycmd] that you installed on the server or a dbus script for the linux version, as described above.<br />
<br />
====Grab the Spotify Window via SSH====<br />
Aside from grabbing the whole desktop with TeamViewer or VNC to remotely control your server, you can also only grab the Spotify Window from the server to your client.<br />
<br />
To do that, you need to configure sshd on your server and install x11vnc on both server and client as well as tigervnc on the client. Then you can use these scripts to grab either the complete dektop or only the Spotify window, which essentially gets you GUI client-like behavior as with MPD.<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncget.sh<br />
<br />
if [[ $1 == all ]];then<br />
ssh -f -t -L 5900:localhost:5900 user@host "x11vnc -q -display :0 -auth .Xauthority"<br />
else<br />
ssh -f -t -L 5900:localhost:5900 user@host ".bin/vncgetspotify.sh"<br />
fi<br />
<br />
for i in {1..4}; do<br />
sleep 2<br />
if vncviewer localhost:0; then break; fi<br />
done</nowiki>}}<br />
<br />
{{bc|<nowiki><br />
#!/bin/bash<br />
# vncgetspotify.sh<br />
<br />
export DISPLAY=:0<br />
<br />
id=$(wmctrl -lx | awk '/spotify.exe.Wine/ {print $1}')<br />
[[ -z $id ]] && id=$(wmctrl -lx | awk '/spotify.Spotify/ {print $1}')<br />
<br />
x11vnc -sid $id -display :0 -auth .Xauthority<br />
</nowiki>}}<br />
<br />
You will need to copy the second script to ~/.bin/vncgetspotify.sh on the server and the first script to any place on your client.<br />
<br />
Finally, to grab the spotify window, run on the client:<br />
$ sh vncget.sh<br />
or, for the whole desktop:<br />
$ sh vncget.sh all<br />
<br />
<br />
== Troubleshooting ==<br />
<br />
=== Broken radio ===<br />
<br />
: Spotify [http://community.spotify.com/t5/Help-Desktop-Linux-Mac-and/Bug-Desktop-Linux-0-9-0-133-gd18ed589-Having-mixed-locale-breaks/td-p/418270 bug report] concerning mixed locales<br />
If your radio page is broken (stuck when starting and unsresponsive to input) you might be using a custom locale. Try setting the environment variable {{ic|LC_NUMERIC}} to {{ic|en_US.utf8}} before starting Spotify.<br />
<br />
<br />
==See also==<br />
*[[SpotCommander]]: A web based remote control for Spotify<br />
*http://www.spotify.com/int/help/faq/wine/<br />
*http://www.spotify.com/int/download/previews/</div>Emlunhttps://wiki.archlinux.org/index.php?title=VCS_package_guidelines&diff=295028VCS package guidelines2014-01-30T12:51:34Z<p>Emlun: /* Git */ Clarify meaning of git-describe: "most recent reachable tag" (not only "tag of commit")</p>
<hr />
<div>[[Category:Package development]]<br />
[[it:VCS PKGBUILD Guidelines]]<br />
[[ja:VCS PKGBUILD Guidelines]]<br />
[[zh-CN:VCS PKGBUILD Guidelines]]<br />
[[zh-TW:VCS PKGBUILD Guidelines]]<br />
{{Package Guidelines}}<br />
<br />
[[Wikipedia:Revision_control|Version control systems]] can be used for retrieval of source code for both usual statically versioned packages and latest (trunk) version of a development branch. This article covers both cases.<br />
<br />
== Prototypes ==<br />
{{Warning|The prototype files provided in the {{Pkg|abs}} package and in [https://projects.archlinux.org/abs.git/tree/prototypes the ABS Git repository] are ''significantly'' out-of-date. Do ''not'' consider the prototypes to be authoritative in any way. See {{Bug|34485}}.}}<br />
<br />
The {{Pkg|abs}} package for the [[Arch Build System]] provides prototypes for [[CVS]], [[SVN]], [[Git]], [[Mercurial]], and [[Wikipedia:Darcs|Darcs]] [[PKGBUILD]]s. When {{Pkg|abs}} is installed, you can find them in {{ic|/usr/share/pacman}}. Latest versions can be found in the [https://projects.archlinux.org/abs.git/tree/prototypes prototypes directory in the ABS Git repository].<br />
<br />
== Guidelines ==<br />
<br />
* Suffix {{Ic|pkgname}} with {{Ic|-cvs}}, {{Ic|-svn}}, {{Ic|-hg}}, {{Ic|-darcs}}, {{Ic|-bzr}}, {{Ic|-git}} etc. unless the package fetches a specific release.<br />
<br />
* If the resulting package is different after changing the dependencies, URL, sources, etc. increasing the {{Ic|pkgrel}} is mandatory. Touching the {{ic|pkgver}} is not.<br />
<br />
* {{Ic|--holdver}} can be used to prevent [[makepkg]] from updating the {{ic|pkgver}} (see: [https://www.archlinux.org/pacman/makepkg.8.html makepkg(8)])<br />
<br />
* Include what the package conflicts with and provides (e.g. for {{AUR|fluxbox-git}}: {{Ic|1=conflicts=('fluxbox')}} and {{Ic|1=provides=('fluxbox')}}).<br />
<br />
* {{Ic|1=replaces=()}} generally causes unnecessary problems and should be avoided.<br />
<br />
* When using the cvsroot, use {{Ic|anonymous:@}} rather than {{Ic|anonymous@}} to avoid having to enter a blank password or {{Ic|anonymous:password@}}, if one is required.<br />
<br />
* Include the appropriate VCS tool in {{Ic|1=makedepends=()}} ({{pkg|cvs}}, {{pkg|subversion}}, {{pkg|git}}, ...).<br />
<br />
=== VCS sources ===<br />
{{Note|Pacman 4.1 supports the following VCS sources: {{ic|bzr}}, {{ic|git}}, {{ic|hg}} and {{ic|svn}}. See the {{ic|fragment}} section of {{ic|man PKGBUILD}} or [https://www.archlinux.org/pacman/PKGBUILD.5.html PKGBUILD(5)] for a list of supported VCS.}}<br />
<br />
Starting with {{Pkg|pacman}} 4.1, the VCS sources should be specified in the {{ic|1=source=()}} array and will be treated like any other source. {{ic|makepkg}} will clone/checkout/branch the repo into {{ic|$SRCDEST}} (same as {{ic|$startdir}} if not set in [https://www.archlinux.org/pacman/makepkg.conf.5.html makepkg.conf(5)]) and copy it to {{ic|$srcdir}} (in a specific way to each VCS). The local repo is left untouched, thus invalidating the need for a {{ic|-build}} directory.<br />
<br />
The general format of a VCS {{ic|1=source=()}} array is:<br />
source=('[folder::][vcs+]url[#fragment]')<br />
<br />
* {{ic|folder}} (optional) is used to change the default repo name to something more relevant (e.g. than {{ic|trunk}}) or to preserve the previous sources<br />
* {{ic|vcs+}} is needed for URLs that do not reflect the VCS type, e.g. {{ic|git+http://some_repo}}.<br />
* {{ic|url}} is the URL to the distant or local repo<br />
* {{ic|#fragment}} (optional) is needed to pull a specific branch or commit. See {{ic|man PKGBUILD}} for more information on the fragments available for each VCS.<br />
<br />
An example Git source array:<br />
source=('project_name::git+http://project_url#branch=project_branch')<br />
<br />
=== The pkgver() function ===<br />
The {{ic|pkgver}} autobump is now achieved via a dedicated {{ic|pkgver()}} function. This allows for better control over the {{ic|pkgver}}, and maintainers should favor a {{ic|pkgver}} that makes sense.<br />
<br />
It is recommended to have following version format: ''RELEASE.rREVISION'' where ''REVISION'' is a monotonically increasing number that uniquely identifies the source tree (VCS revisions do this). The last VCS tag can be used for ''RELEASE''. If there are no public releases and no repository tags then zero could be used as a release number or you can drop ''RELEASE'' completely and use version number that looks like ''rREVISION''. If there are public releases but repo has no tags then developer should get the release version somehow e.g. by parsing the project files.<br />
<br />
Following are some examples showing the ''intended'' output:<br />
<br />
==== Git ====<br />
<br />
Using the most recent annotated tag reachable from the last commit:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'<br />
}</nowiki>|<br />
2.0.r6.ga17a017<br />
}}<br />
<br />
Using the most recent unannotated tag reachable from the last commit:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
git describe --long --tags | sed -E 's/([^-]*-g)/r\1/;s/-/./g'<br />
}</nowiki>|<br />
0.71.r115.gd95ee07<br />
}}<br />
<br />
In case if the git tag does not contain dashes then one can use simpler sed expression {{ic|sed 's/-/.r/; s/-/./'}}.<br />
<br />
If tag contains a prefix, like {{ic|v}} or project name then it should be cut off:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
# cutting off 'foo-' prefix that presents in the git tag<br />
git describe --long | sed -E 's/^foo-//;s/([^-]*-g)/r\1/;s/-/./g'<br />
}</nowiki>|<br />
6.1.r3.gd77e105<br />
}}<br />
<br />
If there are no tags then use number of revisions since beginning of the history:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"<br />
}</nowiki>|<br />
r1142.a17a017<br />
}}<br />
<br />
{{Note|SHA1 (in this case {{ic|a17a017}}) is not used in the version comparison and can be omitted, although it allows quick identification of the exact revision used and might be useful during debugging.}}<br />
<br />
==== Subversion ====<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
local ver="$(svnversion)"<br />
printf "r%s" "${ver//[[:alpha:]]}"<br />
}</nowiki>|<br />
r8546<br />
}}<br />
<br />
{{Note|If the project has releases you should use them instead of the {{ic|0.}}.}}<br />
<br />
==== Mercurial ====<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"<br />
}</nowiki>|<br />
r2813.75881cc5391e<br />
}}<br />
<br />
==== Bazaar ====<br />
{{hc|<nowiki>pkgver() {<br />
cd "$srcdir/repo"<br />
printf "r%s" "$(bzr revno)"<br />
}</nowiki>|<br />
r830<br />
}}<br />
<br />
==== Fallback ====<br />
The current date can be used, in case no satisfactory {{ic|pkgver}} can be extracted from the repository:<br />
<br />
{{hc|<nowiki>pkgver() {<br />
date +%Y%m%d<br />
}</nowiki>|<br />
20130408<br />
}}<br />
<br />
Although it does not identify source tree state uniquely, so avoid it if possible.<br />
<br />
== Tips ==<br />
<br />
=== A sample Git PKGBUILD ===<br />
# Maintainer: Dave Reisner <d@falconindy.com> <br />
# Contributor: William Giokas (KaiSforza) <1007380@gmail.com><br />
<br />
pkgname=expac-git<br />
pkgver=0.0.0<br />
pkgrel=1<br />
pkgdesc="Pacman database extraction utility"<br />
arch=('i686' 'x86_64')<br />
url="https://github.com/falconindy/expac"<br />
license=('MIT')<br />
depends=('pacman')<br />
makedepends=('git')<br />
conflicts=('expac')<br />
provides=('expac')<br />
# The git repo is detected by the 'git:' or 'git+' beginning. The branch<br />
# '$pkgname' is then checked out upon cloning, expediating versioning:<br />
#source=('git+https://github.com/falconindy/expac.git'<br />
source=("$pkgname"::'git://github.com/falconindy/expac.git'<br />
'expac_icon.png')<br />
# Because the sources are not static, skip Git checksum:<br />
md5sums=('SKIP'<br />
'020c36e38466b68cbc7b3f93e2044b49')<br />
<br />
pkgver() {<br />
cd "$srcdir/$pkgname"<br />
# Use the tag of the last commit<br />
git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'<br />
}<br />
<br />
build() {<br />
cd "$srcdir/$pkgname"<br />
make<br />
}<br />
<br />
package() {<br />
cd "$srcdir/$pkgname"<br />
make PREFIX=/usr DESTDIR="$pkgdir" install<br />
install -Dm644 "$srcdir/expac_icon.png" "$pkgdir/usr/share/pixmaps/expac.png"<br />
}<br />
<br />
=== Git Submodules ===<br />
Git submodules are a little tricky to do. The idea is to add the URLs of the submodules themselves directly to the sources array and then reference them during prepare(). This could look like this:<br />
<br />
source=("git://somewhere.org/something/something.git"<br />
"git://somewhere.org/mysubmodule/mysubmodule.git")<br />
<br />
prepare() {<br />
cd something<br />
git submodule init<br />
git config submodule.mysubmodule.url $srcdir/mysubmodule<br />
git submodule update<br />
}</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=284565Resilio Sync2013-11-25T13:32:55Z<p>Emlun: /* Automatic config file creation */ Update default storage_path value</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relays on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon.<br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You'll probably want to review the configuration settings, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{aur|btsync-autoconfig}} package provides a systemd service (btsync-autoconfig@user.service) that, if enabled, triggers when btsync@user.service starts and creates a config file with default values if it does not already exist. The install script enables btsync-autoconfig@user.service by default.<br />
<br />
btsync-autoconfig@user.service creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.btsync}}<br />
* webui/login: {{ic|$USER}}</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=279340Resilio Sync2013-10-22T10:11:31Z<p>Emlun: /* Synchronization */</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relays on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device adds a folder for synchronization, a secret is generated. From now on, every device that wants to synchronize that folder must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon.<br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You'll probably want to review the configuration settings, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{aur|btsync-autoconfig}} package provides a systemd service (btsync-autoconfig@user.service) that, if enabled, triggers when btsync@user.service starts and creates a config file with default values if it does not already exist. The install script enables btsync-autoconfig@user.service by default.<br />
<br />
btsync-autoconfig@user.service creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.config/btsync}}<br />
* webui/login: {{ic|$USER}}</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=279337Resilio Sync2013-10-22T09:48:21Z<p>Emlun: Update to reflect the current state of the AUR packages</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relays on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device makes a folder and adds it to his BTSync client, a secret is generated. From now on, every device that wants to synchronize that folder, must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|btsync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions for managing the btsync daemon.<br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website]. The rest of this guide assumes that you are using the btsync AUR package.<br />
<br />
== Usage ==<br />
<br />
The Linux client of BTSync does not use a typical GUI, instead it sets up a WebUI server accessible at {{ic|localhost:8888}}. Shared folders can also be configured statically in a configuration file, but doing so disables the WebGUI.<br />
<br />
Once installed, you'll first need to create a configuration file at {{ic|~/.config/btsync/btsync.conf}}, see [[#Configuration]]. When that is done, start and (if you want it to start on boot) enable the service:<br />
# systemctl start btsync@user<br />
# systemctl enable btsync@user<br />
replacing {{ic|user}} by the desired username. The service will run as the named user.<br />
<br />
You can also run it as the {{ic|btsync}} system user, just leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default. You'll probably want to review the configuration settings, see below.<br />
<br />
== Configuration ==<br />
A sample configuration file can be created using {{ic|btsync --dump-sample-config}}. You'll probably want to change some of the settings, including:<br />
<br />
* device_name<br />
* storage_path<br />
* webui/login<br />
* webui/password<br />
<br />
{{note|The storage_path setting defines where metadata will be saved, '''not''' the synced files themselves. Where synced files are saved is configured on a per-folder basis in the WebGUI.}}<br />
<br />
===Automatic config file creation===<br />
<br />
The {{aur|btsync-autoconfig}} package provides a systemd service (btsync-autoconfig@user.service) that, if enabled, triggers when btsync@user.service starts and creates a config file with default values if it does not already exist. The install script enables btsync-autoconfig@user.service by default.<br />
<br />
btsync-autoconfig@user.service creates {{ic|~/.config/btsync/btsync.conf}} if it does not exist, and guesses some default values of the settings:<br />
<br />
* device_name: {{ic|$USER@$HOSTNAME}}<br />
* storage_path: {{ic|~/.config/btsync}}<br />
* webui/login: {{ic|$USER}}</div>Emlunhttps://wiki.archlinux.org/index.php?title=Input_Japanese_using_uim&diff=278856Input Japanese using uim2013-10-17T05:15:18Z<p>Emlun: /* Japanese fonts */ otf-ipafont is now in [community]</p>
<hr />
<div>[[Category:Internationalization]]<br />
[[ja:Input Japanese using uim]]<br />
This page explains how to get the Japanese input to work using [http://code.google.com/p/uim/ uim].<br />
<br />
If you use SCIM, see [[Smart Common Input Method platform]].<br />
<br />
If you use IBus, see [[Ibus]].<br />
<br />
== Installation ==<br />
<br />
You need the following packages to input Japanese.<br />
<br />
* Japanese fonts<br />
* Japanese input method (Kana to Kanji conversion engine)<br />
* Input method framework: uim<br />
<br />
=== Japanese fonts ===<br />
<br />
''see also [[Fonts]] and [[Font Configuration]] for configuration or more detail.''<br />
<br />
Recommended Japanese fonts are as follows.<br />
* [http://ossipedia.ipa.go.jp/ipafont/ IPA fonts] || {{Pkg|otf-ipafont}}<br />
: A high quality and formal style opensource font set including Gothic (sans-serif) and Mincho (serif) glyphs. Default font of openSUSE-ja.<br />
* [http://dicey.org/vlgothic/ VL Gothic] ([[Arch User Repository|AUR]]: {{AUR|ttf-vlgothic}})<br />
: Default Gothic font of Debian-ja, Fedora-ja, Vine Linux, et al.<br />
* [http://www.geocities.jp/ep3797/modified_fonts_01.html UmePlus Gothic] (AUR: {{AUR|ttf-umeplus}})<br />
: Default Gothic font of Mandriva Linux ja environment.<br />
<br />
If you want to show [http://en.wikipedia.org/wiki/2channel_Shift_JIS_art 2channel Shift JIS art] properly, use one of the following fonts:<br />
* ipamona font (AUR: {{AUR|ttf-ipa-mona}})<br />
* Monapo font (AUR: {{AUR|ttf-monapo}})<br />
<br />
=== uim ===<br />
<br />
==== Using pacman ====<br />
<br />
[[pacman|Install]] {{Pkg|uim}} from the [[official repositories]].<br />
<br />
==== Compiling uim from source using PKGBUILD ====<br />
<br />
If you want to build uim with your configurationin, you can compile from source, using [[ABS]] for istance. See [http://code.google.com/p/uim/wiki/InstallUim official wiki] for all configure options.<br />
<br />
In Arch official repositories, uim is built with the following custom configuration (as of 1.8.6):<br />
* {{ic|--with-anthy-utf8}} - Enable Anthy(UTF-8) support<br />
* {{ic|--with-qt4-immodule}} - Build Qt4 immodule<br />
* {{ic|--with-qt4}} - Build uim-tools for Qt4<br />
<br />
If you want KDE4 plasma widget, install {{Pkg|automoc4}} for making dependency, and add {{ic|--enable-kde4-applet}} option to PKGBUILD file.<br />
<br />
=== Input method ===<br />
<br />
==== Anthy ====<br />
<br />
Anthy is one of the most popular Japanese input methods in the open source world. However, it has not been maintained for a long time. [http://wiki.debian.org/Teams/DebianAnthy Debian succeeds it] from May 2010.<br />
<br />
Install {{Pkg|anthy}} from the official repositories.<br />
<br />
===== Extra dictionary =====<br />
<br />
Anthy's default dictionary does not include several characters which are not specified on EUC-JP (JIS X 0208) such as "①", "♥", etc. [http://en.sourceforge.jp/projects/alt-cannadic/ alt-cannadic] provides extra dictionaries including those characters.<br />
<br />
Get [http://en.sourceforge.jp/projects/alt-cannadic/releases/?package_id=6129 alt-cannadic dictionary] and put them under your {{Ic|~/.anthy/imported_words_default.d}}.<br />
$ tar jxvf alt-cannadic-091230.tar.bz2<br />
$ mkdir ~/.anthy/imported_words_default.d (if not exist)<br />
$ cp alt-cannadic-091230/extra/*.t ~/.anthy/imported_words_default.d/<br />
<br />
Please see [http://sourceforge.jp/projects/alt-cannadic/wiki/%E4%BD%BF%E3%81%84%E6%96%B9_Anthy-UTF-8 official wiki] for more detail (Japanese).<br />
<br />
{{Warning|If you will be using this extra dictionary, choose '''Anthy (UTF-8)''' for default input method on uim.}}<br />
<br />
==== Modified Anthy (anthy-ut) ====<br />
<br />
[http://www.geocities.jp/ep3797/anthy_dict_01.html Modified Anthy] is a set of patches and huge extended dictionaries which aims to improve the Kana to Kanji conversion quality of original Anthy.<br />
<br />
Modified Anthy consists two different upstreams:<br />
* Patched source of Anthy by [http://www.fenix.ne.jp/~G-HAL/soft/nosettle/#anthy G-HAL]<br />
* Huge extended dictionalies by [http://www.geocities.jp/ep3797/anthy_dict_01.html UTSUMI]<br />
<br />
{{Warning|<br />
* Modified Anthy applies to only Anthy (UTF-8). So you have to choose '''Anthy (UTF-8)''' for default input method on uim.<br />
* Modified Anthy does not have compatibility of the dictionaries and learning data with original Anthy.<br />
}}<br />
<br />
===== Compiling modified Anthy using PKGBUILD =====<br />
<br />
Modified Anthy is available on AUR named {{AUR|anthy-ut}}.<br />
<br />
Get anthy-ut tarball and makepkg to make and install package:<br />
$ wget https://aur.archlinux.org/packages/anthy-ut/anthy-ut.tar.gz<br />
$ tar xvf anthy-ut.tar.gz<br />
$ cd anthy-ut<br />
$ makepkg -s -i<br />
<br />
If you already use original Anthy, you have to convert the existing learning data format.<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
$ rm ~/.anthy/last-record1_*.bin<br />
$ anthy-agent --update-base-record<br />
(Though this step repeats the same commands twice, it is not mistypes.)<br />
<br />
==== Anthy Kaomoji ====<br />
<br />
[http://sourceforge.jp/projects/anthy/ Anthy Kaomoji] is a modified version of Anthy that converts Hiragana text to Kana Kanji mixed text and has emoticon (顔文字) and 2ch dictionaries.<br />
It can be found in the AUR ({{AUR|anthy-kaomoji}}).<br />
<br />
==== Mozc ====<br />
<br />
''See [[Mozc]].''<br />
<br />
[http://code.google.com/p/mozc/ Mozc] is a Japanese Input Method Editor (IME) designed for multi-platform such as Chromium OS, Windows, Mac and Linux which originates from [http://www.google.com/intl/ja/ime/ Google Japanese Input].<br />
<br />
Though {{AUR|Mozc}} adapts to only ibus input method framework, [http://code.google.com/p/macuim/ macuim] provides uim-mozc plugin.<br />
<br />
===== Mozc (Vanilla) =====<br />
<br />
{{AUR|uim-mozc}} is available on AUR.<br />
{{Note|This does not support kill_line feature of uim-mozc.}}<br />
You can install this from unofficial user repository. Add the following into your /etc/pacman.conf:<br />
[pnsft-pur]<br />
SigLevel = Optional TrustAll<br />
Server = http://downloads.sourceforge.net/project/pnsft-aur/pur/$arch<br />
{{Note|This repo provides x86_64 packages only now.}}<br />
And refresh package database:<br />
# pacman -Syy<br />
You can choose install packages specifying group name as follows:<br />
# pacman -S mozc-im<br />
Or, specify package names directly. For example:<br />
# pacman -S uim-mozc<br />
<br />
===== mozc-ut and mozc-svn =====<br />
<br />
{{AUR|mozc-ut}} and {{AUR|mozc-svn}} can be built uim-mozc.<br />
{{Note|mozc-ut can work with {{AUR|uim-mozc}}.}}<br />
To build uim-mozc, edit PKGBUILD like follow, i,e. uncomment {{Ic|1=_uim_mozc=}} line:<br />
## If you will not be using ibus, comment out below.<br />
_ibus_mozc="yes"<br />
## If you will be using uim, uncomment below.<br />
_uim_mozc="yes"<br />
## If applying patch for uim-mozc fails, try to uncomment below.<br />
#_kill_kill_line="yes"<br />
## This will disable the 'kill-line' function of uim-mozc.<br />
{{Tip|If you will never be using ibus-mozc, comment out the {{Ic|1=_ibus_mozc=}} line.}}<br />
<br />
===== Registering Mozc =====<br />
<br />
{{Warning|You '''must''' run the following command whenever you upgrade or (re-)install uim.<br/><br />
# uim-module-manager --register mozc}}<br />
<br />
==== Google CGI API for Japanese input ====<br />
<br />
[http://www.google.co.jp/ime/cgiapi.html Google CGI API for Japanese Input] (Google-CGIAPI-Jp) is CGI service to provide Japanese conversion on the Internet by Google. It can be used on [http://www.google.com/transliterate web browser]. Its conversion engine seems to be equivalent to Google Japanese Input, so conversion quality is probably better than Mozc.<br />
<br />
{{Note|This service sends/receives preedits and candidates as plain text (as of 2012-09).}}<br />
<br />
You can use it via uim. Choose "Google-CGIAPI-Jp" on uim-im-switcher-gtk/gtk3/qt4 or uim-pref-gtk/gtk3/qt4.<br />
<br />
== Settings ==<br />
<br />
Add the followings to ~/.[[xprofile]], ~/.[[xinitrc]] or ~/.xsession:<br />
<br />
=== Environment variables ===<br />
<br />
export GTK_IM_MODULE='uim'<br />
export QT_IM_MODULE='uim'<br />
uim-xim &<br />
export XMODIFIERS='@im=uim'<br />
<br />
{{Note|The variables should be exported before starting your desktop environment, i.e. before "exec startxfce4" or similar.}}<br />
<br />
=== Toolbar utilities ===<br />
<br />
If you want to use UimToolbar utilities which shows and controls uim mode, add '''one''' of the followings, too.<br />
<br />
==== uim-toolbar-gtk/qt ====<br />
<br />
Using toolbar appears as a window.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3 &<br />
For Qt4:<br />
uim-toolbar-qt4 &<br />
<br />
==== uim-toolbar-gtk-systray ====<br />
<br />
Using toolbar for system tray.<br />
<br />
For GTK+ 2:<br />
uim-toolbar-gtk-systray &<br />
For GTK+ 3:<br />
uim-toolbar-gtk3-systray &<br />
<br />
==== Panel applet ====<br />
<br />
Or, if you use GNOME, KDE or Xfce, you can use uim-toolbar panel applet (Xfce requires xfce4-xfapplet-plugin to use uim-applet-gnome).<br />
<br />
=== uim preferences ===<br />
<br />
Configure uim preferences by running :<br />
$ uim-pref-gtk (Or, uim-pref-gtk3/uim-pref-qt4)<br />
which brings forth a GUI.<br />
<br />
Choose your preferring input method as 'Default input method'.<br />
{{Note|Mozc will be not listed in 'Default input method' at first time so you will need to add it into 'Enabled input methods' to use.}}<br />
<br />
You can run {{ic|uim-xim}} or restart X to test your settings.<br />
<br />
Provided everything went well you should be able to input Japanese in X.<br />
<br />
=== Input Japanese on Emacs ===<br />
<br />
uim provides uim.el the bridge software between Emacs and uim. Here is a sample to use uim on Emacs with utf-8 encoding. <br />
<br />
Please see [http://code.google.com/p/uim/wiki/UimEl Official wiki] for more detail.<br />
<br />
==== LEIM or minor-mode ====<br />
<br />
You can call uim.el from Emacs in two ways; directly or with the LEIM (Library of Emacs Input Method) framework. Though settings of them are different, basic functions are same. If you want to switch between uim.el and other Emacs IMs frequently, you should use LEIM framework.<br />
<br />
===== Settings for the minor-mode =====<br />
<br />
If you will be using on minor-mode, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; read uim.el<br />
(require 'uim)<br />
;; uncomment next and comment out previous to load uim.el on-demand<br />
;; (autoload 'uim-mode "uim" nil t)<br />
<br />
;; key-binding for activate uim (ex. C-\)<br />
(global-set-key "\C-\\" 'uim-mode)<br />
<br />
===== Settings for the LEIM =====<br />
<br />
If you will be using via LEIM, write the following settings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing and choose default input method.<br />
;; read uim.el with LEIM initializing<br />
(require 'uim-leim)<br />
<br />
;; set default IM. Uncomment the one of the followings.<br />
;(setq default-input-method "japanese-anthy-utf8-uim") ; Anthy (UTF-8)<br />
;(setq default-input-method "japanese-google-cgiapi-jp-uim") ; Google-CGIAPI-Jp<br />
;(setq default-input-method "japanese-mozc-uim") ; Mozc<br />
<br />
==== Preferred character encoding ====<br />
<br />
uim.el uses euc-jp character encoding by default. To set UTF-8 as preferred encodings, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
;; Set UTF-8 as preferred character encoding (default is euc-jp).<br />
(setq uim-lang-code-alist<br />
(cons '("Japanese" "Japanese" utf-8 "UTF-8")<br />
(delete (assoc "Japanese" uim-lang-code-alist) <br />
uim-lang-code-alist)))<br />
<br />
==== Enable inline candidates displaying mode by default ====<br />
<br />
The inline candidates displaying mode displays conversion candidates just below (or above) preedit text vertically instead of echo area. If you want to enable inline candidates displaying mode by default, write as follows.<br />
;; set inline candidates displaying mode as default<br />
(setq uim-candidate-display-inline t)<br />
<br />
==== Set Hiragana input mode by default ====<br />
<br />
To set Hiragana input mode at activting uim, add the settings like follows:<br />
<br />
;; Set Hiragana input mode at activating uim.<br />
(setq uim-default-im-prop '("action_anthy_utf8_hiragana"<br />
"action_google-cgiapi-jp_hiragana"<br />
"action_mozc_hiragana"))<br />
<br />
==== Ignoring C-SPC on uim.el ====<br />
<br />
When you are assigning activation/deactivation of input method to C-SPC, C-SPC is stolen to switch input mode by uim.el while it is activated. To prevent the stealing and use for set-mark-command, add the followings into your {{Ic|.emacs.d/init.el}} or some other file for Emacs customizing.<br />
(add-hook 'uim-load-hook<br />
'(lambda ()<br />
(define-key uim-mode-map [67108896] nil)<br />
(define-key uim-mode-map [0] nil)))<br />
<br />
==== Disabling XIM on Emacs ====<br />
<br />
When you are using input method on your desktop and assigning activation/deactivation of input method to C-SPC, you will be not able to use C-SPC/C-@ as set-mark-command on Emacs. To avoid this problem, add the following into your {{Ic|~/.Xresources}} or {{Ic|~/.Xdefaults}}. xim will be disabled on Emacs.<br />
Emacs*UseXIM: false<br />
<br />
== Troubleshooting ==<br />
<br />
=== Cannot input Japanese on Opera ===<br />
<br />
If you use Opera and cannot input Japanese with uim, try to edit environment variable as follows:<br />
Make sure to add follows in the beginning of /usr/bin/opera.<br />
<br />
export XMODIFIERS='@im=uim'<br />
export QT_IM_MODULE='xim'<br />
<br />
=== Cannot type a consonant in Zenkaku mode ===<br />
<br />
If you cannot type a consonant in Zenkaku mode, add follows to your config file.<br />
<br />
e.g. vi ~/.uim.d/customs/custom-google-cgiapi-jp.scm<br />
<br />
(define ja-rk-rule-hoge<br />
(map<br />
(lambda (c)<br />
(list (cons (list c) ()) (list c c c)))<br />
'("b" "c" "d" "f" "g" "h" "j" "k" "l" "m"<br />
"p" "q" "r" "s" "t" "v" "w" "x" "y" "z"<br />
"A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M"<br />
"N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")))<br />
(if (symbol-bound? 'ja-rk-rule-hoge)<br />
(set! ja-rk-rule (append ja-rk-rule-hoge ja-rk-rule)))<br />
<br />
=== uim-toolbar-gtk-systray: tray icon is crushed ===<br />
<br />
Though some of DE, WM or panel application may provide only one icon space per application on system-tray/notification-area, uim-toolbar-gtk-systray displays some icons on it by default so those icons are crushed. Choose just one of them to solve it. The steps to display only 'Input mode' icon for example as follows:<br />
# Run {{Ic|uim-pref-gtk}}.<br />
# Click 'Toolbar' on 'Group' list.<br />
# Take the all checkmarks off.<br />
# Click 'Anthy', 'Anthy (UTF-8)' or 'Mozc' which you are using on 'Group' list.<br />
# Click Edit button in 'Toolbar' box > 'Enable toolbar buttons' line.<br />
# Enable only 'Input mode' and click 'Close' button.<br />
# Click 'OK' button to close uim-pref-gtk.<br />
The tray icon will be displayed "あ" (Hiragana mode) or "ー" (Direct mode).<br />
<br />
=== I use darker theme, I cannot read the uim mode icons ===<br />
<br />
You can choose icons for darker background (uim 1.6.0 or later).<br />
# Run uim-perf-gtk<br />
# Click 'Toolbar' on 'Group' list.<br />
# Check 'Use icon for dark background'.<br />
<br />
== See also ==<br />
<br />
;uim<br />
:[http://code.google.com/p/uim/wiki/OfficialUserDocument uim official document]<br />
:[http://en.wikibooks.org/wiki/Uim uim on wikibooks]<br />
<br />
;Fonts<br />
:[http://www.geocities.jp/ep3797/japanese_fonts.html Japanese fonts showcase]<br />
:[http://www.geocities.jp/ep3797/modified_fonts_01.html modified Japanese fonts]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Resilio_Sync&diff=275248Resilio Sync2013-09-13T00:49:12Z<p>Emlun: /* Installation */ Summary of what the package does; Improve systemctl usage instructions; Tell where configuration is stored</p>
<hr />
<div>[[Category:Internet Applications]]<br />
[http://labs.bittorrent.com/experiments/sync.html BitTorrent Sync] (BTSync) is a file sharing system that relays on the [http://en.wikipedia.org/wiki/Bittorrent BitTorrent] protocol, and differs from other file sharing software in the connection type between devices. Instead of uploading the files to an online server, and then each device fetching them from the server itself, the file transfer is done directly from peer to peer, and therefore there is no limit on data storage and/or transfer speed.<br />
<br />
== Security ==<br />
<br />
BitTorrent Sync encrypts the traffic between devices with AES cypher and a 256-bit key created on the base of the secret — a random string (20 bytes or more) that is unique for every folder to be synchronized.<br />
<br />
== Secrets ==<br />
<br />
BitTorrent Sync uses a specific method for folder sharing, the 'secret': a random 21-byte key Base32-encoded.<br />
<br />
== Synchronization ==<br />
<br />
When a device makes a folder and adds it to his BTSync client, a secret is generated. From now on, every device that wants to synchronize that folder, must know the secret key.<br />
<br />
The synchronization has no speed or size limits, as long as both devices have enough disk space.<br />
<br />
== Installation ==<br />
<br />
{{AUR|bittorrent-sync}} can be installed from the [[Arch User Repository|AUR]]. The package includes [[systemd]] service definitions, which will create default config files automatically if they do not exist when the service starts.<br />
<br />
Alternatively, the bare 'tar.gz' packaged executable is downloadable from the [http://labs.bittorrent.com/experiments/sync.html official website].<br />
<br />
Once installed, enable and initialize the service:<br />
# systemctl enable btsync@user<br />
# systemctl start btsync@user<br />
replacing {{ic|user}} by the desired username. Configuration is located at {{ic|~/.config/btsync/btsync.conf}}, and metadata is saved in {{ic|~/.config/btsync/}} by default.<br />
<br />
If you prefer to run it as the {{ic|btsync}} system user, leave the {{ic|@user}} part out:<br />
# systemctl enable btsync<br />
# systemctl start btsync<br />
Configuration for this user is located at {{ic|/etc/btsync.conf}}, and metadata is saved in {{ic|/var/lib/btsync/}} by default.<br />
<br />
The Linux client of BTSync does not use a typical GUI; it sets up a WebUI server accessible in {{ic|localhost:8888}}, with the default login credentials as the user set in the service starting process, and the password {{ic|password}}.<br />
<br />
== Configuration ==<br />
<br />
The web-server has the built-in configuration settings also available in other platforms.<br />
<br />
For further configuration, the {{ic|~/.config/btsync/btsync.conf}} file contains advanced parameters; for example, the possibility to use a password other than the default one (recommended, of course).</div>Emlunhttps://wiki.archlinux.org/index.php?title=Systemd/Services&diff=265345Systemd/Services2013-07-07T01:16:26Z<p>Emlun: /* BitTorrent Sync */ Change config directory</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the repositories. These files can be copied from other distributions or created by yourself.<br />
<br />
== Change name of wireless interface ==<br />
<br />
For those rare occasions where this is necessary.<br />
<br />
{{hc|/etc/iftab|<br />
wlan* mac ''[mac-address]''<br />
}}<br />
<br />
Replace ''[mac-address]'' with the one corresponding to the networking hardware.<br />
<br />
{{hc|/etc/systemd/system/fix-wireless-interface.service|<nowiki><br />
[Unit]<br />
Description=Changes the wireless interface eth1 to the proper wlan*<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/ifrename -c /etc/iftab<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki><br />
}}<br />
<br />
== dropbear ==<br />
{{hc|/etc/systemd/system/dropbear.service|<br />
<nowiki><br />
[Unit]<br />
Description=Dropbear SSH server<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/dropbear -p 22 -d /etc/dropbear/dropbear_dss_host_key -w -P /var/run/dropbear.pid<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
</nowiki>}}<br />
<br />
== darkhttpd ==<br />
{{hc|/etc/systemd/system/darkhttpd.service|<br />
<nowiki><br />
[Unit]<br />
Description=Darkhttpd Webserver<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/darkhttpd<br />
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_OPTS<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.socket|<br />
<nowiki><br />
[Unit]<br />
Conflicts=darkhttpd.service<br />
<br />
[Socket]<br />
ListenStream=80<br />
Accept=no<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/darkhttpd|<br />
<nowiki><br />
DARKHTTPD_ROOT="/srv/http"<br />
DARKHTTPD_OPTS="--uid nobody --gid nobody --chroot"<br />
</nowiki>}}<br />
<br />
== IPv6 (Hurricane Electric) ==<br />
{{hc|/etc/systemd/system/he-ipv6.service|<nowiki><br />
<br />
[Unit]<br />
Description=he.net IPv6 tunnel<br />
After=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/sbin/ip tunnel add he-ipv6 mode sit remote 209.51.161.14 local <local IPv4> ttl 255<br />
ExecStart=/sbin/ip link set he-ipv6 up mtu 1480<br />
ExecStart=/sbin/ip addr add <local IPv6>/64 dev he-ipv6<br />
ExecStart=/sbin/ip -6 route add ::/0 dev he-ipv6<br />
ExecStop=/sbin/ip -6 route del ::/0 dev he-ipv6<br />
ExecStop=/sbin/ip link set he-ipv6 down<br />
ExecStop=/sbin/ip tunnel del he-ipv6<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Logmein Hamachi ==<br />
{{hc|/etc/systemd/system/logmein-hamachi.service|<nowiki><br />
[Unit]<br />
Description=LogMeIn Hamachi daemon<br />
After=local-fs.target network.target<br />
<br />
[Service]<br />
ExecStart=/opt/logmein-hamachi/bin/hamachid<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Filesystem mounts ==<br />
''See: [[Systemd#Filesystem_mounts]]''<br />
<br />
== screen ==<br />
Autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
== Static Ethernet network ==<br />
<br />
This is a custom service file for static Ethernet configurations.<br />
{{hc|/etc/conf.d/network@enX (where enX is interface name)|<nowiki><br />
address=192.168.0.15<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/network@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-%i.device <br />
After=sys-subsystem-net-devices-%i.device <br />
<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network@%i<br />
ExecStart=/sbin/ip link set dev %i up<br />
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev %i<br />
ExecStart=/bin/sh -c 'test -n ${gateway} && /sbin/ip route add default via ${gateway}'<br />
<br />
ExecStop=/sbin/ip addr flush dev %i<br />
ExecStop=/sbin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
To set static IP on {{ic|1=enp3s0}} interface you will need to create {{ic|1=/etc/conf.d/network@enp3s0}} config file and run:<br />
# systemctl enable network@enp3s0.service<br />
<br />
== Set network interface in promiscuous mode ==<br />
{{hc|/etc/systemd/system/promiscuous@.service|<nowiki><br />
[Unit]<br />
Description=Set %i interface in promiscuous mode<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/ip link set dev %i promisc on<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
If you want to enable promiscuous mode on interface {{ic|1=eth0}} run:<br />
<br />
# systemctl enable promiscuous@eth0.service<br />
<br />
==shellinaboxd==<br />
[http://code.google.com/p/shellinabox/]: "Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator."<br />
{{hc|/etc/systemd/system/shellinabox.service (do not name it shellinaboxd.service if you installed it from AUR) |<nowiki><br />
[Unit]<br />
Description=Serve a login-terminal over http on port 4200.<br />
Required=sshd.service<br />
After=sshd.service<br />
<br />
[Service]<br />
User=root<br />
Type=forking<br />
ExecStart=/usr/bin/shellinaboxd -s/:SSH -b -p 4200 -c /tmp --css=/usr/share/doc/shellinabox/white-on-black.css<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
KillMode=process<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
==tmux==<br />
Starts [[tmux]] for specified user (eg. {{ic|tmux@main-user.service}})<br />
{{hc|/etc/systemd/system/tmux@.service|<nowiki><br />
[Unit]<br />
Description=Start tmux in detached session<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
KillMode=none<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s %u -d<br />
ExecStop=/usr/bin/tmux kill-session -t %u<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== tpfand ==<br />
{{hc|/etc/systemd/system/tpfand.service|<nowiki><br />
[Unit]<br />
Description=ThinkPad Fan Control<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/tpfand.pid<br />
ExecStart=/usr/sbin/tpfand<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== truecrypt volume setup==<br />
This service employ truecrypt as a mapper only and requires you to create an entry in fstab to mount the mapped & unencrypted device to your desired mountpoint like for instance so:<br />
{{hc|/etc/fstab|<nowiki><br />
/dev/mapper/truecrypt1 /home/ ext4 defaults,x-systemd.device-timeout=0 0 2</nowiki>}}<br />
<br />
The {{ic|2}} means your fs will be fscked regularly.<br />
<br />
{{hc|/usr/lib/systemd/system/truecrypt@.service|<nowiki><br />
[Unit]<br />
Description=Truecrypt Setup for %I<br />
DefaultDependencies=no<br />
Conflicts=umount.target<br />
Before=umount.target<br />
After=systemd-readahead-collect.service systemd-readahead-replay.service<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
StandardInput=tty-force<br />
ExecStart=/usr/bin/truecrypt --filesystem=none %I<br />
ExecStop=/usr/bin/truecrypt --filesystem=none -d %I<br />
<br />
[Install]<br />
WantedBy=cryptsetup.target</nowiki>}}<br />
<br />
If your encrypted volume is {{ic|1=/dev/sda2}}, you would enable the service with this command: <br />
# systemctl enable truecrypt@dev-sda2.service<br />
<br />
{{Note|1=If you use mpd or any other programme that needs to access the encrypted filesystem, put it into the line starting with {{ic|1=Before=}}, separated with a space from the first entry.}}<br />
<br />
{{Note|There is an issue possibly arising from this approach: side-by-side compatibility of mounting more than one device in this way. If you have problems mounting more than one device during startup (e.g. with the two password prompts interfering) and/or want to avoid entering multiple passwords, you could consider securing the second and further devices by a keyfile located on the first encrypted device.}}<br />
<br />
{{Note|1=Although it works, there might be better solutions to use truecrypt with systemd: This way of doing it (specifically the use of {{ic|1=tty-force}}) is not recommended according to [http://lists.freedesktop.org/archives/systemd-devel/2012-October/006905.html this thread], which suggests an alternative approach similar to that taken for LUKS. Another possibility might be [[tcplay]].}}<br />
<br />
== truecrypt (mount encrypted fs) ==<br />
{{hc|/etc/systemd/system/multi-user.target/truecrypt-mount.service|<nowiki><br />
[Unit]<br />
Description=Mount Truecrypt-encrypted filesystems<br />
ConditionFileIsExecutable=/usr/bin/truecrypt<br />
#Requires=truecrypt-unmount.service<br />
#Before=mpd.service<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/truecrypt -t /dev/sdXY /MOUNTPOINT<br />
StandardInput=tty-force<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
#Also=truecrypt-unmount.service<br />
</nowiki>}}<br />
<br />
{{Note|1=Gleaned from [https://bbs.archlinux.org/viewtopic.php?pid=1163760#p1163760 bpont on the forums]. If you use mpd and have your music dir in {{ic|~/}}, uncomment {{ic|1=Before=mpd.service}}, which takes care that mpd is started after this script. If you also use {{ic|1=truecrypt-unmount.service}} (see next service) uncomment the {{ic|1=Requires=truecrypt-unmount.service}} and {{ic|1=Also=truecrypt-unmount.service}} so it gets installed and activated by systemd automatically when using this script.}}<br />
<br />
== truecrypt (unmount encrypted fs) ==<br />
{{hc|/etc/systemd/system/multi-user/truecrypt-unmount.service|<nowiki><br />
[Unit]<br />
Description=Truecrypt unmount on shutdown, poweroff, reboot, system halt<br />
Before=local-fs-pre.target<br />
#Before=mpd.service<br />
ConditionPathExistsGlob=/media/truecrypt*<br />
DefaultDependencies=no<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/truecrypt -d<br />
TimeoutSec=5<br />
StandardInput=tty<br />
<br />
[Install]<br />
WantedBy=shutdown.target reboot.target halt.target poweroff.target<br />
</nowiki>}}<br />
<br />
{{Note|1=I don't know if this works yet. It may be necessary to replace {{ic|1=TimeoutSec=5}} with {{ic|1=ExecStart=sleep 5}}. If you use {{ic|mpd}}, make sure to uncomment {{ic|1=Before=mpd.service}} to make sure this service is executed after mpd is closed down (different order during the shutdown of processes than during start up!). Script gleaned from [https://bbs.archlinux.org/viewtopic.php?pid=1163334#p1163334 tladuke on the forums].}}<br />
<br />
== MPD Socket Activation ==<br />
If the following mpd.socket file is enabled while mpd.service (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start mpd.service and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} ''AND'' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for more details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
{{hc|/usr/lib/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
== VideoLAN 2.0 ==<br />
Change the '''User''' parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|2=<br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User='''nobody'''<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
== Xvfb ==<br />
Change the '''User'''/'''Group''' parameters:<br />
{{hc|/etc/systemd/system/xinit.service|2=<br />
[Unit]<br />
Description=xinit with xvfb<br />
After=network.target<br />
<br />
[Service]<br />
User='''bitlbee'''<br />
Group='''bitlbee'''<br />
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
== Nexus ==<br />
This is for Sonatype's Nexus OSS Artifact Repository.<br />
{{AUR|nexus}} is in the [[AUR]].<br />
<br />
{{hc|/etc/systemd/system/nexus.service|<nowiki><br />
[Unit]<br />
Description=Nexus OSS Artifact Repository<br />
<br />
[Service]<br />
Type=forking<br />
EnvironmentFile=-/etc/conf.d/nexus<br />
ExecStart=/opt/nexus/bin/nexus start<br />
ExecStop=/opt/nexus/bin/nexus stop<br />
ExecReload=/opt/nexus/bin/nexus restart<br />
PIDFile=/opt/nexus/run/nexus.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Gitlab ==<br />
<br />
{{hc|/etc/systemd/system/gitlab.service|<nowiki><br />
[Unit]<br />
Description=Self Hosted Git Management<br />
Requires=postgresql.service redis.service<br />
After=postgresql.service redis.service<br />
Wants=postfix.service gitlab-worker.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/home/gitlab/gitlab/script/rails server -d -e production<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/server.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/gitlab-worker.service|<nowiki><br />
[Unit]<br />
Description=Gitlab Resque Worker<br />
Requires=redis.service<br />
After=redis.service<br />
Wants=postfix.service postgresql.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/bin/bash -c '. ~/.bashrc; . ./resque.sh'<br />
ExecStopPost=/usr/bin/rm /home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
</nowiki>}}<br />
<br />
== Cisco AnyConnect VPN ==<br />
<br />
{{hc|/etc/systemd/system/ciscovpn.service|<nowiki><br />
[Unit]<br />
Description=Cisco AnyConnect Secure Mobility Client Agent<br />
Requires=network.target remote-fs.target<br />
After=network.target remote-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/vpnagentd.pid<br />
ExecStart=/opt/cisco/anyconnect/bin/vpnagentd<br />
ExecStop=/usr/bin/killall /opt/cisco/anyconnect/bin/vpnagentd<br />
Restart=on-abort<br />
<br />
[Install]<br />
# one may want to use multi-user.target instead<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== Emacs Daemon ==<br />
{{hc|/etc/systemd/system/emacs@.service|<nowiki><br />
[Unit]<br />
Description=Emacs: the extensible, self-documenting text editor<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/emacs --daemon --chdir %h<br />
ExecStop=/usr/bin/emacsclient --eval "(progn (setq kill-emacs-hook 'nil) (kill-emacs))"<br />
Restart=always<br />
User=%i<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
Then, to enable the unit for your user:<br />
<br />
# systemctl enable emacs@<username><br />
# systemctl start emacs@<username><br />
<br />
Source: [http://www.emacswiki.org/emacs/EmacsAsDaemon#toc8 EmacsWiki].<br />
<br />
== Monkey http server deamon ==<br />
{{hc|/etc/systemd/system/monkey.service|2=<br />
[Unit]<br />
Description=Monkey http server deamon<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/monkey -D<br />
ExecStop=/bin/kill $MAINPID<br />
ExecReload=/bin/kill $MAINPID; /usr/bin/monkey -D<br />
PIDFile='''/var/log/monkey/monkey.pid'''<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
{{Note|1=The '''PIDFile''' entry should point to pidfile location specified in your monkey config file. The configured port number should be appended to the filename}}<br />
<br />
== VirtualBox virtual machines ==<br />
<br />
{{hc|/etc/systemd/system/vboxvmservice@.service|<nowiki><br />
[Unit]<br />
Description=VBox Virtual Machine %i Service<br />
Requires=systemd-modules-load.service<br />
After=systemd-modules-load.service<br />
<br />
[Service]<br />
User='''user'''<br />
Group=vboxusers<br />
ExecStart=/usr/bin/VBoxHeadless -s %i<br />
ExecStop=/usr/bin/VBoxManage controlvm %i savestate<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Note|Each virtual machine has its own service. Replace '''user''' with a user that is a member of the '''vboxusers''' group:<br />
# systemctl enable vboxvmservice@<vm name><br />
# systemctl start vboxvmservice@<vm name><br />
}}<br />
{{Note|1= Make sure that the '''user''' field is filled in with the same user you're creating/importing virtual machines, else the user won't see them}}<br />
{{Note|1=As of VirtualBox 4.2 there is another way to get virtual machines going: http://lifeofageekadmin.com/how-to-set-your-virtualbox-vm-to-automatically-startup/. Please edit the [[VirtualBox]] page if you figure it out.}}<br />
<br />
== redmine ==<br />
{{hc|/etc/systemd/system/redmine.service|<nowiki><br />
[Unit]<br />
Description=Redmine server<br />
After=syslog.target<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
User=redmine2<br />
Group=redmine2<br />
Environment=GEM_HOME=/home/redmine2/.gem/<br />
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production<br />
<br />
# Give a reasonable amount of time for the server to start up/shut down<br />
TimeoutSec=300<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== spoof mac address (netctl) ==<br />
{{hc|/etc/systemd/system/macspoof@.service|2=<br />
[Unit]<br />
Description=spoof mac address<br />
Before=netctl@%i.service<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/ip link set dev ''[adapter]'' address ''[mac-address]''<br />
<br />
[Install]<br />
WantedBy=network.target<br />
}}<br />
<br />
Replace ''[adapter]'' by your WLAN adapter name (e.g. {{ic|wlp3s0}}) and ''[mac-address]'' by the mac-address you want (e.g. {{ic|36:aa:88:c8:75:3a}}).<br />
<br />
== Turn off the automatic screensaver ==<br />
Arch Linux has a 10 minute screensaver set as standard. XBMC for CuBox does not disable this when watching movies, and this is a rather hackish workaround. Tested on the [http://archlinuxarm.org/platforms/armv7/cubox CuBox]. <br />
{{hc|/etc/systemd/system/screensaveroff.service|<nowiki><br />
[Unit]<br />
Description=Disables the screensaver in X<br />
After=graphical.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/xset s off -d :0<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
<br />
</nowiki>}}<br />
<br />
== slock ==<br />
<br />
Locks the system with the help of {{Pkg|slock}}. Very handy when closing the laptop lid for example.<br />
<br />
{{hc|/etc/systemd/system/screenlock.service|<nowiki><br />
[Unit]<br />
Description=Lock X session using slock<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/slock<br />
<br />
[Install]<br />
WantedBy=sleep.target<br />
<br />
</nowiki>}}<br />
<br />
== VDE2 interface ==<br />
<br />
Create and activate an vde2 tap interface for use in the kvm user group.<br />
<br />
{{hc|/etc/systemd/system/vde2@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/vde_switch -tap %i -daemon -mod 660 -group kvm<br />
ExecStart=/sbin/ip link set dev %i up<br />
ExecStop=/sbin/ip addr flush dev %i<br />
ExecStop=/sbin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
</nowiki>}}<br />
<br />
== BitTorrent Sync ==<br />
<br />
Run BitTorrent Sync as user {{ic|username}}:<br />
<br />
{{bc|<nowiki><br />
# systemctl start btsync@username<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/btsync@.service|<nowiki><br />
[Unit]<br />
Description=BitTorrent Sync application<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/btsync --config /home/%i/.config/btsync/btsync.config<br />
PIDFile=/home/%i/.config/btsync/btsync.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
</nowiki>}}<br />
<br />
This assumes existence of the following files:<br />
<br />
* {{ic|/usr/bin/btsync}} - the {{ic|btsync}} executable or a symlink pointing to it<br />
* {{ic|/home/username/.config/btsync/btsync.config}} - the user's config file. Consult the [http://labs.bittorrent.com/experiments/sync/get-started.html#config-file official instructions] for creating one.<br />
* {{ic|/home/username/.config/btsync/btsync.pid}} - BitTorrent Sync creates {{ic|$SYNC_HOME/sync.pid}} automatically, where {{ic|$SYNC_HOME}} is specified by {{ic|"storage_path"}} in the config file. Either point {{ic|PIDFile}} to it, or symlink this file to it.<br />
<br />
== See also ==<br />
<br />
* [[Pacman_Tips#Backing_up_Local_database_with_Systemd|Backing up Local Pacman database with Systemd]]<br />
* [[systemd]]<br />
* [http://wiki.gentoo.org/wiki/Systemd systemd at gentoo wiki]</div>Emlunhttps://wiki.archlinux.org/index.php?title=Systemd/Services&diff=265202Systemd/Services2013-07-05T20:21:46Z<p>Emlun: Add service file for BitTorrent Sync</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the repositories. These files can be copied from other distributions or created by yourself.<br />
<br />
== Change name of wireless interface ==<br />
<br />
For those rare occasions where this is necessary.<br />
<br />
{{hc|/etc/iftab|<br />
wlan* mac ''[mac-address]''<br />
}}<br />
<br />
Replace ''[mac-address]'' with the one corresponding to the networking hardware.<br />
<br />
{{hc|/etc/systemd/system/fix-wireless-interface.service|<nowiki><br />
[Unit]<br />
Description=Changes the wireless interface eth1 to the proper wlan*<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/ifrename -c /etc/iftab<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki><br />
}}<br />
<br />
== dropbear ==<br />
{{hc|/etc/systemd/system/dropbear.service|<br />
<nowiki><br />
[Unit]<br />
Description=Dropbear SSH server<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/dropbear -p 22 -d /etc/dropbear/dropbear_dss_host_key -w -P /var/run/dropbear.pid<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
</nowiki>}}<br />
<br />
== darkhttpd ==<br />
{{hc|/etc/systemd/system/darkhttpd.service|<br />
<nowiki><br />
[Unit]<br />
Description=Darkhttpd Webserver<br />
<br />
[Service]<br />
EnvironmentFile=/etc/conf.d/darkhttpd<br />
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT --daemon $DARKHTTPD_OPTS<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/darkhttpd.socket|<br />
<nowiki><br />
[Unit]<br />
Conflicts=darkhttpd.service<br />
<br />
[Socket]<br />
ListenStream=80<br />
Accept=no<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/conf.d/darkhttpd|<br />
<nowiki><br />
DARKHTTPD_ROOT="/srv/http"<br />
DARKHTTPD_OPTS="--uid nobody --gid nobody --chroot"<br />
</nowiki>}}<br />
<br />
== IPv6 (Hurricane Electric) ==<br />
{{hc|/etc/systemd/system/he-ipv6.service|<nowiki><br />
<br />
[Unit]<br />
Description=he.net IPv6 tunnel<br />
After=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/sbin/ip tunnel add he-ipv6 mode sit remote 209.51.161.14 local <local IPv4> ttl 255<br />
ExecStart=/sbin/ip link set he-ipv6 up mtu 1480<br />
ExecStart=/sbin/ip addr add <local IPv6>/64 dev he-ipv6<br />
ExecStart=/sbin/ip -6 route add ::/0 dev he-ipv6<br />
ExecStop=/sbin/ip -6 route del ::/0 dev he-ipv6<br />
ExecStop=/sbin/ip link set he-ipv6 down<br />
ExecStop=/sbin/ip tunnel del he-ipv6<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Logmein Hamachi ==<br />
{{hc|/etc/systemd/system/logmein-hamachi.service|<nowiki><br />
[Unit]<br />
Description=LogMeIn Hamachi daemon<br />
After=local-fs.target network.target<br />
<br />
[Service]<br />
ExecStart=/opt/logmein-hamachi/bin/hamachid<br />
Type=forking<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Filesystem mounts ==<br />
''See: [[Systemd#Filesystem_mounts]]''<br />
<br />
== screen ==<br />
Autostarts screen for the specified user (e.g. {{ic|systemctl enable screen@florian}}).<br />
{{hc|/etc/systemd/system/screen@.service|<nowiki><br />
[Unit]<br />
Description=screen<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/screen -dmS autoscreen<br />
ExecStop=/usr/bin/screen -S autoscreen -X quit<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
== Static Ethernet network ==<br />
<br />
This is a custom service file for static Ethernet configurations.<br />
{{hc|/etc/conf.d/network@enX (where enX is interface name)|<nowiki><br />
address=192.168.0.15<br />
netmask=24<br />
broadcast=192.168.0.255<br />
gateway=192.168.0.1</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/network@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
BindsTo=sys-subsystem-net-devices-%i.device <br />
After=sys-subsystem-net-devices-%i.device <br />
<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
EnvironmentFile=/etc/conf.d/network@%i<br />
ExecStart=/sbin/ip link set dev %i up<br />
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev %i<br />
ExecStart=/bin/sh -c 'test -n ${gateway} && /sbin/ip route add default via ${gateway}'<br />
<br />
ExecStop=/sbin/ip addr flush dev %i<br />
ExecStop=/sbin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target</nowiki>}}<br />
<br />
To set static IP on {{ic|1=enp3s0}} interface you will need to create {{ic|1=/etc/conf.d/network@enp3s0}} config file and run:<br />
# systemctl enable network@enp3s0.service<br />
<br />
== Set network interface in promiscuous mode ==<br />
{{hc|/etc/systemd/system/promiscuous@.service|<nowiki><br />
[Unit]<br />
Description=Set %i interface in promiscuous mode<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/ip link set dev %i promisc on<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
If you want to enable promiscuous mode on interface {{ic|1=eth0}} run:<br />
<br />
# systemctl enable promiscuous@eth0.service<br />
<br />
==shellinaboxd==<br />
[http://code.google.com/p/shellinabox/]: "Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator."<br />
{{hc|/etc/systemd/system/shellinabox.service (do not name it shellinaboxd.service if you installed it from AUR) |<nowiki><br />
[Unit]<br />
Description=Serve a login-terminal over http on port 4200.<br />
Required=sshd.service<br />
After=sshd.service<br />
<br />
[Service]<br />
User=root<br />
Type=forking<br />
ExecStart=/usr/bin/shellinaboxd -s/:SSH -b -p 4200 -c /tmp --css=/usr/share/doc/shellinabox/white-on-black.css<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
KillMode=process<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
==tmux==<br />
Starts [[tmux]] for specified user (eg. {{ic|tmux@main-user.service}})<br />
{{hc|/etc/systemd/system/tmux@.service|<nowiki><br />
[Unit]<br />
Description=Start tmux in detached session<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
KillMode=none<br />
User=%I<br />
ExecStart=/usr/bin/tmux new-session -s %u -d<br />
ExecStop=/usr/bin/tmux kill-session -t %u<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== tpfand ==<br />
{{hc|/etc/systemd/system/tpfand.service|<nowiki><br />
[Unit]<br />
Description=ThinkPad Fan Control<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/tpfand.pid<br />
ExecStart=/usr/sbin/tpfand<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== truecrypt volume setup==<br />
This service employ truecrypt as a mapper only and requires you to create an entry in fstab to mount the mapped & unencrypted device to your desired mountpoint like for instance so:<br />
{{hc|/etc/fstab|<nowiki><br />
/dev/mapper/truecrypt1 /home/ ext4 defaults,x-systemd.device-timeout=0 0 2</nowiki>}}<br />
<br />
The {{ic|2}} means your fs will be fscked regularly.<br />
<br />
{{hc|/usr/lib/systemd/system/truecrypt@.service|<nowiki><br />
[Unit]<br />
Description=Truecrypt Setup for %I<br />
DefaultDependencies=no<br />
Conflicts=umount.target<br />
Before=umount.target<br />
After=systemd-readahead-collect.service systemd-readahead-replay.service<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
StandardInput=tty-force<br />
ExecStart=/usr/bin/truecrypt --filesystem=none %I<br />
ExecStop=/usr/bin/truecrypt --filesystem=none -d %I<br />
<br />
[Install]<br />
WantedBy=cryptsetup.target</nowiki>}}<br />
<br />
If your encrypted volume is {{ic|1=/dev/sda2}}, you would enable the service with this command: <br />
# systemctl enable truecrypt@dev-sda2.service<br />
<br />
{{Note|1=If you use mpd or any other programme that needs to access the encrypted filesystem, put it into the line starting with {{ic|1=Before=}}, separated with a space from the first entry.}}<br />
<br />
{{Note|There is an issue possibly arising from this approach: side-by-side compatibility of mounting more than one device in this way. If you have problems mounting more than one device during startup (e.g. with the two password prompts interfering) and/or want to avoid entering multiple passwords, you could consider securing the second and further devices by a keyfile located on the first encrypted device.}}<br />
<br />
{{Note|1=Although it works, there might be better solutions to use truecrypt with systemd: This way of doing it (specifically the use of {{ic|1=tty-force}}) is not recommended according to [http://lists.freedesktop.org/archives/systemd-devel/2012-October/006905.html this thread], which suggests an alternative approach similar to that taken for LUKS. Another possibility might be [[tcplay]].}}<br />
<br />
== truecrypt (mount encrypted fs) ==<br />
{{hc|/etc/systemd/system/multi-user.target/truecrypt-mount.service|<nowiki><br />
[Unit]<br />
Description=Mount Truecrypt-encrypted filesystems<br />
ConditionFileIsExecutable=/usr/bin/truecrypt<br />
#Requires=truecrypt-unmount.service<br />
#Before=mpd.service<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/truecrypt -t /dev/sdXY /MOUNTPOINT<br />
StandardInput=tty-force<br />
RemainAfterExit=yes<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
#Also=truecrypt-unmount.service<br />
</nowiki>}}<br />
<br />
{{Note|1=Gleaned from [https://bbs.archlinux.org/viewtopic.php?pid=1163760#p1163760 bpont on the forums]. If you use mpd and have your music dir in {{ic|~/}}, uncomment {{ic|1=Before=mpd.service}}, which takes care that mpd is started after this script. If you also use {{ic|1=truecrypt-unmount.service}} (see next service) uncomment the {{ic|1=Requires=truecrypt-unmount.service}} and {{ic|1=Also=truecrypt-unmount.service}} so it gets installed and activated by systemd automatically when using this script.}}<br />
<br />
== truecrypt (unmount encrypted fs) ==<br />
{{hc|/etc/systemd/system/multi-user/truecrypt-unmount.service|<nowiki><br />
[Unit]<br />
Description=Truecrypt unmount on shutdown, poweroff, reboot, system halt<br />
Before=local-fs-pre.target<br />
#Before=mpd.service<br />
ConditionPathExistsGlob=/media/truecrypt*<br />
DefaultDependencies=no<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/bin/truecrypt -d<br />
TimeoutSec=5<br />
StandardInput=tty<br />
<br />
[Install]<br />
WantedBy=shutdown.target reboot.target halt.target poweroff.target<br />
</nowiki>}}<br />
<br />
{{Note|1=I don't know if this works yet. It may be necessary to replace {{ic|1=TimeoutSec=5}} with {{ic|1=ExecStart=sleep 5}}. If you use {{ic|mpd}}, make sure to uncomment {{ic|1=Before=mpd.service}} to make sure this service is executed after mpd is closed down (different order during the shutdown of processes than during start up!). Script gleaned from [https://bbs.archlinux.org/viewtopic.php?pid=1163334#p1163334 tladuke on the forums].}}<br />
<br />
== MPD Socket Activation ==<br />
If the following mpd.socket file is enabled while mpd.service (provided by {{Pkg|mpd}}) is disabled, systemd will not start mpd immediately, but it will listen on the appropriate sockets. When an mpd client attempts to connect on one of those sockets, systemd will start mpd.service and transparently hand over control of those ports to the mpd process.<br />
<br />
If you prefer to listen on different UNIX sockets or network ports (even multiple sockets of each type), or if you prefer not to listen on network ports at all, you should add/edit/remove the appropriate {{ic|1="ListenStream="}} lines in the {{ic|[Socket]}} section of {{ic|mpd.socket}} ''AND'' modify the appropriate lines {{ic|/etc/mpd.conf}} (see {{ic|man 5 mpd.conf}} for more details).<br />
<br />
If you use different (even multiple) network or local sockets, or prefer not to use network sockets at all, simply add, change, or remove lines beginning with {{ic|1="ListenStream="}} in the {{ic|[Socket]}} section.<br />
{{hc|/usr/lib/systemd/system/mpd.socket|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon Sockets<br />
<br />
[Socket]<br />
ListenStream=/var/run/mpd/socket<br />
ListenStream=6600<br />
<br />
[Install]<br />
WantedBy=sockets.target<br />
</nowiki>}}<br />
<br />
== VideoLAN 2.0 ==<br />
Change the '''User''' parameter.<br />
<br />
{{hc|/etc/systemd/system/vlc.service|2=<br />
[Unit]<br />
Description=VideoOnLAN Service<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
User='''nobody'''<br />
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090<br />
Restart=on-abort<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
== Xvfb ==<br />
Change the '''User'''/'''Group''' parameters:<br />
{{hc|/etc/systemd/system/xinit.service|2=<br />
[Unit]<br />
Description=xinit with xvfb<br />
After=network.target<br />
<br />
[Service]<br />
User='''bitlbee'''<br />
Group='''bitlbee'''<br />
ExecStart=/usr/bin/xvfb-run bash %h/.xinitrc<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
== Nexus ==<br />
This is for Sonatype's Nexus OSS Artifact Repository.<br />
{{AUR|nexus}} is in the [[AUR]].<br />
<br />
{{hc|/etc/systemd/system/nexus.service|<nowiki><br />
[Unit]<br />
Description=Nexus OSS Artifact Repository<br />
<br />
[Service]<br />
Type=forking<br />
EnvironmentFile=-/etc/conf.d/nexus<br />
ExecStart=/opt/nexus/bin/nexus start<br />
ExecStop=/opt/nexus/bin/nexus stop<br />
ExecReload=/opt/nexus/bin/nexus restart<br />
PIDFile=/opt/nexus/run/nexus.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Gitlab ==<br />
<br />
{{hc|/etc/systemd/system/gitlab.service|<nowiki><br />
[Unit]<br />
Description=Self Hosted Git Management<br />
Requires=postgresql.service redis.service<br />
After=postgresql.service redis.service<br />
Wants=postfix.service gitlab-worker.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/home/gitlab/gitlab/script/rails server -d -e production<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/server.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/gitlab-worker.service|<nowiki><br />
[Unit]<br />
Description=Gitlab Resque Worker<br />
Requires=redis.service<br />
After=redis.service<br />
Wants=postfix.service postgresql.service<br />
<br />
[Service]<br />
Type=forking<br />
User=gitlab<br />
WorkingDirectory=/home/gitlab/gitlab<br />
ExecStart=/bin/bash -c '. ~/.bashrc; . ./resque.sh'<br />
ExecStopPost=/usr/bin/rm /home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid<br />
</nowiki>}}<br />
<br />
== Cisco AnyConnect VPN ==<br />
<br />
{{hc|/etc/systemd/system/ciscovpn.service|<nowiki><br />
[Unit]<br />
Description=Cisco AnyConnect Secure Mobility Client Agent<br />
Requires=network.target remote-fs.target<br />
After=network.target remote-fs.target<br />
<br />
[Service]<br />
Type=forking<br />
PIDFile=/var/run/vpnagentd.pid<br />
ExecStart=/opt/cisco/anyconnect/bin/vpnagentd<br />
ExecStop=/usr/bin/killall /opt/cisco/anyconnect/bin/vpnagentd<br />
Restart=on-abort<br />
<br />
[Install]<br />
# one may want to use multi-user.target instead<br />
WantedBy=graphical.target<br />
</nowiki>}}<br />
<br />
== Emacs Daemon ==<br />
{{hc|/etc/systemd/system/emacs@.service|<nowiki><br />
[Unit]<br />
Description=Emacs: the extensible, self-documenting text editor<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/emacs --daemon --chdir %h<br />
ExecStop=/usr/bin/emacsclient --eval "(progn (setq kill-emacs-hook 'nil) (kill-emacs))"<br />
Restart=always<br />
User=%i<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
Then, to enable the unit for your user:<br />
<br />
# systemctl enable emacs@<username><br />
# systemctl start emacs@<username><br />
<br />
Source: [http://www.emacswiki.org/emacs/EmacsAsDaemon#toc8 EmacsWiki].<br />
<br />
== Monkey http server deamon ==<br />
{{hc|/etc/systemd/system/monkey.service|2=<br />
[Unit]<br />
Description=Monkey http server deamon<br />
After=network.target<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/monkey -D<br />
ExecStop=/bin/kill $MAINPID<br />
ExecReload=/bin/kill $MAINPID; /usr/bin/monkey -D<br />
PIDFile='''/var/log/monkey/monkey.pid'''<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
}}<br />
<br />
{{Note|1=The '''PIDFile''' entry should point to pidfile location specified in your monkey config file. The configured port number should be appended to the filename}}<br />
<br />
== VirtualBox virtual machines ==<br />
<br />
{{hc|/etc/systemd/system/vboxvmservice@.service|<nowiki><br />
[Unit]<br />
Description=VBox Virtual Machine %i Service<br />
Requires=systemd-modules-load.service<br />
After=systemd-modules-load.service<br />
<br />
[Service]<br />
User='''user'''<br />
Group=vboxusers<br />
ExecStart=/usr/bin/VBoxHeadless -s %i<br />
ExecStop=/usr/bin/VBoxManage controlvm %i savestate<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
{{Note|Each virtual machine has its own service. Replace '''user''' with a user that is a member of the '''vboxusers''' group:<br />
# systemctl enable vboxvmservice@<vm name><br />
# systemctl start vboxvmservice@<vm name><br />
}}<br />
{{Note|1= Make sure that the '''user''' field is filled in with the same user you're creating/importing virtual machines, else the user won't see them}}<br />
{{Note|1=As of VirtualBox 4.2 there is another way to get virtual machines going: http://lifeofageekadmin.com/how-to-set-your-virtualbox-vm-to-automatically-startup/. Please edit the [[VirtualBox]] page if you figure it out.}}<br />
<br />
== redmine ==<br />
{{hc|/etc/systemd/system/redmine.service|<nowiki><br />
[Unit]<br />
Description=Redmine server<br />
After=syslog.target<br />
After=network.target<br />
<br />
[Service]<br />
Type=simple<br />
User=redmine2<br />
Group=redmine2<br />
Environment=GEM_HOME=/home/redmine2/.gem/<br />
ExecStart=/usr/bin/ruby /usr/share/webapps/redmine/script/rails server webrick -e production<br />
<br />
# Give a reasonable amount of time for the server to start up/shut down<br />
TimeoutSec=300<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== spoof mac address (netctl) ==<br />
{{hc|/etc/systemd/system/macspoof@.service|2=<br />
[Unit]<br />
Description=spoof mac address<br />
Before=netctl@%i.service<br />
<br />
[Service]<br />
Type=oneshot<br />
ExecStart=/usr/sbin/ip link set dev ''[adapter]'' address ''[mac-address]''<br />
<br />
[Install]<br />
WantedBy=network.target<br />
}}<br />
<br />
Replace ''[adapter]'' by your WLAN adapter name (e.g. {{ic|wlp3s0}}) and ''[mac-address]'' by the mac-address you want (e.g. {{ic|36:aa:88:c8:75:3a}}).<br />
<br />
== Turn off the automatic screensaver ==<br />
Arch Linux has a 10 minute screensaver set as standard. XBMC for CuBox does not disable this when watching movies, and this is a rather hackish workaround. Tested on the [http://archlinuxarm.org/platforms/armv7/cubox CuBox]. <br />
{{hc|/etc/systemd/system/screensaveroff.service|<nowiki><br />
[Unit]<br />
Description=Disables the screensaver in X<br />
After=graphical.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/xset s off -d :0<br />
<br />
[Install]<br />
WantedBy=graphical.target<br />
<br />
</nowiki>}}<br />
<br />
== slock ==<br />
<br />
Locks the system with the help of {{Pkg|slock}}. Very handy when closing the laptop lid for example.<br />
<br />
{{hc|/etc/systemd/system/screenlock.service|<nowiki><br />
[Unit]<br />
Description=Lock X session using slock<br />
Before=sleep.target<br />
<br />
[Service]<br />
User=<username><br />
Environment=DISPLAY=:0<br />
ExecStart=/usr/bin/slock<br />
<br />
[Install]<br />
WantedBy=sleep.target<br />
<br />
</nowiki>}}<br />
<br />
== VDE2 interface ==<br />
<br />
Create and activate an vde2 tap interface for use in the kvm user group.<br />
<br />
{{hc|/etc/systemd/system/vde2@.service|<nowiki><br />
[Unit]<br />
Description=Network Connectivity for %i<br />
Wants=network.target<br />
Before=network.target<br />
<br />
[Service]<br />
Type=oneshot<br />
RemainAfterExit=yes<br />
ExecStart=/usr/bin/vde_switch -tap %i -daemon -mod 660 -group kvm<br />
ExecStart=/sbin/ip link set dev %i up<br />
ExecStop=/sbin/ip addr flush dev %i<br />
ExecStop=/sbin/ip link set dev %i down<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
</nowiki>}}<br />
<br />
== BitTorrent Sync ==<br />
<br />
Run BitTorrent Sync as user {{ic|username}}:<br />
<br />
{{bc|<nowiki><br />
# systemctl start btsync@username<br />
</nowiki>}}<br />
<br />
{{hc|/etc/systemd/system/btsync@.service|<nowiki><br />
[Unit]<br />
Description=BitTorrent Sync application<br />
<br />
[Service]<br />
Type=forking<br />
User=%i<br />
ExecStart=/usr/bin/btsync --config /home/%i/.btsync/btsync.config<br />
PIDFile=/home/%i/.btsync/btsync.pid<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
<br />
</nowiki>}}<br />
<br />
This assumes existence of the following files:<br />
<br />
* {{ic|/usr/bin/btsync}} - the {ic|btsync}} executable or a symlink pointing to it<br />
* {{ic|/home/username/.btsync/btsync.config}} - the user's config file. Consult the [http://labs.bittorrent.com/experiments/sync/get-started.html#config-file official instructions] for creating one.<br />
* {{ic|/home/username/.btsync/btsync.pid}} - BitTorrent Sync creates {{ic|$SYNC_HOME/sync.pid}} automatically, where {{ic|$SYNC_HOME}} is specified by {{ic|"storage_path"}} in the config file. Either point {{ic|PIDFile}} to it, or symlink this file to it.<br />
<br />
<br />
== See also ==<br />
<br />
* [[Pacman_Tips#Backing_up_Local_database_with_Systemd|Backing up Local Pacman database with Systemd]]<br />
* [[systemd]]<br />
* [http://wiki.gentoo.org/wiki/Systemd systemd at gentoo wiki]</div>Emlun