https://wiki.archlinux.org/api.php?action=feedcontributions&user=GenkiSky&feedformat=atomArchWiki - User contributions [en]2024-03-29T09:22:15ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=User:GenkiSky&diff=602528User:GenkiSky2020-03-25T10:03:43Z<p>GenkiSky: </p>
<hr />
<div>This account is henceforth disowned.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=User:GenkiSky&diff=602527User:GenkiSky2020-03-25T10:03:01Z<p>GenkiSky: Blanked the page</p>
<hr />
<div></div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=FAT&diff=575931FAT2019-06-19T10:45:39Z<p>GenkiSky: /* Writing to FAT32 as normal user */ Fix link to man-page (see previous edit)</p>
<hr />
<div>[[Category:File systems]]<br />
[[es:FAT]]<br />
[[ja:FAT]]<br />
[[ru:FAT]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related articles end}}<br />
{{Expansion|Needs more information.|section=Needed information}}<br />
<br />
From [[Wikipedia:File Allocation Table]]:<br />
<br />
:File Allocation Table (FAT) is a computer file system architecture and a family of industry-standard file systems utilizing it. The FAT file system is a legacy file system which is simple and robust. It offers good performance even in light-weight implementations, but cannot deliver the same performance, reliability and scalability as some modern file systems. It is, however, supported for compatibility reasons by nearly all currently developed operating systems for personal computers and many mobile devices and embedded systems, and thus is a well-suited format for data exchange between computers and devices of almost any type and age from 1981 up to the present.<br />
<br />
== File system creation ==<br />
<br />
To create a FAT filesystem, [[install]] {{Pkg|dosfstools}}.<br />
<br />
{{ic|mkfs.fat}} supports creating FAT12, FAT16 and FAT32, see [[Wikipedia:File Allocation Table#Types]] for an explanation on their differences. {{ic|mkfs.fat}} will select the FAT type based on the partition size, to explicitly create a certain type of FAT filesystem use the {{ic|-F}} option. See {{man|8|mkfs.fat}} for more information.<br />
<br />
{{Tip|For most situations you will want to use FAT32.}}<br />
<br />
Format a partition to FAT32:<br />
<br />
# mkfs.fat -F 32 /dev/''partition''<br />
<br />
{{Note|{{ic|mkfs.vfat}} is a symlink to {{ic|mkfs.fat}}, they are the same utility.}}<br />
<br />
== Kernel configuration ==<br />
<br />
Here is an example of the default ''mount'' configuration in the kernel:<br />
<br />
{{hc|$ zgrep -e FAT -e DOS /proc/config.gz {{!}} sort -r|2=<br />
# DOS/FAT/NT Filesystems<br />
CONFIG_FAT_FS=m<br />
CONFIG_MSDOS_PARTITION=y<br />
CONFIG_FAT_FS=m<br />
CONFIG_MSDOS_FS=m<br />
CONFIG_VFAT_FS=m<br />
CONFIG_FAT_DEFAULT_CODEPAGE=437<br />
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"<br />
CONFIG_NCPFS_SMALLDOS=y<br />
}}<br />
<br />
A short description of the options:<br />
<br />
* Language settings: {{ic|CONFIG_FAT_DEFAULT_CODEPAGE}}, {{ic|CONFIG_FAT_DEFAULT_IOCHARSET}}<br />
* All filenames to lower letters on a FAT partitions if enabled: {{ic|CONFIG_NCPFS_SMALLDOS}}<br />
* Enables support of the FAT file systems: {{ic|CONFIG_FAT_FS}}, {{ic|CONFIG_MSDOS_FS}}, {{ic|CONFIG_VFAT_FS}}<br />
* Enables support of a FAT partitioned harddisks on 86x PCs: {{ic|CONFIG_MSDOS_PARTITION}}<br />
<br />
If the partition type detected by mount is VFAT then it will run the {{ic|/usr/bin/mount.vfat}} script.<br />
<br />
{{hc|/usr/bin/mount.vfat|2= <br />
#!/bin/bash<br />
#mount VFAT with full rw (read-write) permissions for all users<br />
#/usr/bin/mount -i -t vfat -oumask=0000,iocharset=utf8 "$@"<br />
#The above is the same as<br />
mount -i -t vfat -oiocharset=utf8,fmask=0000,dmask=0000 "$@"<br />
}}<br />
<br />
== Writing to FAT32 as normal user ==<br />
<br />
To write on a FAT32 partition, you must make a few changes to the [[fstab]] file.<br />
<br />
{{hc|/etc/fstab|2=<br />
/dev/sd''xY'' /mnt/some_folder vfat '''user''',rw<br />
}}<br />
<br />
The {{ic|user}} option means that any user (even non-root) can mount and unmount the partition {{ic|/dev/sd''X''}}. {{ic|rw}} gives read-write access.<br />
<br />
For example, if your FAT32 partition is on {{ic|/dev/sda9}}, and you wish to mount it to {{ic|/mnt/fat32}}, then you would use:<br />
<br />
{{hc|/etc/fstab|2=<br />
/dev/sda9 /mnt/fat32 vfat '''user''',rw<br />
}}<br />
<br />
Now, any user can mount it with:<br />
<br />
$ mount /mnt/fat32<br />
<br />
And unmount it with:<br />
<br />
$ umount /mnt/fat32<br />
<br />
Note that FAT does not support Linux file permissions. Each file will also appear to be executable. You may want to use the {{ic|showexec}} option to only mark Windows executables (com, exe, bat) as executable. See {{man|8|mount}} for more options.<br />
<br />
== Detecting FAT type ==<br />
<br />
If you need to know which [[Wikipedia:File Allocation Table#Types|type of FAT file system]] a partition uses, use the ''file'' command:<br />
<br />
{{hc|# file -s /dev/''partition''|2=<br />
/dev/''partition'': DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, root entries 512, sectors 4096 (volumes <=32 MB), Media descriptor 0xf8, sectors/FAT 3, sectors/track 32, heads 64, serial number 0x5bc09c21, unlabeled, '''FAT (12 bit)'''<br />
}}<br />
<br />
Alternatively you can use ''minfo'' from the {{Pkg|mtools}} package:<br />
<br />
{{hc|# minfo -i /dev/''partition'' ::|<nowiki><br />
device information:<br />
===================<br />
filename="/dev/</nowiki>''partition''<nowiki>"<br />
sectors per track: 32<br />
heads: 64<br />
cylinders: 2<br />
<br />
media byte: f8<br />
<br />
mformat command line: mformat -t 2 -h 64 -s 32 -i "/dev/</nowiki>''partition''<nowiki>" ::<br />
<br />
bootsector information<br />
======================<br />
banner:"mkfs.fat"<br />
sector size: 512 bytes<br />
cluster size: 4 sectors<br />
reserved (boot) sectors: 1<br />
fats: 2<br />
max available root directory slots: 512<br />
small size: 4096 sectors<br />
media descriptor byte: 0xf8<br />
sectors per fat: 3<br />
sectors per track: 32<br />
heads: 64<br />
hidden sectors: 0<br />
big size: 0 sectors<br />
physical drive id: 0x80<br />
reserved=0x0<br />
dos4=0x29<br />
serial number: 5BC09C21<br />
disk label="NO NAME "<br />
disk type="</nowiki>'''FAT12'''<nowiki> "<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [http://www.nslu2-linux.org/wiki/HowTo/MountFATFileSystems MountFATFileSystems]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=FAT&diff=575930FAT2019-06-19T10:44:42Z<p>GenkiSky: /* Writing to FAT32 as normal user */ Remove explicit setting of default options (fs_freq, fs_passno)</p>
<hr />
<div>[[Category:File systems]]<br />
[[es:FAT]]<br />
[[ja:FAT]]<br />
[[ru:FAT]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related articles end}}<br />
{{Expansion|Needs more information.|section=Needed information}}<br />
<br />
From [[Wikipedia:File Allocation Table]]:<br />
<br />
:File Allocation Table (FAT) is a computer file system architecture and a family of industry-standard file systems utilizing it. The FAT file system is a legacy file system which is simple and robust. It offers good performance even in light-weight implementations, but cannot deliver the same performance, reliability and scalability as some modern file systems. It is, however, supported for compatibility reasons by nearly all currently developed operating systems for personal computers and many mobile devices and embedded systems, and thus is a well-suited format for data exchange between computers and devices of almost any type and age from 1981 up to the present.<br />
<br />
== File system creation ==<br />
<br />
To create a FAT filesystem, [[install]] {{Pkg|dosfstools}}.<br />
<br />
{{ic|mkfs.fat}} supports creating FAT12, FAT16 and FAT32, see [[Wikipedia:File Allocation Table#Types]] for an explanation on their differences. {{ic|mkfs.fat}} will select the FAT type based on the partition size, to explicitly create a certain type of FAT filesystem use the {{ic|-F}} option. See {{man|8|mkfs.fat}} for more information.<br />
<br />
{{Tip|For most situations you will want to use FAT32.}}<br />
<br />
Format a partition to FAT32:<br />
<br />
# mkfs.fat -F 32 /dev/''partition''<br />
<br />
{{Note|{{ic|mkfs.vfat}} is a symlink to {{ic|mkfs.fat}}, they are the same utility.}}<br />
<br />
== Kernel configuration ==<br />
<br />
Here is an example of the default ''mount'' configuration in the kernel:<br />
<br />
{{hc|$ zgrep -e FAT -e DOS /proc/config.gz {{!}} sort -r|2=<br />
# DOS/FAT/NT Filesystems<br />
CONFIG_FAT_FS=m<br />
CONFIG_MSDOS_PARTITION=y<br />
CONFIG_FAT_FS=m<br />
CONFIG_MSDOS_FS=m<br />
CONFIG_VFAT_FS=m<br />
CONFIG_FAT_DEFAULT_CODEPAGE=437<br />
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"<br />
CONFIG_NCPFS_SMALLDOS=y<br />
}}<br />
<br />
A short description of the options:<br />
<br />
* Language settings: {{ic|CONFIG_FAT_DEFAULT_CODEPAGE}}, {{ic|CONFIG_FAT_DEFAULT_IOCHARSET}}<br />
* All filenames to lower letters on a FAT partitions if enabled: {{ic|CONFIG_NCPFS_SMALLDOS}}<br />
* Enables support of the FAT file systems: {{ic|CONFIG_FAT_FS}}, {{ic|CONFIG_MSDOS_FS}}, {{ic|CONFIG_VFAT_FS}}<br />
* Enables support of a FAT partitioned harddisks on 86x PCs: {{ic|CONFIG_MSDOS_PARTITION}}<br />
<br />
If the partition type detected by mount is VFAT then it will run the {{ic|/usr/bin/mount.vfat}} script.<br />
<br />
{{hc|/usr/bin/mount.vfat|2= <br />
#!/bin/bash<br />
#mount VFAT with full rw (read-write) permissions for all users<br />
#/usr/bin/mount -i -t vfat -oumask=0000,iocharset=utf8 "$@"<br />
#The above is the same as<br />
mount -i -t vfat -oiocharset=utf8,fmask=0000,dmask=0000 "$@"<br />
}}<br />
<br />
== Writing to FAT32 as normal user ==<br />
<br />
To write on a FAT32 partition, you must make a few changes to the [[fstab]] file.<br />
<br />
{{hc|/etc/fstab|2=<br />
/dev/sd''xY'' /mnt/some_folder vfat '''user''',rw<br />
}}<br />
<br />
The {{ic|user}} option means that any user (even non-root) can mount and unmount the partition {{ic|/dev/sd''X''}}. {{ic|rw}} gives read-write access.<br />
<br />
For example, if your FAT32 partition is on {{ic|/dev/sda9}}, and you wish to mount it to {{ic|/mnt/fat32}}, then you would use:<br />
<br />
{{hc|/etc/fstab|2=<br />
/dev/sda9 /mnt/fat32 vfat '''user''',rw<br />
}}<br />
<br />
Now, any user can mount it with:<br />
<br />
$ mount /mnt/fat32<br />
<br />
And unmount it with:<br />
<br />
$ umount /mnt/fat32<br />
<br />
Note that FAT does not support Linux file permissions. Each file will also appear to be executable. You may want to use the {{ic|showexec}} option to only mark Windows executables (com, exe, bat) as executable. See {{man|8|fstab}} for more options.<br />
<br />
== Detecting FAT type ==<br />
<br />
If you need to know which [[Wikipedia:File Allocation Table#Types|type of FAT file system]] a partition uses, use the ''file'' command:<br />
<br />
{{hc|# file -s /dev/''partition''|2=<br />
/dev/''partition'': DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, root entries 512, sectors 4096 (volumes <=32 MB), Media descriptor 0xf8, sectors/FAT 3, sectors/track 32, heads 64, serial number 0x5bc09c21, unlabeled, '''FAT (12 bit)'''<br />
}}<br />
<br />
Alternatively you can use ''minfo'' from the {{Pkg|mtools}} package:<br />
<br />
{{hc|# minfo -i /dev/''partition'' ::|<nowiki><br />
device information:<br />
===================<br />
filename="/dev/</nowiki>''partition''<nowiki>"<br />
sectors per track: 32<br />
heads: 64<br />
cylinders: 2<br />
<br />
media byte: f8<br />
<br />
mformat command line: mformat -t 2 -h 64 -s 32 -i "/dev/</nowiki>''partition''<nowiki>" ::<br />
<br />
bootsector information<br />
======================<br />
banner:"mkfs.fat"<br />
sector size: 512 bytes<br />
cluster size: 4 sectors<br />
reserved (boot) sectors: 1<br />
fats: 2<br />
max available root directory slots: 512<br />
small size: 4096 sectors<br />
media descriptor byte: 0xf8<br />
sectors per fat: 3<br />
sectors per track: 32<br />
heads: 64<br />
hidden sectors: 0<br />
big size: 0 sectors<br />
physical drive id: 0x80<br />
reserved=0x0<br />
dos4=0x29<br />
serial number: 5BC09C21<br />
disk label="NO NAME "<br />
disk type="</nowiki>'''FAT12'''<nowiki> "<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [http://www.nslu2-linux.org/wiki/HowTo/MountFATFileSystems MountFATFileSystems]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=FAT&diff=575929FAT2019-06-19T10:43:31Z<p>GenkiSky: /* Writing to FAT32 as normal user */ Move notes on "executable" files to end of section (irrelevant to the section header)</p>
<hr />
<div>[[Category:File systems]]<br />
[[es:FAT]]<br />
[[ja:FAT]]<br />
[[ru:FAT]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related articles end}}<br />
{{Expansion|Needs more information.|section=Needed information}}<br />
<br />
From [[Wikipedia:File Allocation Table]]:<br />
<br />
:File Allocation Table (FAT) is a computer file system architecture and a family of industry-standard file systems utilizing it. The FAT file system is a legacy file system which is simple and robust. It offers good performance even in light-weight implementations, but cannot deliver the same performance, reliability and scalability as some modern file systems. It is, however, supported for compatibility reasons by nearly all currently developed operating systems for personal computers and many mobile devices and embedded systems, and thus is a well-suited format for data exchange between computers and devices of almost any type and age from 1981 up to the present.<br />
<br />
== File system creation ==<br />
<br />
To create a FAT filesystem, [[install]] {{Pkg|dosfstools}}.<br />
<br />
{{ic|mkfs.fat}} supports creating FAT12, FAT16 and FAT32, see [[Wikipedia:File Allocation Table#Types]] for an explanation on their differences. {{ic|mkfs.fat}} will select the FAT type based on the partition size, to explicitly create a certain type of FAT filesystem use the {{ic|-F}} option. See {{man|8|mkfs.fat}} for more information.<br />
<br />
{{Tip|For most situations you will want to use FAT32.}}<br />
<br />
Format a partition to FAT32:<br />
<br />
# mkfs.fat -F 32 /dev/''partition''<br />
<br />
{{Note|{{ic|mkfs.vfat}} is a symlink to {{ic|mkfs.fat}}, they are the same utility.}}<br />
<br />
== Kernel configuration ==<br />
<br />
Here is an example of the default ''mount'' configuration in the kernel:<br />
<br />
{{hc|$ zgrep -e FAT -e DOS /proc/config.gz {{!}} sort -r|2=<br />
# DOS/FAT/NT Filesystems<br />
CONFIG_FAT_FS=m<br />
CONFIG_MSDOS_PARTITION=y<br />
CONFIG_FAT_FS=m<br />
CONFIG_MSDOS_FS=m<br />
CONFIG_VFAT_FS=m<br />
CONFIG_FAT_DEFAULT_CODEPAGE=437<br />
CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"<br />
CONFIG_NCPFS_SMALLDOS=y<br />
}}<br />
<br />
A short description of the options:<br />
<br />
* Language settings: {{ic|CONFIG_FAT_DEFAULT_CODEPAGE}}, {{ic|CONFIG_FAT_DEFAULT_IOCHARSET}}<br />
* All filenames to lower letters on a FAT partitions if enabled: {{ic|CONFIG_NCPFS_SMALLDOS}}<br />
* Enables support of the FAT file systems: {{ic|CONFIG_FAT_FS}}, {{ic|CONFIG_MSDOS_FS}}, {{ic|CONFIG_VFAT_FS}}<br />
* Enables support of a FAT partitioned harddisks on 86x PCs: {{ic|CONFIG_MSDOS_PARTITION}}<br />
<br />
If the partition type detected by mount is VFAT then it will run the {{ic|/usr/bin/mount.vfat}} script.<br />
<br />
{{hc|/usr/bin/mount.vfat|2= <br />
#!/bin/bash<br />
#mount VFAT with full rw (read-write) permissions for all users<br />
#/usr/bin/mount -i -t vfat -oumask=0000,iocharset=utf8 "$@"<br />
#The above is the same as<br />
mount -i -t vfat -oiocharset=utf8,fmask=0000,dmask=0000 "$@"<br />
}}<br />
<br />
== Writing to FAT32 as normal user ==<br />
<br />
To write on a FAT32 partition, you must make a few changes to the [[fstab]] file.<br />
<br />
{{hc|/etc/fstab|2=<br />
/dev/sd''xY'' /mnt/some_folder vfat '''user''',rw 0 0<br />
}}<br />
<br />
The {{ic|user}} option means that any user (even non-root) can mount and unmount the partition {{ic|/dev/sd''X''}}. {{ic|rw}} gives read-write access.<br />
<br />
For example, if your FAT32 partition is on {{ic|/dev/sda9}}, and you wish to mount it to {{ic|/mnt/fat32}}, then you would use:<br />
<br />
{{hc|/etc/fstab|2=<br />
/dev/sda9 /mnt/fat32 vfat '''user''',rw 0 0<br />
}}<br />
<br />
Now, any user can mount it with:<br />
<br />
$ mount /mnt/fat32<br />
<br />
And unmount it with:<br />
<br />
$ umount /mnt/fat32<br />
<br />
Note that FAT does not support Linux file permissions. Each file will also appear to be executable. You may want to use the {{ic|showexec}} option to only mark Windows executables (com, exe, bat) as executable. See {{man|8|fstab}} for more options.<br />
<br />
== Detecting FAT type ==<br />
<br />
If you need to know which [[Wikipedia:File Allocation Table#Types|type of FAT file system]] a partition uses, use the ''file'' command:<br />
<br />
{{hc|# file -s /dev/''partition''|2=<br />
/dev/''partition'': DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, root entries 512, sectors 4096 (volumes <=32 MB), Media descriptor 0xf8, sectors/FAT 3, sectors/track 32, heads 64, serial number 0x5bc09c21, unlabeled, '''FAT (12 bit)'''<br />
}}<br />
<br />
Alternatively you can use ''minfo'' from the {{Pkg|mtools}} package:<br />
<br />
{{hc|# minfo -i /dev/''partition'' ::|<nowiki><br />
device information:<br />
===================<br />
filename="/dev/</nowiki>''partition''<nowiki>"<br />
sectors per track: 32<br />
heads: 64<br />
cylinders: 2<br />
<br />
media byte: f8<br />
<br />
mformat command line: mformat -t 2 -h 64 -s 32 -i "/dev/</nowiki>''partition''<nowiki>" ::<br />
<br />
bootsector information<br />
======================<br />
banner:"mkfs.fat"<br />
sector size: 512 bytes<br />
cluster size: 4 sectors<br />
reserved (boot) sectors: 1<br />
fats: 2<br />
max available root directory slots: 512<br />
small size: 4096 sectors<br />
media descriptor byte: 0xf8<br />
sectors per fat: 3<br />
sectors per track: 32<br />
heads: 64<br />
hidden sectors: 0<br />
big size: 0 sectors<br />
physical drive id: 0x80<br />
reserved=0x0<br />
dos4=0x29<br />
serial number: 5BC09C21<br />
disk label="NO NAME "<br />
disk type="</nowiki>'''FAT12'''<nowiki> "<br />
</nowiki>}}<br />
<br />
== See also ==<br />
<br />
* [http://www.nslu2-linux.org/wiki/HowTo/MountFATFileSystems MountFATFileSystems]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=User:GenkiSky&diff=529482User:GenkiSky2018-07-14T00:57:46Z<p>GenkiSky: Add name, and link to edits I've made for convenience</p>
<hr />
<div>Hello, my name is Genki Sky. My personal website is here: https://genki.is.<br />
<br />
You might be interested in the [[Special:Contributions/GenkiSky|list of edits I've made]].</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=List_of_applications/Utilities&diff=521990List of applications/Utilities2018-05-20T02:04:18Z<p>GenkiSky: /* Terminal emulators */ Alacritty: Use project's GitHub description rather than subjective/ambiguous claim</p>
<hr />
<div><noinclude><br />
[[Category:Applications]]<br />
[[es:List of applications/Utilities]]<br />
[[it:List of applications/Utilities]]<br />
[[ja:アプリケーション一覧/ユーティリティ]]<br />
[[ru:List of applications/Utilities]]<br />
[[zh-hans:List of applications/Utilities]]<br />
[[zh-hant:List of applications/Utilities]]<br />
{{List of applications navigation}}<br />
</noinclude><br />
== Utilities ==<br />
<br />
=== Partitioning tools ===<br />
<br />
See [[Partitioning#Partitioning tools]].<br />
<br />
=== Mount tools ===<br />
<br />
See also [[udisks#Mount helpers]].<br />
<br />
* {{App|9mount|Mount 9p filesystems.|http://sqweek.net/code/9mount/|{{AUR|9mount}}}}<br />
* {{App|cryptmount|Mount an encrypted file system as a regular user.|https://sourceforge.net/projects/cryptmount/|{{AUR|cryptmount}}}}<br />
* {{App|ldm|A lightweight daemon that mounts drives automagically using ''udev''|https://github.com/LemonBoy/ldm|{{AUR|ldm}}}}<br />
* {{App|pmount|Mount ''source'' as a regular user to an automatically created destination {{ic|/media/''source_name''}}.|https://pmount.alioth.debian.org/|{{AUR|pmount}}}}<br />
* {{App|pmount-safe-removal|Mount removable devices as regular user with safe removal|https://mywaytoarch.tumblr.com/post/13111098534/pmount-safe-removal-of-usb-device|{{AUR|pmount-safe-removal}}}}<br />
* {{App|udevil|Mounts removable devices as a regular user, show device info, and monitor device changes. Only depends on ''udev'' and glib.|https://ignorantguru.github.io/udevil|{{Pkg|udevil}}}}<br />
* {{App|ws|Mount Windows network shares ([[Wikipedia:Server Message Block|CIFS]] and [[Wikipedia:Virtual file system|VFS]]).|https://sourceforge.net/projects/winshares/|{{AUR|ws}}}}<br />
* {{App|zulucrypt|A GUI frontend for cryptsetup to create, manage and mount encrypted volumes; supports encfs as well|https://mhogomchungu.github.io/zuluCrypt/|{{AUR|zulucrypt}}}}<br />
<br />
=== Terminal emulators ===<br />
<br />
Terminal emulators show a GUI Window that contains a terminal. Most emulate Xterm, which in turn emulates VT102, which emulates typewriter. For further background information, see [[Wikipedia:Terminal emulator]].<br />
<br />
For a comprehensive list, see [[Wikipedia:List of terminal emulators]].<br />
<br />
* {{App|Alacritty|A cross-platform, GPU-accelerated terminal emulator.|https://github.com/jwilm/alacritty|{{AUR|alacritty-git}}}}<br />
* {{App|aterm|Xterm replacement with transparency support. It has been deprecated in favour of urxvt since 2008.|http://aterm.sourceforge.net/|{{AUR|aterm}}}}<br />
* {{App|Cool Retro Term|A good looking terminal emulator which mimics the old cathode display.|https://github.com/Swordfish90/cool-retro-term|{{Pkg|cool-retro-term}}}}<br />
* {{App|Eterm|Terminal emulator intended as a replacement for xterm and designed for the [[Enlightenment]] desktop.|http://eterm.org|{{AUR|eterm}}}}<br />
* {{App|Gate One|Web-based terminal emulator and SSH client.|https://github.com/liftoff/GateOne|{{AUR|gateone-git}}}}<br />
* {{App|Hyper|A terminal with JS/CSS support.|https://github.com/zeit/hyper|{{AUR|hyper}}}}<br />
* {{App|[[Wikipedia:Konsole|Konsole]]|Terminal emulator included in the [[KDE]] desktop.|https://www.kde.org/applications/system/konsole/|{{Pkg|konsole}}}}<br />
* {{App|kitty|A modern, hackable, featureful, OpenGL based terminal emulator|https://github.com/kovidgoyal/kitty|{{Pkg|kitty}}}}<br />
* {{App|mlterm|A multi-lingual terminal emulator supporting various character sets and encodings in the world.|https://sourceforge.net/projects/mlterm/|{{AUR|mlterm}}}}<br />
* {{App|QTerminal|A lightweight Qt-based terminal emulator.|https://github.com/qterminal/qterminal|{{pkg|qterminal}}}}<br />
* {{App|[[Wikipedia:Rxvt|rxvt]]|Popular replacement for the xterm.|http://rxvt.sourceforge.net/|{{AUR|rxvt}}}}<br />
* {{App|shellinabox|A web-based SSH Terminal|https://github.com/shellinabox/shellinabox|{{AUR|shellinabox-git}}}}<br />
* {{App|[[st]]|Simple terminal implementation for X.|http://st.suckless.org|{{AUR|st}}}}<br />
* {{App|Terminology|Terminal emulator by the Enlightenment project team with innovative features: file thumbnails and media play like a media player.|https://www.enlightenment.org/about-terminology|{{Pkg|terminology}}}}<br />
* {{App|[[Tilda]]|Terminal inspired by many classic terminals from first person shooter games such as Quake, Doom and Half-Life.|https://github.com/lanoxx/tilda/|{{Pkg|tilda}}}}<br />
* {{App|[[urxvt]]|Highly extendable (with Perl) unicode enabled rxvt-clone terminal emulator featuring tabbing, url launching, a Quake style drop-down mode and pseudo-transparency.|http://software.schmorp.de/pkg/rxvt-unicode.html|{{Pkg|rxvt-unicode}}}}<br />
* {{App|[[xterm]]|Simple terminal emulator for the X Window System. It provides DEC VT102 and Tektronix 4014 compatible terminals for programs that can't use the window system directly.|http://invisible-island.net/xterm/|{{Pkg|xterm}}}}<br />
* {{App|[[Wikipedia:Yakuake|Yakuake]]|Drop-down terminal (Quake style) emulator based on Konsole.|https://yakuake.kde.org/|{{Pkg|yakuake}}}}<br />
<br />
==== VTE-based ====<br />
<br />
[http://developer.gnome.org/vte/unstable/ VTE] (Virtual Terminal Emulator) is a widget developed during early GNOME days for use in the GNOME Terminal. It has since given birth to many terminals with similar capabilities.<br />
<br />
* {{App|Deepin Terminal|Terminal emulation application for Deepin desktop.|https://github.com/linuxdeepin/deepin-terminal|{{Pkg|deepin-terminal}}}}<br />
* {{App|evilvte|Very lightweight and highly customizable terminal emulator with support for tabs, auto-hiding and different encodings.|http://calno.com/evilvte/|{{AUR|evilvte-git}}}}<br />
* {{App|Germinal|Minimalist terminal emulator which provides a borderless maximized terminal, attached to a tmux session by default, hence providing tabs and panels.|http://www.imagination-land.org/tags/germinal.html|{{AUR|germinal}}}}<br />
* {{App|[[Wikipedia:GNOME Terminal|GNOME Terminal]]|A terminal emulator included in the [[GNOME]] desktop with support for Unicode and pseudo-transparency.|https://wiki.gnome.org/Apps/Terminal|{{Pkg|gnome-terminal}}}}<br />
* {{App|[[Guake]]|Drop-down terminal for the GNOME desktop.|http://guake-project.org/|{{Pkg|guake}}}}<br />
* {{App|LXTerminal|Desktop independent terminal emulator for [[LXDE]].|http://wiki.lxde.org/en/LXTerminal|{{Pkg|lxterminal}}}}<br />
* {{App|MATE terminal|A fork of [[Wikipedia:GNOME terminal]] for the [[MATE]] desktop.|http://www.mate-desktop.org/|{{Pkg|mate-terminal}}}}<br />
* {{App|Pantheon Terminal|A super lightweight, beautiful, and simple terminal emulator. It's designed to be setup with sane defaults and little to no configuration.|https://launchpad.net/pantheon-terminal|{{Pkg|pantheon-terminal}}}}<br />
* {{App|ROXTerm|Tabbed terminal emulator with a small footprint.|http://roxterm.sourceforge.net/|{{AUR|roxterm}}}}<br />
* {{App|sakura|Terminal emulator based on GTK+ and VTE.|http://www.pleyades.net/david/projects/sakura|{{Pkg|sakura}}}}<br />
* {{App|[[Wikipedia:Terminal (Xfce)|Terminal]]|Terminal emulator included in the [[Xfce]] desktop with support for a colorized prompt and a tabbed interface.|http://docs.xfce.org/apps/terminal/start|{{Pkg|xfce4-terminal}}}}<br />
* {{App|[[terminator]]|Terminal emulator supporting multiple resizable terminal panels.|http://gnometerminator.blogspot.it/|{{Pkg|terminator}}}}<br />
* {{App|[[Termite]]|A keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.|https://github.com/thestinger/termite|{{Pkg|termite}}}}<br />
* {{App|Tilix|A tiling terminal emulator for Linux using GTK+ 3|https://github.com/gnunn1/tilix|{{Pkg|tilix}} {{AUR|tilix-git}}}}<br />
* {{App|tinyterm|Very lightweight terminal emulator based on VTE.|https://github.com/lahwaacz/tinyterm|{{AUR|tinyterm-git}}}}<br />
<br />
==== KMS-based ====<br />
<br />
The following terminal emulators are based on the [[kernel mode setting]] that could be invoked without X.<br />
* {{App|[[KMSCON]]|A KMS/DRM-based system console(getty) with an integrated terminal emulator for Linux operating systems.|https://github.com/dvdhrm/kmscon|{{AUR|kmscon}}}}<br />
<br />
==== framebuffer-based ====<br />
<br />
In GNU/Linux world, the [[Wikipedia:Framebuffer|framebuffer]] could be refered to a virtual device in the Linux kernel ('''fbdev''') or the virtual framebuffer system for X ('''xvfb'''). This section mainly lists the terminal emulators that based on the in-kernel virtual device, i.e. '''fbdev'''.<br />
<br />
* {{App|yaft|A simple terminal emulator for living without X, with UCS2 glyphs, wallpaper and 256color support.|https://github.com/uobikiemukot/yaft|{{aur|yaft}}}}<br />
<br />
=== Hex editors ===<br />
<br />
See also [[Wikipedia:Comparison of hex editors]].<br />
<br />
* {{App|hyx|A minimalistic but powerful (hex/ASCII, insert/replace/delete, copy/paste, undo/redo, search, colors, vim-inspired controls) console hex editor.|https://yx7.cc/code/|{{aur|hyx}}}}<br />
<br />
=== Integrated development environments ===<br />
<br />
See also [[Wikipedia:Comparison of integrated development environments]].<br />
<br />
* {{App|[[Wikipedia:Anjuta|Anjuta]]|Versatile IDE with project management, an application wizard, an interactive debugger, a source editor, version control support and many more tools.|http://www.anjuta.org/|{{Pkg|anjuta}}}}<br />
* {{App|[[Wikipedia:Aptana#Aptana_Studio|Aptana Studio]]|IDE based on Eclipse, but geared towards web development, with support for HTML, CSS, Javascript, Ruby on Rails, PHP, Adobe AIR and others.|http://www.aptana.com/|{{AUR|aptana-studio}}}}<br />
* {{App|[[Wikipedia:Bluefish (text editor)|Bluefish]]|GTK+ editor/IDE with an MDI interface, syntax highlighting and support for Python plugins.|http://bluefish.openoffice.nl/|{{Pkg|bluefish}}}}<br />
* {{App|[[Wikipedia:Bluej|Bluej]]|Fully featured Java IDE used mainly for educational and beginner purposes.|https://bluej.org/|{{AUR|bluej}}}}<br />
* {{App|[[Wikipedia:Brackets_(text_editor)|Brackets]]|A free open-source editor written in HTML, CSS, and Javascript with a primary focus on Web Development. It was created by Adobe Systems, licensed under the MIT License, and is currently maintained on GitHub.|http://brackets.io/|{{AUR|brackets}}}}<br />
* {{App|[[Wikipedia:GNOME Builder|Builder]]|General purpose IDE for GNOME.|https://wiki.gnome.org/Apps/Builder|{{Pkg|gnome-builder}}}}<br />
* {{App|[[Wikipedia:Code::Blocks|Code::Blocks]]|Open source and cross-platform C/C++ IDE.|http://www.codeblocks.org/|{{Pkg|codeblocks}}}}<br />
* {{App|[[Wikipedia:JetBrains#CLion|CLion]]|A cross-platform IDE for C and C++.|http://www.jetbrains.com/clion|{{AUR|clion}}}}<br />
* {{App|[[Wikipedia:CodeLite|CodeLite]]|Open source and cross-platform C/C++/PHP and Node.js IDE written in C++ .|http://www.codelite.org/|{{AUR|codelite}}}}<br />
* {{App|[[Wikipedia:Cloud9 IDE|Cloud9]]|State-of-the-art IDE that runs in your browser and lives in the cloud, allowing you to run, debug and deploy applications from anywhere, anytime.|https://c9.io/|{{AUR|c9.core}}}}<br />
* {{App|[[Eclipse]]|Open source community project, which aims to provide a universal development platform.|https://eclipse.org/|{{Pkg|eclipse-java}}, {{Pkg|eclipse-cpp}}, {{Pkg|eclipse-php}}}}<br />
* {{App|[[Wikipedia:Eric Python IDE|Eric]]|Full-featured Python and Ruby IDE in PyQt5.|https://eric-ide.python-projects.org/|{{Pkg|eric}}}}<br />
* {{App|[[Gambas]]|Free development environment based on a Basic interpreter with object extensions.|http://gambas.sourceforge.net/en/main.html|{{Pkg|gambas3-ide}}}}<br />
* {{App|[[Wikipedia:Geany|Geany]]|Text editor using the GTK+ toolkit with basic features of an integrated development environment.|https://geany.org|{{Pkg|geany}}}}<br />
* {{App|[[Wikipedia:IntelliJ IDEA|IntelliJ IDEA]]|IDE for Java, Groovy and other programming languages with advanced refactoring features.|http://www.jetbrains.com/idea/|{{Pkg|intellij-idea-community-edition}}}}<br />
* {{App|[[Wikipedia:KDevelop|KDevelop]]|Feature-full, plugin extensible IDE for C/C++ and other programming languages.|http://kdevelop.org/|{{Pkg|kdevelop}}}}<br />
* {{App|[[Wikipedia:Komodo_Edit|Komodo Edit]]|A free, multi-language editor.|http://www.activestate.com/komodo-edit|{{AUR|komodo-edit}}}}<br />
* {{App|[[Wikipedia:Lazarus_(IDE)|Lazarus]]|Cross-platform IDE for Object Pascal.|http://lazarus.freepascal.org/|{{Pkg|lazarus}}}}<br />
* {{App|LiteIDE|A simple, open source, cross-platform Go IDE.|https://github.com/visualfc/liteide|{{Pkg|liteide}}}}<br />
* {{App|[[Wikipedia:MonoDevelop|MonoDevelop]]|Cross-platform IDE targeted for the Mono and .NET frameworks.|http://monodevelop.com/|{{AUR|monodevelop-git}}}}<br />
* {{App|[[Wikipedia:MPLAB|MPLAB]]|IDE for Microchip PIC and dsPIC development|http://www.microchip.com/mplabx|{{AUR|microchip-mplabx-bin}}}}<br />
* {{App|[[Netbeans]]|Integrated development environment (IDE) for developing with Java, JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala, Clojure, and other languages.|http://netbeans.org/|{{Pkg|netbeans}}}}<br />
* {{App|[[Wikipedia:Ninja-IDE|Ninja-IDE]]| from the recursive acronym: "Ninja-IDE Is Not Just Another IDE", is a cross-platform integrated development environment (IDE); runs on Linux/X11, Mac OS X and Windows OSs. Used, for example, for Python development|http://ninja-ide.org/|{{Pkg|ninja-ide}}}}<br />
* {{App|[[PHPStorm]]|JetBrains PhpStorm is a commercial, cross-platform IDE for PHP built on JetBrains' IntelliJ IDEA platform, providing an editor for PHP, HTML and JavaScript with on-the-fly code analysis, error prevention and automated refactorings for PHP and JavaScript code.|https://www.jetbrains.com/phpstorm/|{{Aur|phpstorm}} {{Aur|phpstorm-eap}}}}<br />
* {{App|[[Wikipedia:PyCharm|PyCharm]]|Python IDE with support for code analysis, debugging, unit testing, version control and web development with Django.|http://www.jetbrains.com/pycharm/|{{Pkg|pycharm-community-edition}}}}<br />
* {{App|[[Wikipedia:Qt Creator|Qt Creator]]|Lightweight, cross-platform C++ integrated development environment with a focus on Qt.|https://www.qt.io/ide/|{{Pkg|qtcreator}}}}<br />
* {{App|[[Wikipedia:Scratch (programming language)|Scratch]]| A multimedia authoring tool for educational and entertainment purposes, such as creating interactive projects and simple sprite-based games. It is used primarly by unskilled users (such as children) as an entry to [[Wikipedia:Event-driven_programming|event-driven programming]]. ''Scratch'' is free software under GPL v2 and [http://wiki.scratch.mit.edu/wiki/Scratch_Source_Code_License Scratch Source Code License].|http://scratch.mit.edu|{{Pkg|scratch}} {{Aur|scratch2}}}}<br />
* {{App|[[Wikipedia:Spyder (software)|Spyder]]|Scientific PYthon Development EnviRonment providing MATLAB-like features.|https://github.com/spyder-ide/spyder|{{Pkg|spyder2}} (Python 2) or {{Pkg|spyder3}} (Python 3)}}<br />
* {{App|Thonny|Python IDE for beginners.|http://thonny.cs.ut.ee/|{{AUR|thonny}}}}<br />
<br />
=== Build automation ===<br />
<br />
See also [[Wikipedia:List of build automation software]].<br />
<br />
* {{App|Apache Ant|Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other.|http://ant.apache.org/|{{Pkg|apache-ant}}}}<br />
* {{App|Apache Maven|Software project management and comprehension tool.|http://maven.apache.org/|{{Pkg|maven}}}}<br />
* {{App|Gradle|Powerful build system for the JVM.|https://gradle.org/|{{Pkg|gradle}}}}<br />
* {{App|Phing|PHP program designed to automate tasks of all kinds.|https://www.phing.info/|{{AUR|phing}}}}<br />
<br />
=== Files ===<br />
<br />
==== File managers ====<br />
<br />
See also [[Wikipedia:Comparison of file managers]].<br />
<br />
===== Console =====<br />
<br />
* {{App|Clex|File manager with full-screen user interface|http://www.clex.sk/|{{Aur|clex}}}}<br />
* {{App|[[Wikipedia:Dired|Dired]]|Directory editor integrated with [[Emacs]].|https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html|{{pkg|emacs}}}}<br />
* {{app|dired|Ancient DIRectory EDitor since 1980.|http://fossies.org/linux/misc/old/|{{aur|dired}}}}<br />
* {{App|Last File Manager|Powerful file manager written in Python 3 with a curses interface.|https://inigo.katxi.org/devel/lfm/|{{AUR|lfm}}}}<br />
* {{App|lf|Terminal file manager written in Go using server/client architecture.|https://github.com/gokcehan/lf|{{aur|lf-git}}}}<br />
* {{App|[[Midnight Commander]]|Console-based, dual-paneled file manager.|http://www.midnight-commander.org|{{Pkg|mc}}}}<br />
* {{App|nffm|"Nothing Fancy File Manager", a mouseless ncurses file manager written in C.|https://github.com/mariostg/nffm|{{AUR|nffm-git}}}}<br />
* {{App|Pilot|File manager that comes with the [[Alpine]] email client.|http://patches.freeiz.com/alpine/|{{AUR|alpine}}}}<br />
* {{App|[[Ranger]]|Console-based file manager with vi bindings, customizability, and lots of features.|http://nongnu.org/ranger|{{Pkg|ranger}}}}<br />
* {{App|[[Vifm]]|Ncurses-based two-panel file manager with vi-like keybindings.|http://vifm.info|{{Pkg|vifm}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|Caja|The file manager for the MATE desktop.|https://github.com/mate-desktop/caja|{{Pkg|caja}}}}<br />
* {{App|Deepin File Manager|File manager developed for [[Deepin]].|https://github.com/linuxdeepin/dde-file-manager|{{Pkg|deepin-file-manager}}}}<br />
* {{App|[[Dolphin]]|File manager included in the KDE desktop.|https://userbase.kde.org/Dolphin|{{Pkg|dolphin}}}}<br />
* {{App|Double Commander|File manager with two panels side by side. It is inspired by Total Commander and features some new ideas.|http://doublecmd.sourceforge.net//|{{Pkg|doublecmd-gtk2}} {{Pkg|doublecmd-qt4}}{{Broken package link|replaced by {{Pkg|doublecmd-qt5}}}}}}<br />
* {{App|[[Wikipedia:emelFM2|emelFM2]]|File manager that implements the popular two-panel design.|http://emelfm2.net/|{{Pkg|emelfm2}}}}<br />
* {{App|Gentoo|A lightweight file manager for GTK.|http://www.obsession.se/gentoo/|{{AUR|gentoo}}}}<br />
* {{App|[[Wikipedia:GNOME Commander|GNOME Commander]]|A dual-paned file manager for the GNOME Desktop.|http://gcmd.github.io/|{{AUR|gnome-commander}}}}<br />
* {{App|[[GNOME Files]]|Extensible, heavyweight file manager used by default in GNOME with support for custom scripts.|https://wiki.gnome.org/Apps/Nautilus|{{Pkg|nautilus}}}}<br />
* {{App|[[Wikipedia:Konqueror|Konqueror]]|File manager and web browser for the KDE desktop.|http://www.konqueror.org/|{{Pkg|konqueror}}}}<br />
* {{App|[[Wikipedia:Krusader|Krusader]]|Advanced twin panel (Midnight Commander style) file manager for the KDE desktop.|http://www.krusader.org/|{{Pkg|krusader}}}}<br />
* {{App|Liri Files|The file manager for Liri.|https://github.com/lirios/files|{{Pkg|liri-files}}}}<br />
* {{App|muCommander|A lightweight, cross-platform file manager with a dual-pane interface written in Java.|http://www.mucommander.com/|{{AUR|mucommander}}}}<br />
* {{App|[[Nemo]]|Nemo is the file manager of the Cinnamon desktop. A fork of Nautilus.|http://cinnamon.linuxmint.com/|{{Pkg|nemo}}}}<br />
* {{App|[[Wikipedia:Fox_toolkit|PathFinder]]|File browser that comes with the FOX toolkit.|http://fox-toolkit.org/|{{Pkg|fox}}}}<br />
* {{App|[[PCManFM]]|Lightweight file manager which features tabbed and dual pane browsing; also it can optionally manage the desktop icons and background.|http://wiki.lxde.org/en/PCManFM|{{Pkg|pcmanfm}}}}<br />
* {{App|qtFM|Small, lightweight filemanager for Linux desktops based on pure Qt.|http://www.qtfm.org/|{{AUR|qtfm}}}}<br />
* {{App|ROX|Small and fast file manager which can optionally manage the desktop background and panels.|http://rox.sourceforge.net|{{Pkg|rox}}}}<br />
* {{App|[[SpaceFM]]|GTK+ multi-panel tabbed file manager.|http://ignorantguru.github.com/spacefm/|{{AUR|spacefm}}}}<br />
* {{App|Sunflower|Small and highly customizable twin-panel file manager for Linux with support for plugins.|http://sunflower-fm.org/|{{AUR|sunflower}}}}<br />
* {{App|[[Thunar]]|File manager that can be run as a daemon with excellent start up and directory load times.|http://docs.xfce.org/xfce/thunar/start|{{Pkg|thunar}}}}<br />
* {{App|trolCommander|Lightweight, cross-platform file manager written in Java (Successor of muCommander)|https://github.com/trol73/mucommander|{{AUR|trolcommander}}}}<br />
* {{App|Tux Commander|Windowed file manager with two panels side by side similar to popular Total Commander or Midnight Commander file managers.|http://tuxcmd.sourceforge.net/description.php|{{Pkg|tuxcmd}}}}<br />
* {{App|Worker|Fast, lightweight and feature-rich file manager for the X Window System.|http://www.boomerangsworld.de/worker/|{{AUR|worker}}}}<br />
* {{App|[[Wikipedia:Xfe|Xfe]]|Microsoft Explorer-like file manager for X (X File Explorer).|http://roland65.free.fr/xfe/|{{AUR|xfe}}}}<br />
<br />
==== Trash management ====<br />
<br />
* {{App|trash-cli|A command-line interface implementing FreeDesktop.org's Trash specification.|https://github.com/andreafrancia/trash-cli|{{Pkg|trash-cli}}}}<br />
<br />
==== File synchronization ====<br />
<br />
See also [[Synchronization and backup programs#Data synchronization]] and [[Wikipedia:Comparison of file synchronization software]].<br />
<br />
* {{App|[[Wikipedia:FreeFileSync|FreeFileSync]]|Folder comparison and synchronization software that creates and manages backup copies of all your important files.|https://www.freefilesync.org/|{{AUR|freefilesync}}}}<br />
* {{App|rclone|Command line program to sync files and directories to and from cloud storage services as well as between local paths.|https://rclone.org/|{{Pkg|rclone}}}}<br />
* {{App|[[rsync]]|File transfer program that uses the "rsync algorithm" which provides a very fast method for bringing remote files into sync. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand.|https://rsync.samba.org/|{{Pkg|rsync}}}}<br />
* {{App|[[Syncthing]]|Continuous file synchronization program. It synchronizes files between two or more computers in a simple way without advanced configuration.|https://syncthing.net/|{{Pkg|syncthing}}}}<br />
* {{App|[[Wikipedia:Synkron|Synkron]]|Application that helps you keep your files and folders always updated. You can easily sync your documents, music or pictures to have their latest versions everywhere.|http://synkron.sourceforge.net/|{{AUR|synkron}}}}<br />
* {{App|[[Unison]]|File synchronization tool that allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.|https://www.cis.upenn.edu/~bcpierce/unison/|{{Pkg|unison}}}}<br />
<br />
==== Archiving and compression tools ====<br />
<br />
See also [[Wikipedia:Comparison of file archivers]].<br />
<br />
===== Console =====<br />
<br />
* {{App|atool|Script for managing file archives of various types.|http://www.nongnu.org/atool/|{{Pkg|atool}}}}<br />
* {{App|arj|An archiver that formerly used on DOS/Windows in mid-1990s. This is an open source clone.|http://arj.sourceforge.net/|{{Pkg|arj}}}}<br />
* {{App|[[Wikipedia:cpio|cpio]]|GNU tool supporting cpio and tar file archive formats.|https://www.gnu.org/software/cpio/|{{Pkg|cpio}}}}<br />
* {{App|[[Wikipedia:Dar (disk archiver)|dar]]|An archiving and compression utility avoiding the drawbacks of tar|[http://dar.linux.free.fr/ DAR - Disk ARchive]|{{AUR|dar}}}}<br />
* {{App|lha|Archiver to create LH-7 format archives. 32-bit only (require multilib on x86_64).|http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix|{{aur|lha}}}}<br />
* {{App|lrzip|Multi-threaded compressor using the rzip/lzma, lzo, and zpaq algorithms.|http://lrzip.kolivas.org/|{{pkg|lrzip}}}}<br />
* {{App|lz4|A file compressor using lz4 - An extremely fast compression algorithm.|https://github.com/lz4/lz4|{{pkg|lz4}}}}<br />
* {{App|lzop|Fast file compressor using lzo lib.|http://www.lzop.org/|{{pkg|lzop}}}}<br />
* {{App|[[p7zip]]|Port of 7-Zip for POSIX systems, including Linux. The commandline tool is called '''7z'''.|http://p7zip.sourceforge.net/|{{Pkg|p7zip}}}}<br />
* {{App|pixz|A multi-threaded and indexed compressor that avoiding the drawbacks of xz.|https://github.com/vasi/pixz|{{pkg|pixz}}}}<br />
* {{App|[[tar]]|GNU utility for manipulating the ubiquitous tar archives (tarballs).|https://www.gnu.org/software/tar/|{{Pkg|tar}}}}<br />
* {{App|[[Wikipedia:ZPAQ|zpaq]]|A high compression ratio archiver written in C++. Powered by Context-Model, LZ77 and BWT algorithm.|http://mattmahoney.net/dc/zpaq.html|{{aur|zpaq}}}}<br />
* {{App|zopfli|High compress ratio file compressor from Google, using a deflate-compatible algorithm called zopfli.|https://github.com/google/zopfli|{{aur|zopfli-git}}}}<br />
* {{App|[[Wikipedia:Zoo_(file_format)|zoo]]|Rarely used archiver that was mostly used in VMS world before PKZIP became popular.|http://www.ibiblio.org/pub/Linux/utils/compress/zoo-2.10-3.src.rpm|{{aur|zoo}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|[[Wikipedia:Ark (software)|Ark]]|Archiving tool included in the KDE desktop.|https://www.kde.org/applications/utilities/ark/|{{Pkg|ark}}}}<br />
* {{App|Engrampa|Archive manager for [[MATE]]|https://github.com/mate-desktop/engrampa|{{Pkg|engrampa}}}}<br />
* {{App|[[Wikipedia:File Roller|File Roller]]|Archive manager included in the GNOME desktop.|http://fileroller.sourceforge.net/|{{Pkg|file-roller}}}}<br />
* {{App|p7zip-gui|The GUI belonging to the p7zip software.|http://p7zip.sourceforge.net/|{{AUR|p7zip-gui}}}}<br />
* {{App|[[Wikipedia:PeaZip|PeaZip]]|Open source file and archive manager.|http://www.peazip.org/peazip-linux.html|{{AUR|peazip-gtk2}} {{AUR|peazip-qt}}}}<br />
* {{App|Squeeze|Featherweight front-end for commandline archiving tools.|http://squeeze.xfce.org/|{{AUR|squeeze-git}}}}<br />
* {{App|[[Wikipedia:Xarchiver|Xarchiver]]|Lightweight desktop independent archive manager built with GTK+.|https://github.com/ib/xarchiver|{{Pkg|xarchiver}} or {{Pkg|xarchiver-gtk2}}}}<br />
<br />
==== Comparison, diff, merge ====<br />
<br />
See also [[Wikipedia:Comparison of file comparison tools]].<br />
<br />
For managing ''pacnew''/''pacsave'' files, specialised tools exist. See [[Pacnew and Pacsave files#Managing .pacnew files]].<br />
<br />
* {{App|colordiff|A Perl script wrapper for 'diff' that produces the same output but with pretty 'syntax' highlighting.|http://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{App|Diffuse|Small and simple text merge tool written in Python.|http://diffuse.sourceforge.net/|{{Pkg|diffuse}}}}<br />
* {{App|KDiff3|File and directory diff and merge tool for the KDE desktop.|http://kdiff3.sourceforge.net/|{{Pkg|kdiff3}}}}<br />
* {{App|[[Wikipedia:Kompare|Kompare]]|GUI front-end program for viewing and merging differences between source files. It supports a variety of diff formats and provides many options to customize the information level displayed.|http://www.caffeinated.me.uk/kompare/|{{Pkg|kompare}}}}<br />
* {{App|[[Wikipedia:Meld (software)|Meld]]|Visual diff and merge tool that can compare files, directories, and version controlled projects.|http://meldmerge.org/|{{Pkg|meld}}}}<br />
* {{App|xxdiff|A graphical browser for file and directory differences.|http://furius.ca/xxdiff/|{{AUR|xxdiff}}}}<br />
<br />
[[Vim]] and [[Emacs]] provide merge functionality with [[Vim#Merging_files|vimdiff]] and {{ic|ediff}}.<br />
<br />
==== Batch renamers ====<br />
<br />
* {{App|[[Wikipedia:GPRename|GPRename]]|GTK+ batch renamer for files and directories.|http://gprename.sourceforge.net|{{Pkg|gprename}}}}<br />
* {{App|[[Wikipedia:KRename|KRename]]|Very powerful batch file renamer for the KDE desktop.|http://www.krename.net|{{Pkg|krename}}}}<br />
* {{App|metamorphose2|wxPython based batch renamer with support for regular expressions, renaming multimedia files according to their metadata, etc.|http://file-folder-ren.sourceforge.net|{{AUR|metamorphose2}}}}<br />
* {{App|pyRenamer|Application for the mass renaming of files.|https://github.com/SteveRyherd/pyRenamer|{{AUR|pyrenamer}}}}<br />
* {{App|rename.pl|Batch renamer based on perl regex.|http://search.cpan.org/~pederst/rename/bin/rename.PL|{{Pkg|perl-rename}}}}<br />
<br />
==== Finders ====<br />
<br />
{{Expansion|See also [[find]] and [[locate]].}}<br />
See also [[Wikipedia:List of search engines#Desktop search engines]].<br />
<br />
* {{App|fuzzy-find|Fuzzy completion for finding files.|https://github.com/silentbicycle/ff|{{AUR|ff-git}}}}<br />
* {{App|fzf|General-purpose command-line fuzzy finder.|https://github.com/junegunn/fzf|{{Pkg|fzf}} {{AUR|fzf-git}}}}<br />
* {{App|Baloo|KDE's file indexing and search solution|https://community.kde.org/Baloo|{{Pkg|baloo}}}}<br />
* {{App|Catfish|Versatile file searching tool|https://launchpad.net/catfish-search|{{Pkg|catfish}}}}<br />
* {{App|Docfetcher|A java open source desktop search application|http://docfetcher.sourceforge.net|{{AUR|docfetcher}}}}<br />
* {{App|Gnome Search Tool|Default Gnome utility to search for files|https://help.gnome.org/users/gnome-search-tool/stable/gsearchtool-introduction.html.en|{{Pkg|gnome-search-tool}}}}<br />
* {{App|Gnome Search Tool No Nautilus|''gnome-search-tool'' to search for files without [[GNOME Files]] or ''gnome-desktop''||{{AUR|gnome-search-tool-no-nautilus}}}}<br />
* {{App|Recoll|Full text search tool based on Xapian backend|http://www.lesbonscomptes.com/recoll/|{{Pkg|recoll}}}}<br />
* {{App|Searchmonkey|A powerful GUI search utility for matching regex patterns|http://searchmonkey.sourceforge.net/|{{AUR|searchmonkey}}}}<br />
* {{App|[[Wikipedia:Tracker (search software)|Tracker]]|All-in-one indexer, search tool and metadata database.|https://wiki.gnome.org/Projects/Tracker|{{Pkg|tracker}}}}<br />
<br />
=== Disk cleaning ===<br />
* {{App|[[Wikipedia:BleachBit|BleachBit]]|It frees disk space and guards your privacy; frees cache, deletes cookies, clears Internet history, shreds temporary files, deletes logs, and discards junk you didn't know was there.|http://bleachbit.sourceforge.net/|{{Pkg|bleachbit}} {{AUR|bleachbit-git}}}}<br />
* {{App|[[Wikipedia:fdupes|fdupes]]|a program for identifying or deleting duplicate files residing within specified directories|https://github.com/adrianlopezroche/fdupes|{{Pkg|fdupes}}}}<br />
* {{App|[http://www.pixelbeat.org/fslint/ fslint]|A utility to find and clean various forms of lint on a filesystem|https://github.com/pixelb/fslint|{{AUR|fslint}}}}<br />
* {{App|gconf-cleaner|cleans up the unknown/invalid gconf keys that still sitting down on your gconf database|https://code.google.com/archive/p/gconf-cleaner/|{{AUR|gconf-cleaner}}}}<br />
* {{App|rmlint|Tool to quickly find (and optionally remove) duplicate files and other lint|https://rmlint.readthedocs.org/en/latest/|{{Pkg|rmlint}}}}<br />
<br />
=== Disk usage display ===<br />
<br />
* {{App|[[Wikipedia:Disk Usage Analyzer|Disk Usage Analyzer]] (Baobab)|Disk usage analyzer for the [[GNOME]] desktop.|http://www.marzocca.net/linux/baobab|{{Pkg|baobab}}}}<br />
* {{App|duc|A library and suite of tools for inspecting disk usage.|http://duc.zevv.nl/|{{AUR|duc}}}}<br />
* {{App|[[Wikipedia:Filelight|Filelight]]|Disk usage analyzer that creates an interactive map of concentric, segmented rings that help visualise disk usage on your computer.|http://methylblue.com/filelight/|{{Pkg|filelight}}}}<br />
* {{App|GdMap|Disk usage analyzer that draws a map of rectangles sized according to file or dir sizes.|http://gdmap.sourceforge.net/|{{Pkg|gdmap}}}}<br />
* {{App|gt5|Diff-capable "du-browser".|http://gt5.sourceforge.net|{{AUR|gt5}}}}<br />
* {{App|ncdu|Simple ncurses disk usage analyzer.|http://dev.yorhel.nl/ncdu|{{Pkg|ncdu}}}}<br />
* {{App|qdirstat|Qt-based directory statistics (KDirStat/K4DirStat without any KDE - from the original KDirStat author).|https://github.com/shundhammer/qdirstat|{{AUR|qdirstat}}}}<br />
<br />
=== Clock synchronization ===<br />
<br />
See [[Time#Time synchronization]].<br />
<br />
=== System monitoring ===<br />
<br />
See also [[:Category:Status monitoring and notification]]<br />
<br />
* {{App|[[Conky]]|Lightweight, scriptable system monitor.|https://github.com/brndnmtthws/conky|{{Pkg|conky}}}}<br />
* {{App|Collectd|A simple, extensible system monitoring daemon based on [http://oss.oetiker.ch/rrdtool/ rrdtool]. It has a small footprint and can be set up either stand-alone or as a server/client application.|https://collectd.org/|{{Pkg|collectd}}}}<br />
* {{App|collectl|Collectl is a light-weight performance monitoring tool capable of reporting interactively as well as logging to disk. It reports statistics on cpu, disk, infiniband, lustre, memory, network, nfs, process, quadrics, slabs and more in easy to read format.|http://collectl.sourceforge.net/|{{AUR|collectl}}}}<br />
* {{App|dstat|Versatile resource statistics tool.|http://dag.wieers.com/home-made/dstat/|{{Pkg|dstat}} or {{aur|dstat-py3}}}}<br />
* {{App|[[Fsniper]]|Daemon to run scripts based on changes in files monitored by inotify.|http://projects.l3ib.org/fsniper/|{{AUR|fsniper}}}}<br />
* {{App|[[Wikipedia:GKrellM|GKrellM]]|Simple, flexible system monitor package for [[GTK+]] with many plug-ins.|http://billw2.github.io/gkrellm/gkrellm.html|{{Pkg|gkrellm}}}}<br />
* {{App|glances|CLI curses-based monitoring tool in Python.|http://nicolargo.github.io/glances|{{pkg|glances}}}}<br />
* {{App|gnome-system-monitor|A system monitor for [[GNOME]].|https://help.gnome.org/users/gnome-system-monitor/|{{Pkg|gnome-system-monitor}} {{aur|gnome-system-monitor-gtk2}}}}<br />
* {{App|[[Wikipedia:Htop|htop]]|Simple, ncurses interactive process viewer.|http://htop.sourceforge.net/|{{Pkg|htop}}}}<br />
* {{App|[[Wikipedia:KDE System Guard|KSysGuard]]|Also known as KSysguard, is the [[KDE]] task manager and performance monitor.|https://userbase.kde.org/KSysGuard|{{Pkg|ksysguard}} or as part of {{AUR|kdebase-workspace}}}}<br />
* {{App|linux process explorer|Graphical process explorer for Linux.|https://sourceforge.net/projects/procexp/|{{aur|procexp}}}}<br />
* {{App|LXTask|Lightweight task manager for [[LXDE]].|http://wiki.lxde.org/en/LXTask|{{Pkg|lxtask}}}}<br />
* {{app|mate-system-monitor|A GTK2 system monitor for [[MATE]].|https://github.com/mate-desktop/mate-system-monitor|{{pkg|mate-system-monitor}}}}<br />
* {{App|netdata|A web-based real-time performance monitor|https://github.com/firehol/netdata/wiki|{{Pkg|netdata}}}}<br />
* {{app|Task Manager|GTK2 process mangement application for [[Xfce]].|http://goodies.xfce.org/projects/applications/xfce4-taskmanager|{{pkg|xfce4-taskmanager}}}}<br />
* {{app|[[Telegraf]]|Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.|https://docs.influxdata.com/telegraf/latest/|{{AUR|telegraf}}}}<br />
* {{App|[[Paramano]]|A light battery monitor and a CPU frequency scaler. Forked from [http://trayfreq.sourceforge.net/ trayfreq]|https://github.com/phillid/paramano|{{AUR|paramano}}}}<br />
* {{app|Sysstat|A collection of resource monitoring tools: iostat, isag, mpstat, pidstat, sadf, sar.|http://pagesperso-orange.fr/sebastien.godard/|{{Pkg|sysstat}}}}<br />
* {{App|xosview|A system monitor that resembles gr_osview from SGI IRIX|http://www.pogo.org.uk/~mark/xosview/|{{AUR|xosview}}}}<br />
<br />
=== System information viewers ===<br />
<br />
==== Console ====<br />
<br />
* {{App|alsi|A system information tool for Arch Linux. It can be configured for every other system without even touching the source code of the script.|http://trizenx.blogspot.ro/2012/08/alsi.html|{{AUR|alsi}}}}<br />
* {{App|archey2|Simple python script that displays the arch logo and some basic information. Python 2.x version.|https://github.com/djmelik/archey|{{AUR|archey2}}}}<br />
* {{App|[[archey3]]|Python script to display system infomation alongside the Arch Linux logo.|https://lclarkmichalek.github.io/archey3|{{pkg|archey3}}}}<br />
* {{App|dmidecode|It reports information about your system's hardware as described in your system BIOS according to the SMBIOS/DMI standard.|http://www.nongnu.org/dmidecode/|{{Pkg|dmidecode}}}}<br />
* {{App|hwdetect|Simple script to list modules that are exported in {{ic|/sys/}}.|https://projects.archlinux.org/|{{pkg|hwdetect}}}}<br />
* {{App|hwinfo|Powerful hardware detection tool come from openSUSE.|https://github.com/openSUSE/hwinfo|{{pkg|hwinfo}}}}<br />
* {{App|inxi|A script to get system information.|https://github.com/smxi/inxi|{{AUR|inxi}}}}<br />
* {{App|neofetch|A fast, highly customizable system info script that supports displaying images with w3m.|https://github.com/dylanaraps/neofetch|{{AUR|neofetch-git}}}}<br />
* {{App|screenfetch|Similar to archey but has an option to take a screenshot. Written in bash.|https://github.com/KittyKatt/screenFetch|{{Pkg|screenfetch}}}}<br />
<br />
==== Graphical ====<br />
<br />
* {{App|hardinfo|A small application that displays information about your hardware and operating system, it looks like the Device Manager in Windows.|http://hardinfo.berlios.de/HomePage|{{Pkg|hardinfo}}}}<br />
* {{App|i-Nex|An application that gathers information for hardware components available on your system and displays it using an user interface similar to the popular Windows tool CPU-Z.|http://i-nex.linux.pl/|{{AUR|i-nex-git}}}}<br />
* {{App|lshw|A small tool to provide detailed information on the hardware configuration of the machine with CLI and GTK interfaces.|http://ezix.org/project/wiki/HardwareLiSter|{{Pkg|lshw}}}}<br />
* {{App|KDE Info Center|Shows hardware and software information.|https://www.kde.org/applications/system/kinfocenter/|{{Pkg|kinfocenter}}}}<br />
<br />
=== Keyboard layout switchers ===<br />
<br />
* {{App|fbxkb|A NETWM compliant keyboard indicator and switcher. It shows a flag of current keyboard in a systray area and allows you to switch to another one.|http://fbxkb.sourceforge.net/|{{AUR|fbxkb}}}}<br />
* {{App|xxkb|A lightweight keyboard layout indicator and switcher.|https://sourceforge.net/projects/xxkb/|{{Pkg|xxkb}}}}<br />
* {{App|qxkb|A keyboard switcher written in Qt.|https://github.com/disels/qxkb|{{AUR|qxkb}}}}<br />
* {{App|[[Wikipedia:X Neural Switcher|X Neural Switcher]]|A text analyser, it detects the language of the input and corrects the keyboard layout if needed.|http://www.xneur.ru/|{{AUR|xneur}}, {{AUR|gxneur}} (GUI)}}<br />
<br />
=== Power management ===<br />
<br />
See [[Power management]].<br />
<br />
=== Clipboard managers ===<br />
<br />
See: [[Clipboard#List of clipboard managers|List of clipboard managers]].<br />
<br />
=== Package management ===<br />
<br />
See [[pacman tips#Utilities]].<br />
<br />
=== Input methods ===<br />
<br />
See the main article: [[Internationalization#Input methods in Xorg]].<br />
<br />
=== Version control systems ===<br />
<br />
See also [[Wikipedia:Comparison of revision control software]].<br />
<br />
* {{App|[[Bazaar]]|Distributed version control system that helps you track project history over time and to collaborate easily with others.|https://bazaar.canonical.com/|{{Pkg|bzr}}}}<br />
* {{App|[[Wikipedia:Darcs|Darcs]]|Distributed revision control system that was designed to replace traditional, centralized source control systems such as CVS and Subversion.|http://darcs.net/|{{Pkg|darcs}}}}<br />
* {{App|[[Git]]|Distributed revision control and source code management system with an emphasis on speed.|https://git-scm.com/|{{Pkg|git}}}}<br />
* {{App|[[Mercurial]]|Distributed version control system written in Python and similar in many ways to Git.|https://www.mercurial-scm.org/|{{Pkg|mercurial}}}}<br />
* {{App|[[Subversion]]|Full-featured centralized version control system originally designed to be a better CVS.|https://subversion.apache.org/|{{Pkg|subversion}}}}</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=XDG_Base_Directory&diff=512054XDG Base Directory2018-02-25T22:25:55Z<p>GenkiSky: /* Supported */ Add rTorrent</p>
<hr />
<div>[[Category:Dotfiles]]<br />
[[ja:XDG Base Directory サポート]]<br />
{{Related articles start}}<br />
{{Related|dotfiles}}<br />
{{Related|XDG user directories}}<br />
{{Related articles end}}<br />
This article exists to catalog the growing set of software using the [http://standards.freedesktop.org/basedir-spec/latest/ XDG Base Directory Specification] introduced in 2003. This is here to demonstrate the viability of this specification by listing commonly found dotfiles and their support status. For those not currently supporting the Base Directory Specification, workarounds will be demonstrated to emulate it instead.<br />
<br />
The workarounds will be limited to anything not involving patching the source, executing code stored in [[environment variables]] or compile-time options. The rationale for this is that configurations should be portable across systems and having compile-time options prevent that.<br />
<br />
Hopefully this will provide a source of information about exactly what certain kinds of dotfiles are and where they come from.<br />
<br />
==XDG Base Directory specification==<br />
<br />
Please read the [http://standards.freedesktop.org/basedir-spec/latest/ full specification]. This section will attempt to break down the essence of what it tries to achieve.<br />
<br />
Only {{ic|XDG_RUNTIME_DIR}} is set by default through [http://www.freedesktop.org/software/systemd/man/pam_systemd.html pam_systemd]. It is up to the user to explicitly [[define]] the other variables, using absolute paths that point to existing directories.<br />
<br />
===User directories===<br />
<br />
* {{ic|XDG_CONFIG_HOME}}<br />
** Where user-specific configurations should be written (analogous to {{ic|/etc}}).<br />
** Should default to {{ic|$HOME/.config}}.<br />
<br />
* {{ic|XDG_CACHE_HOME}}<br />
** Where user-specific non-essential (cached) data should be written (analogous to {{ic|/var/cache}}).<br />
** Should default to {{ic|$HOME/.cache}}.<br />
<br />
* {{ic|XDG_DATA_HOME}}<br />
** Where user-specific data files should be written (analogous to {{ic|/usr/share}}).<br />
** Should default to {{ic|$HOME/.local/share}}.<br />
<br />
* {{ic|XDG_RUNTIME_DIR}}<br />
** Used for non-essential, user-specific data files such as sockets, named pipes, etc.<br />
** Not required to have a default value; warnings should be issued if not set or equivalents provided.<br />
** Must be owned by the user with an access mode of {{ic|0700}}.<br />
** Filesystem fully featured by standards of OS.<br />
** Must be on the local filesystem.<br />
** May be subject to periodic cleanup.<br />
** Modified every 6 hours or set sticky bit if persistence is desired.<br />
** Can only exist for the duration of the user's login.<br />
** Should not store large files as it may be mounted as a tmpfs.<br />
<br />
===System directories===<br />
<br />
* {{ic|XDG_DATA_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/usr/local/share:/usr/share}}.<br />
<br />
* {{ic|XDG_CONFIG_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/etc/xdg}}.<br />
<br />
==Contributing==<br />
<br />
When contributing make sure to use the correct section.<br />
<br />
Nothing should require code evaluation (such as [[vim]] and {{ic|VIMINIT}}), patches or compile-time options to gain support and anything which does must be deemed hardcoded. Additionally if the process is too error prone or difficult, such as [https://www.haskell.org/cabal/ Haskell's cabal] or Eclipse, they should also be considered as hardcoded.<br />
<br />
* The first column should be the project name, ideally the command name if it is not ambiguous, linked to their website or an appropriate internal wiki article.<br />
<br />
* The second column is for any legacy files and directories the project had (one per line), this is done so people can find them even if they are no longer read.<br />
<br />
* In the third, try to find the commit or version a project switched to XDG Base Directory or any open discussions and include them in the next two columns (two per line).<br />
<br />
* The last column should include any appropriate workarounds or solutions. Please verify that your solution is correct and functional.<br />
<br />
==Supported==<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| [https://github.com/SirCmpwn/aerc aerc]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [https://github.com/Antimicro/antimicro/ antimicro]<br />
| {{ic|~/.antimicro}}<br />
| [https://github.com/Antimicro/antimicro/commit/edba864 edba864]<br />
| [https://github.com/Antimicro/antimicro/issues/5]<br />
|<br />
|-<br />
| [[aria2]]<br />
| {{ic|~/.aria2}}<br />
| [https://github.com/tatsuhiro-t/aria2/commit/8bc1d37 8bc1d37]<br />
| [https://github.com/tatsuhiro-t/aria2/issues/27]<br />
|<br />
|-<br />
| [http://littlesvr.ca/asunder/ Asunder]<br />
| {{ic|~/.asunder}}<br />
<br />
{{ic|~/.asunder_album_artist}}<br />
<br />
{{ic|~/.asunder_album_genre}}<br />
<br />
{{ic|~/.asunder_album_title}}<br />
| [https://littlesvr.ca/bugs/show_bug.cgi?id=31 2.9.0]<br />
| [https://littlesvr.ca/bugs/show_bug.cgi?id=52]<br />
| Uses {{ic|XDG_CONFIG_HOME/asunder/asunder}} for {{ic|~/.asunder}} and {{ic|XDG_CACHE_HOME/asunder/asunder_album_...}} for the other 3 files. Legacy paths are not removed after migration, they have to be deleted manually.<br />
|-<br />
| [[blender]]<br />
| {{ic|~/.blender}}<br />
| [http://git.blender.org/gitweb/gitweb.cgi/blender.git/commit/4293f473 4293f473]<br />
| [https://developer.blender.org/T28943]<br />
|<br />
|-<br />
| [https://github.com/falconindy/burp burp]<br />
|<br />
| [https://github.com/falconindy/burp/commit/f2388e9 f2388e9]<br />
|<br />
|<br />
|-<br />
| [[chromium]]<br />
| {{ic|~/.chromium}}<br />
| [https://src.chromium.org/viewvc/chrome?revision=23057&view=revision 23057]<br />
| [https://groups.google.com/forum/#!topic/chromium-dev/QekVQxF3nho] [https://code.google.com/p/chromium/issues/detail?id=16976]<br />
|<br />
|-<br />
| [http://citra-emu.org/ citra]<br />
| {{ic|~/.citra-emu}}<br />
| [https://github.com/citra-emu/citra/commit/f7c3193fec f7c3193fec]<br />
| [https://github.com/citra-emu/citra/pull/575]<br />
|<br />
|-<br />
| [[PHP#Composer|composer]]<br />
| {{ic|~/.composer}}<br />
| [https://github.com/composer/composer/releases/tag/1.0.0-beta1 1.0.0-beta1]<br />
| [https://github.com/composer/composer/pull/1407]<br />
|<br />
|-<br />
| [https://github.com/falconindy/cower cower]<br />
|<br />
| [https://github.com/falconindy/cower/commit/8b70805 8b70805]<br />
|<br />
|<br />
|-<br />
| [https://wiki.gnome.org/Apps/DFeet d-feet]<br />
| {{ic|~/.d-feet}}<br />
| [https://git.gnome.org/browse/d-feet/commit/?id==7f6104b 7f6104b]<br />
|<br />
|<br />
|-<br />
| [https://wiki.gnome.org/dconf dconf]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[Dolphin emulator|dolphin-emu]]<br />
| {{ic|~/.dolphin-emu}}<br />
| [https://github.com/dolphin-emu/dolphin/commit/a498c68 a498c68]<br />
| [https://github.com/dolphin-emu/dolphin/pull/2304]<br />
|<br />
|-<br />
| [http://dr14tmeter.sourceforge.net dr14-meter]<br />
| <br />
| [https://github.com/simon-r/dr14_t.meter/commit/7e777ca645298ec898b3c76e3ec472ed6ed43e8a 7e777ca64]<br />
| [https://github.com/simon-r/dr14_t.meter/pull/30]<br />
| Hardcoded {{ic|$HOME/.config/dr14meter}}<br />
|-<br />
| [http://www.knopwob.org/dunst/index.html dunst]<br />
|<br />
| [https://github.com/knopwob/dunst/commit/78b6e2b1 78b6e2b1]<br />
| [https://github.com/knopwob/dunst/issues/22]<br />
|<br />
|-<br />
| [[dwb]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[fish]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[fontconfig]]<br />
| {{ic|~/.fontconfig}}<br />
<br />
{{ic|~/.fonts}}<br />
| [http://cgit.freedesktop.org/fontconfig/commit/?id=8c255fb1 8c255fb1]<br />
|<br />
| Use {{ic|"$XDG_DATA_HOME"/fonts}} to store fonts instead.<br />
|-<br />
| [http://fontforge.github.io/ fontforge]<br />
| {{ic|~/.FontForge}}<br />
<br />
{{ic|~/.PfaEdit}}<br />
| [https://github.com/fontforge/fontforge/commit/e4c2cc7432 e4c2cc7432]<br />
| [https://github.com/fontforge/fontforge/issues/847] [https://github.com/fontforge/fontforge/issues/991]<br />
|<br />
|-<br />
| [http://www.freerdp.com/ freerdp]<br />
| {{ic|~/.freerdp}}<br />
| [https://github.com/FreeRDP/FreeRDP/commit/edf6e7258d edf6e7258d]<br />
|<br />
|<br />
|-<br />
| [[Gajim]]<br />
| {{ic|~/.gajim}}<br />
| [https://dev.gajim.org/gajim/gajim/commit/3e777ea8f120dc58d4e65ce501ab3ab3785a5d40 3e777ea]<br />
| [https://dev.gajim.org/gajim/gajim/issues/2149]<br />
|<br />
|-<br />
| [https://projects.gnome.org/gconf gconf]<br />
| {{ic|~/.gconf}}<br />
| [https://git.gnome.org/browse/gconf/commit/?id=fc28caa7 fc28caa7]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=674803]<br />
|<br />
|-<br />
| [[GIMP]]<br />
| {{ic|~/.gimp-x.y}}<br />
{{ic|~/.thumbnails}}<br />
| [https://git.gnome.org/browse/gimp/commit/?id=60e0cfe 60e0cfe] [https://git.gnome.org/browse/gimp/commit/?id=483505f 483505f]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=166643] [https://bugzilla.gnome.org/show_bug.cgi?id=646644]<br />
|<br />
|-<br />
| [[git]]<br />
| {{ic|~/.gitconfig}}<br />
| [https://github.com/git/git/commit/0d94427e 0d94427e]<br />
|<br />
|<br />
|-<br />
| [http://gstreamer.freedesktop.org/ gstreamer]<br />
| {{ic|~/.gstreamer-0.10}}<br />
| [http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=4e36f93924cf 4e36f93924cf]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=518597]<br />
|<br />
|-<br />
| [[gtk|gtk3]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [http://hisham.hm/htop/ htop]<br />
| {{ic|~/.htoprc}}<br />
| [https://github.com/hishamhm/htop/commit/93233a67 93233a67]<br />
|<br />
|<br />
|-<br />
| [[i3]]<br />
| {{ic|~/.i3}}<br />
| [http://code.stapelberg.de/git/i3/commit/?id=7c130fb54 7c130fb54]<br />
|<br />
|<br />
|-<br />
| [http://i3wm.org/i3status/ i3status]<br />
| {{ic|~/.i3status.conf}}<br />
| [http://code.stapelberg.de/git/i3status/commit/?id=c3f7fc4994 c3f7fc4994]<br />
|<br />
|<br />
|-<br />
| [http://www.imagemagick.org/script/index.php imagemagick]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[inkscape]]<br />
| {{ic|~/.inkscape}}<br />
| [http://wiki.inkscape.org/wiki/index.php/Release_notes/0.47#Preferences 0.47]<br />
| [https://bugs.launchpad.net/inkscape/+bug/199720]<br />
|<br />
|-<br />
| [https://www.ctan.org/pkg/latexmk?lang=en latexmk]<br />
| {{ic|~/.latexmkrc}}<br />
|<br />
|<br />
|<br />
|-<br />
| [http://lftp.yar.ru/ lftp]<br />
| {{ic|~/.lftp}}<br />
| [https://github.com/lavv17/lftp/commit/21dc400 21dc400]<br />
| [https://www.mail-archive.com/lftp@uniyar.ac.ru/msg04301.html]<br />
|<br />
|-<br />
| [https://github.com/Sude-/lgogdownloader/ lgogdownloader]<br />
| {{ic|~/.gogdownloader}}<br />
| [https://github.com/Sude-/lgogdownloader/commit/d430af63d000 d430af63d000]<br />
| [https://github.com/Sude-/lgogdownloader/issues/4]<br />
|<br />
|-<br />
| [[LibreOffice]]<br />
|<br />
| [https://cgit.freedesktop.org/libreoffice/ure/commit/?id=a6f56f70a4930d3f71bd9c9b90fdd0ba20e4da5f a6f56f70] [https://cgit.freedesktop.org/libreoffice/bootstrap/commit/?id=25bd2eec77ed774a37d1cddd0d72312e23d5e9fd 25bd2eec]<br />
| [https://bugs.documentfoundation.org/show_bug.cgi?id=32263]<br />
|<br />
|-<br />
| [[livestreamer]]<br />
| {{ic|~/.livestreamerrc}}<br />
| [https://github.com/chrippa/livestreamer/commit/ea805917 ea805917]<br />
| [https://github.com/chrippa/livestreamer/pull/106]<br />
|<br />
|-<br />
| [[llpp]]<br />
|<br />
| [http://repo.or.cz/w/llpp.git/commit/3ab86f0cb 3ab86f0cb]<br />
|<br />
| Currently llpp places the configuration directly under {{ic|XDG_CONFIG_HOME}} instead of creating a directory.<br />
|-<br />
| [[mc]]<br />
| {{ic|~/.mc}}<br />
| [https://www.midnight-commander.org/changeset/1b9957058 1b9957058] [https://www.midnight-commander.org/changeset/0b7115647 0b7115647]<br />
<br />
[https://www.midnight-commander.org/changeset/ce401d797 ce401d797]<br />
| [https://www.midnight-commander.org/ticket/1851]<br />
|<br />
|-<br />
| [[Mercurial]]<br />
| {{ic|~/.hgrc}}<br />
| [https://www.mercurial-scm.org/repo/hg/rev/354020079723 354020079723] [https://www.mercurial-scm.org/wiki/Release4.2 4.2]<br />
|<br />
| {{ic|XDG_CONFIG_HOME/hg/hgrc}}.<br />
|-<br />
| [https://www.mesa3d.org/ mesa]<br />
|<br />
| [https://cgit.freedesktop.org/mesa/mesa/commit/?id=87ab26b2ab35a29d446ae66f1795d40c184c0739 87ab26b2ab]<br />
|<br />
| {{ic|XDG_CACHE_HOME/mesa}}<br />
|-<br />
| [http://milkytracker.org/ milkytracker]<br />
| {{ic|~/.milkytracker_config}}<br />
| [https://github.com/Deltafire/MilkyTracker/commit/eb487c55 eb487c55]<br />
| [https://github.com/Deltafire/MilkyTracker/issues/12]<br />
|<br />
|-<br />
| [https://github.com/mintty/mintty mintty]<br />
| {{ic|~/.minttyrc}}<br />
| [https://github.com/mintty/mintty/commit/cff1bd8f cff1bd8f] v2.3.7.<br />
| [https://github.com/mintty/mintty/issues/525]<br />
|-<br />
| [[mpd]]<br />
| {{ic|~/.mpdconf}}<br />
| [http://git.musicpd.org/cgit/master/mpd.git/commit/?id=87b73284 87b73284]<br />
|<br />
|<br />
|-<br />
| [[mpv]]<br />
| {{ic|~/.mpv}}<br />
| [https://github.com/mpv-player/mpv/commit/cb250d490 cb250d490]<br />
| [https://github.com/mpv-player/mpv/pull/864]<br />
|<br />
|-<br />
| [[mutt]]<br />
| {{ic|~/.mutt}}<br />
| [https://dev.mutt.org/trac/changeset/42fee7585f 42fee7585f]<br />
| [http://dev.mutt.org/trac/ticket/3207]<br />
|<br />
|-<br />
| [http://mypaint.intilinux.com/ mypaint]<br />
| {{ic|~/.mypaint}}<br />
| [https://github.com/mypaint/mypaint/commit/cf723b74cd cf723b74cd]<br />
|<br />
|<br />
|-<br />
| [[nano]]<br />
| {{ic|~/.nano/}} {{ic|~/.nanorc}}<br />
| [http://git.savannah.gnu.org/cgit/nano.git/commit/?id=c16e79b612eb8e061a4bd0b5f187c37a036fc403 036fc403]<br />
| [https://savannah.gnu.org/patch/?8523]<br />
|<br />
|-<br />
| [[ncmpcpp]]<br />
| {{ic|~/.ncmpcpp}}<br />
| [https://github.com/arybczak/ncmpcpp/commit/38d9f811de888e512b0115f551a9679eab4607f9 38d9f811] [https://github.com/arybczak/ncmpcpp/commit/27cd86e0638bba3a7a78e44ac40dc98a58d1d90d 27cd86e0]<br />
| [https://github.com/arybczak/ncmpcpp/issues/79] [https://github.com/arybczak/ncmpcpp/issues/110]<br />
| {{ic|ncmpcpp_directory}} should be set to avoid an {{ic|error.log}} file in {{ic|~/.ncmpcpp}}.<br />
|-<br />
| [[neovim]]<br />
| {{ic|~/.nvim}}<br />
<br />
{{ic|~/.nvimlog}}<br />
<br />
{{ic|~/.nviminfo}}<br />
| [https://github.com/neovim/neovim/commit/1ca5646bb 1ca5646bb]<br />
| [https://github.com/neovim/neovim/issues/78] [https://github.com/neovim/neovim/pull/3198]<br />
|<br />
|-<br />
| [[newsbeuter]]<br />
| {{ic|~/.newsbeuter}}<br />
| [https://github.com/akrennmair/newsbeuter/commit/3c57824c5 3c57824c5]<br />
| [https://github.com/akrennmair/newsbeuter/pull/39]<br />
| It is required to create both directories [http://newsbeuter.org/doc/newsbeuter.html#_xdg_base_directory_support]:<br />
<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/newsbeuter "$XDG_CONFIG_HOME"/newsbeuter}}<br />
|-<br />
| [[NVIDIA]]<br />
| {{ic|~/.nv}}<br />
|<br />
|<br />
|<br />
|-<br />
| [[OfflineIMAP]]<br />
| {{ic|~/.offlineimaprc}}<br />
| [https://github.com/OfflineIMAP/offlineimap/commit/5150de5 5150de5]<br />
| [https://github.com/OfflineIMAP/offlineimap/issues/32]<br />
|<br />
|-<br />
| [https://bitbucket.org/opentyrian/opentyrian/wiki/Home opentyrian]<br />
| {{ic|~/.opentyrian}}<br />
| [https://bitbucket.org/opentyrian/opentyrian/commits/8d45ff2 8d45ff2]<br />
| [https://web.archive.org/web/20140815181350/http://code.google.com/p/opentyrian/issues/detail?id=125]<br />
|<br />
|-<br />
| [http://pcsx2.net/ pcsx2]<br />
| {{ic|~/.pcsx2}}<br />
| [https://github.com/PCSX2/pcsx2/commit/87f1e8f77 87f1e8f77] [https://github.com/PCSX2/pcsx2/commit/a9020c606 a9020c606]<br />
<br />
[https://github.com/PCSX2/pcsx2/commit/3b22f0fb0 3b22f0fb0] [https://github.com/PCSX2/pcsx2/commit/0a012aec2 0a012aec2]<br />
| [https://github.com/PCSX2/pcsx2/issues/352] [https://github.com/PCSX2/pcsx2/issues/381]<br />
|<br />
|-<br />
| [https://pip.pypa.io/ pip]<br />
| {{ic|~/.pip}}<br />
| [https://github.com/pypa/pip/blob/548a9136525815dff41acd845c558a0b36eb1c5f/NEWS.rst#60-2014-12-22 6.0]<br />
| [https://github.com/pypa/pip/issues/1733]<br />
|<br />
|-<br />
| [http://www.ppsspp.org/ ppsspp]<br />
| {{ic|~/.ppsspp}}<br />
| [https://github.com/hrydgard/ppsspp/commit/132fe47c7d 132fe47c7d]<br />
| [https://github.com/hrydgard/ppsspp/issues/4623]<br />
|<br />
|-<br />
| {{pkg|procps-ng}}<br />
| {{ic|~/.toprc}}<br />
| [https://gitlab.com/procps-ng/procps/commit/af53e170b9 af53e170b9]<br />
| [https://gitlab.com/procps-ng/procps/merge_requests/38] [https://bugzilla.redhat.com/show_bug.cgi?id=1155265]<br />
|<br />
|-<br />
| [https://github.com/Cloudef/orbment/ orbment]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[pacman]]<br />
| {{ic|~/.makepkg.conf}}<br />
| [https://projects.archlinux.org/pacman.git/commit/?id=80eca94c8 80eca94c8]<br />
| [https://mailman.archlinux.org/pipermail/pacman-dev/2014-July/019178.html]<br />
|<br />
|-<br />
| [https://github.com/panda3d/panda3d Panda3D]<br />
| {{ic|~/.panda3d}}<br />
| [https://github.com/panda3d/panda3d/commit/2b537d2 2b537d2]<br />
|<br />
|<br />
|-<br />
| [[PulseAudio]]<br />
| {{ic|~/.pulse}}<br />
<br />
{{ic|~/.pulse-cookie}}<br />
| [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=59a8618dcd9 59a8618dcd9] [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=87ae8307057 87ae8307057]<br />
<br />
[http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=9ab510a6921 9ab510a6921] [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=4c195bcc9d5 4c195bcc9d5]<br />
| [https://bugzilla.redhat.com/show_bug.cgi?id=845607]<br />
|<br />
|-<br />
| [http://pyroom.org/index.html pyroom]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[qutebrowser]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[qtile]]<br />
|<br />
| [https://github.com/qtile/qtile/commit/fd8686e5b4e4fa20bb82039ed8a83768434585ec fd8686e] [https://github.com/qtile/qtile/commit/66d704bce83f631b3326f10a1bc9fc22f8e6a6fd 66d704b]<br />
<br />
[https://github.com/qtile/qtile/commit/51cff019917b87bda696b381493f969ceb6cc350 51cff01]<br />
| [https://github.com/qtile/qtile/pull/835]<br />
| Some optional bar widgets can create files and directories in non-compliant paths, but most often these are still configurable.<br />
|-<br />
| {{Pkg|rclone}}<br />
| {{ic|~/.rclone.conf}}<br />
| [https://github.com/ncw/rclone/commit/9d362589 9d362589]<br />
| [https://github.com/ncw/rclone/issues/868]<br />
|<br />
|-<br />
| [http://www.libretro.com/ retroarch]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [http://rr-project.org/ rr]<br />
| {{ic|~/.rr}}<br />
| [https://github.com/mozilla/rr/commit/02e7d41e 02e7d41e]<br />
| [https://github.com/mozilla/rr/issues/1455]<br />
|<br />
|-<br />
| [[rTorrent]]<br />
| {{ic|~/.rtorrent.rc}}<br />
| [https://github.com/rakshasa/rtorrent/commit/6a8d332b 6a8d332b]<br />
|<br />
|-<br />
| [https://www.skype.com/ Skype]<br />
| {{ic|~/.Skype}}<br />
| 8.0<br />
|<br />
|<br />
|-<br />
| [http://www.snes9x.com/ Snes9x]<br />
| {{ic|~/.snes9x}}<br />
| [https://github.com/snes9xgit/snes9x/commit/93b5f11641fa22d4518f251d6e3db99219864677 19864677]<br />
| [https://github.com/snes9xgit/snes9x/issues/194]<br />
| By default configuration is blank, is intended that the user fill it at they will (throw the gui or manually) before launch a rom<br />
|-<br />
| {{AUR|sublime-text-dev}}<br />
|<br />
|<br />
|<br />
| Cache is placed in {{ic|$XDG_CONFIG_HOME/sublime-text-3/Cache}} instead of expected {{ic|$XDG_CACHE_HOME/sublime-text-3}}.<br />
|-<br />
| [[surfraw]]<br />
| {{ic|~/.surfraw.conf}}<br />
<br />
{{ic|~/.surfraw.bookmarks}}<br />
| [http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=3e4591d8 3e4591d8] [http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=bd8c427d bd8c427d]<br />
<br />
[http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=f57fc718 f57fc718]<br />
|<br />
|<br />
|-<br />
| [[sway]]<br />
| {{ic|~/.sway/config}}<br />
| [https://github.com/SirCmpwn/sway/commit/614393c09 614393c09]<br />
| [https://github.com/SirCmpwn/sway/issues/5]<br />
|<br />
|-<br />
| [[systemd]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[termite]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [https://github.com/tmuxinator/tmuxinator tmuxinator]<br />
| {{ic|~/.tmuxinator}}<br />
| [https://github.com/tmuxinator/tmuxinator/pull/511/commits/263692349f1142c0edcacfbefae541cbc0e7b44e 2636923]<br />
| [https://github.com/tmuxinator/tmuxinator/pull/511]<br />
|<br />
|-<br />
| [[transmission]]<br />
| {{ic|~/.transmission}}<br />
| [https://trac.transmissionbt.com/changeset/5517 5517]<br />
| [https://trac.transmissionbt.com/ticket/684]<br />
|<br />
|-<br />
| [https://www.kernel.org/pub/linux/utils/util-linux/ util-linux]<br />
|<br />
| [http://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=570b32100 570b32100]<br />
|<br />
|<br />
|-<br />
| [[uzbl]]<br />
|<br />
| [https://github.com/uzbl/uzbl/commit/c6fd63a c6fd63a]<br />
| [https://github.com/uzbl/uzbl/pull/150]<br />
|<br />
|-<br />
| [http://fanglingsu.github.io/vimb/ vimb]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[VirtualBox]]<br />
| {{ic|~/.VirtualBox}}<br />
| [https://www.virtualbox.org/ticket/5099?action=diff&version=7 4.3]<br />
| [https://www.virtualbox.org/ticket/5099]<br />
|<br />
|-<br />
| [http://martanne.github.io/vis/ vis]<br />
| {{ic|~/.vis}}<br />
| [https://github.com/martanne/vis/pull/303]<br />
| [https://github.com/martanne/vis/commit/68a25c751c0219ef5df589a19513e46a08965d5a 68a25c75]<br />
[https://github.com/martanne/vis/commit/d138908cf8149eb10120957271cd6979272b4730 d138908c]<br />
|<br />
|-<br />
| [[VLC media player]]<br />
| {{ic|~/.vlcrc}}<br />
| [http://git.videolan.org/?p=vlc.git;a=commit;h=16f32e1500887c0dcd33cb06ad71759a81a52878 16f32e15]<br />
| [https://trac.videolan.org/vlc/ticket/1267]<br />
|<br />
|-<br />
| [https://www.warsow.gg/ warsow]<br />
| {{ic|~/.warsow-2.x}}<br />
| [https://github.com/Qfusion/qfusion/commit/98ece3f 98ece3f]<br />
| [https://github.com/Qfusion/qfusion/issues/298]<br />
|<br />
|-<br />
| [[wireshark]]<br />
| {{ic|~/.wireshark}}<br />
| [https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b0b53fa5937aa7ba258427ca0f3581dba725230d b0b53fa5]<br />
|<br />
|<br />
|-<br />
| [https://github.com/derat/xsettingsd xsettingsd]<br />
| {{ic|~/.xsettingsd}}<br />
| [https://github.com/derat/xsettingsd/commit/b4999f5e9e99224caf97d09f25ee731774ecd7be 4ecd7be]<br />
|<br />
|<br />
|-<br />
| [[xmonad]]<br />
| {{ic|~/.xmonad}}<br />
| [https://github.com/xmonad/xmonad/commit/40fc10b6a5682ce1d6ba7f0679962926ef6cfade 40fc10b6]<br />
| [https://github.com/xmonad/xmonad/issues/61] [https://code.google.com/p/xmonad/issues/detail?id=484]<br />
| Alternatively the environments {{ic|XMONAD_CONFIG_HOME}}, {{ic|XMONAD_DATA_HOME}}, and {{ic|XMONAD_CACHE_HOME}} are also available.<br />
|-<br />
| [http://www.vergenet.net/~conrad/software/xsel/ xsel]<br />
| {{ic|~/.xsel.log}}<br />
| [https://github.com/kfish/xsel/commit/ee7b48111be2e2117b201962e9d1c0e1f9804ed4 ee7b4811]<br />
| [https://github.com/kfish/xsel/issues/10]<br />
|<br />
|}<br />
<br />
==Partial==<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| [http://abook.sourceforge.net/ abook]<br />
| {{ic|~/.abook}}<br />
|<br />
|<br />
| {{ic|1=$ abook --config "$XDG_CONFIG_HOME"/abook/abookrc \<br />
--datafile "$XDG_CACHE_HOME"/abook/addressbook}}<br />
|-<br />
| [[Anki]]<br />
| {{ic|~/Anki}}<br />
<br />
{{ic|~/Documents/Anki}}<br />
|<br />
| [https://github.com/dae/anki/pull/49] [https://github.com/dae/anki/pull/58]<br />
| {{ic|1=$ anki -b "$XDG_DATA_HOME"/Anki}}<br />
|-<br />
| [[aspell]]<br />
| {{ic|~/.aspell.conf}}<br />
|<br />
|<br />
| {{ic|1=$ export ASPELL_CONF="per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; personal $XDG_CONFIG_HOME/aspell/en.pws; repl $XDG_CONFIG_HOME/aspell/en.prepl"}}<br />
|-<br />
| [[Atom]]<br />
| {{ic|~/.atom}}<br />
|<br />
| [https://github.com/atom/atom/issues/8281]<br />
| {{ic|1=$ export ATOM_HOME="$XDG_DATA_HOME"/atom}}<br />
|-<br />
| [[bazaar]]<br />
| {{ic|~/.bazaar}}<br />
<br />
{{ic|~/.bzr.log}}<br />
| [https://bugs.launchpad.net/bzr/+bug/195397/comments/15 2.3.0]<br />
| [https://bugs.launchpad.net/bzr/+bug/195397]<br />
| Discussion in upstream bug states that bazaar wil use {{ic|~/.config/bazaar}} if it exists. The logfile {{ic|~/.bzr.log}} might still be written.<br />
|<br />
|-<br />
| [[Ruby#Bundler]]<br />
| {{ic|~/.bundle}}<br />
|<br />
| [https://github.com/bundler/bundler/pull/6024] [https://github.com/bundler/bundler/issues/4333]<br />
| {{ic|1=$ export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle}}<br />
|-<br />
| [http://crates.io/ cargo]<br />
| {{ic|~/.cargo}}<br />
|<br />
| [https://github.com/rust-lang/cargo/pull/148] [https://github.com/rust-lang/cargo/issues/1734] [https://github.com/rust-lang/rfcs/pull/1615]<br />
| {{ic|1=$ export CARGO_HOME="$XDG_DATA_HOME"/cargo}}<br />
|-<br />
| [[ccache]]<br />
| {{ic|~/.ccache}}<br />
|<br />
|<br />
| {{ic|1=$ export CCACHE_DIR="$XDG_CACHE_HOME"/ccache}}<br />
|-<br />
| [https://github.com/cisco/ChezScheme ChezScheme]<br />
| {{ic|~/.chezscheme_history}}<br />
|<br />
|<br />
| {{ic|1=$ petite --eehistory "$XDG_DATA_HOME"/chezscheme/history}}<br />
|-<br />
| [[conky]]<br />
| {{ic|~/.conkyrc}}<br />
| [https://github.com/brndnmtthws/conky/commit/00481ee9a97025e8e2acd7303d080af1948f7980 00481ee]<br />
| [https://github.com/brndnmtthws/conky/issues/144]<br />
| {{ic|1=$ conky --config="$XDG_CONFIG_HOME"/conky/conkyrc}}<br />
|-<br />
| [[coreutils]]<br />
| {{ic|~/.dircolors}}<br />
|<br />
|<br />
| {{ic|1=$ source "$(dircolors "$XDG_CONFIG_HOME"/dircolors)"}}<br />
|-<br />
| [http://www.dungeoncrawl.org/ crawl]<br />
| {{ic|~/.crawl}}<br />
|<br />
|<br />
| The trailing slash is required:<br />
<br />
{{ic|1=$ export CRAWL_DIR="$XDG_DATA_HOME"/crawl/}}<br />
|-<br />
| [[CUDA]]<br />
| {{ic|~/.nv}}<br />
|<br />
|<br />
| {{ic|1=$ export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv}}<br />
|-<br />
| [[dict]]<br />
| {{ic|~/.dictrc}}<br />
|<br />
|<br />
| {{ic|1=$ dict -c "$XDG_CONFIG_HOME"/dict/dictrc}}<br />
|-<br />
| [[ELinks]]<br />
| {{ic|~/.elinks}}<br />
|<br />
|<br />
| {{ic|1=$ export ELINKS_CONFDIR="$XDG_CONFIG_HOME"/elinks}}<br />
|-<br />
| [http://kripken.github.io/emscripten-site/ emscripten]<br />
| {{ic|~/.emscripten}}<br />
<br />
{{ic|~/.emscripten_sanity}}<br />
<br />
{{ic|~/.emscripten_ports}}<br />
<br />
{{ic|~/.emscripten_cache__last_clear}}<br />
|<br />
| [https://github.com/kripken/emscripten/issues/3624]<br />
| {{ic|1=$ export EM_CONFIG="$XDG_CONFIG_HOME"/emscripten/config}}<br />
<br />
{{ic|1=$ export EM_CACHE="$XDG_CACHE_HOME"/emscripten/cache}}<br />
<br />
{{ic|1=$ export EM_PORTS="$XDG_DATA_HOME"/emscripten/cache}}<br />
<br />
{{ic|1=$ emcc --em-config "$XDG_CONFIG_HOME"/emscripten/config \<br />
--em-cache "$XDG_CACHE_HOME"/emscripten/cache}}<br />
|-<br />
| [https://www.freecadweb.org/ freecad]<br />
| {{ic|~/.FreeCAD}}<br />
|<br />
| [https://www.freecadweb.org/tracker/view.php?id=2956]<br />
| {{ic|1=$ freecad -u "$XDG_CONFIG_HOME"/FreeCAD/user.cfg -s "$XDG_CONFIG_HOME"/FreeCAD/system.cfg}}<br />
|-<br />
| [http://www.gnu.org/software/gdb/ gdb]<br />
| {{ic|~/.gdbinit}}<br />
|<br />
|<br />
| {{ic|1=$ gdb -nh -x "$XDG_CONFIG_HOME"/gdb/init}}<br />
|-<br />
| [https://github.com/get-iplayer/get_iplayer get_iplayer]<br />
| {{ic|~/.get_iplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export GETIPLAYERUSERPREFS="$XDG_DATA_HOME"/get_iplayer}}<br />
|-<br />
| [http://guichaz.free.fr/gliv/ gliv]<br />
| {{ic|~/.glivrc}}<br />
|<br />
|<br />
| {{ic|1=$ gliv --glivrc="$XDG_CONFIG_HOME"/gliv/glivrc}}<br />
|-<br />
| [[GnuPG]]<br />
| {{ic|~/.gnupg}}<br />
|<br />
| [https://bugs.gnupg.org/gnupg/issue1456] [https://bugs.gnupg.org/gnupg/issue1018]<br />
| {{ic|1=$ export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg}}<br />
<br />
{{ic|1=$ gpg2 --homedir "$XDG_CONFIG_HOME"/gnupg}}<br />
|-<br />
| [[Google Earth]]<br />
| {{ic|~/.googleearth}}<br />
|<br />
|<br />
| Some paths can be changed with the {{ic|KMLPath}} and {{ic|CachePath}} options in {{ic|~/.config/Google/GoogleEarthPlus.conf}}<br />
|-<br />
| [https://sourceforge.net/projects/gqclient GQ LDAP client]<br />
| {{ic|~/.gq}}<br />
{{ic|~/.gq-state}}<br />
| [https://sourceforge.net/p/gqclient/mailman/message/2053978 1.51]<br />
|<br />
| {{ic|1=$ export GQRC="$XDG_CONFIG_HOME"/gqrc}}<br />
<br />
{{ic|1=$ export GQSTATE="$XDG_DATA_HOME"/gq/gq-state}}<br />
<br />
{{ic|1=$ mkdir -p "$(dirname "$GQSTATE")"}}<br />
|-<br />
| [https://gradle.org/ gradle]<br />
| {{ic|~/.gradle}}<br />
|<br />
| [https://discuss.gradle.org/t/be-a-nice-freedesktop-citizen-move-the-gradle-to-the-appropriate-location-in-linux/2199]<br />
| {{ic|1=$ export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle}}<br />
|-<br />
| [[gtk]]<br />
| {{ic|~/.gtkrc}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK_RC_FILES="$XDG_CONFIG_HOME"/gtk-1.0/gtkrc}}<br />
|-<br />
| [[gtk|gtk2]]<br />
| {{ic|~/.gtkrc-2.0}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc}}<br />
|-<br />
| [http://httpie.org httpie]<br />
| {{ic|~/.httpie}}<br />
|<br />
| [https://github.com/jakubroztocil/httpie/issues/145]<br />
| {{ic|1=$ export HTTPIE_CONFIG_DIR="$XDG_CONFIG_HOME"/httpie}}<br />
|-<br />
| [http://ipython.org ipython]/[[jupyter]]<br />
| {{ic|~/.ipython}}<br />
|<br />
|<br />
| {{ic|1=$ export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter}}<br />
<br />
{{ic|1=$ export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter}}<br />
|-<br />
| [[irssi]]<br />
| {{ic|~/.irssi}}<br />
|<br />
| [https://github.com/irssi/irssi/pull/511]<br />
| {{ic|1=$ irssi --config="$XDG_CONFIG_HOME"/irssi/config \<br />
--home="$XDG_DATA_HOME"/irssi}}<br />
|-<br />
| [[isync]]<br />
| {{ic|~/.mbsyncrc}}<br />
|<br />
|<br />
| {{ic|1=$ mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc}}<br />
|-<br />
| [[Java]] (OpenJDK)<br />
| {{ic|~/.java/.userPrefs}}<br />
|<br />
|<br />
| {{ic|1=$ export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java}}<br />
|-<br />
| [[core utilities#less|less]]<br />
| {{ic|~/.lesshst}}<br />
|<br />
|<br />
| {{ic|1=$ mkdir -p "$XDG_CACHE_HOME"/less}}<br />
<br />
{{ic|1=$ export LESSHISTFILE="$XDG_CACHE_HOME"/less/history}}<br />
<br />
{{ic|1=$ export LESSHISTFILE=-}} can be used to disable this feature.<br />
<br />
{{ic|1=$ export LESSKEY="$XDG_CONFIG_HOME"/less/lesskey}}<br />
|-<br />
| [http://www.videolan.org/developers/libdvdcss.html libdvdcss]<br />
| {{ic|~/.dvdcss}}<br />
|<br />
| [https://mailman.videolan.org/pipermail/libdvdcss-devel/2014-August/001022.html]<br />
| {{ic|1=$ export DVDCSS_CACHE="$XDG_DATA_HOME"/dvdcss}}<br />
|-<br />
| [https://www.x.org/releases/current/doc/libICE/ice.html libice]<br />
| {{ic|~/.ICEauthority}}<br />
|<br />
| [https://bugs.freedesktop.org/show_bug.cgi?id=49173]<br />
| {{ic|1=$ export ICEAUTHORITY="$XDG_RUNTIME_DIR"/ICEauthority}}<br />
Be wary setting this too restrictively, e.g. {{pkg|gdm}} needs access to a user's {{ic|ICEauthority}} file.<br />
|-<br />
| [[Xorg|libx11]]<br />
| {{ic|~/.XCompose}}<br />
|<br />
|<br />
| {{ic|1=$ export XCOMPOSEFILE="$XDG_CONFIG_HOME"/X11/xcompose}}<br />
|-<br />
| [http://ltrace.org/ ltrace]<br />
| {{ic|~/.ltrace.conf}}<br />
|<br />
|<br />
| {{ic|1=$ ltrace -F "$XDG_CONFIG_HOME"/ltrace/ltrace.conf}}<br />
|-<br />
| {{pkg|maven}}<br />
| {{ic|~/.m2}}<br />
|<br />
|<br />
| {{ic|1=$ mvn -gs "$XDG_CONFIG_HOME"/maven/settings.xml}}<br />
{{hc|[http://maven.apache.org/settings.html settings.xml]|<nowiki><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"<br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0<br />
https://maven.apache.org/xsd/settings-1.0.0.xsd"><br />
...<br />
<localRepository>${env.XDG_CACHE_HOME}/maven/repository</localRepository><br />
...<br />
</settings></nowiki>}}<br />
|-<br />
| [[Mathematica]]<br />
| {{ic|~/.Mathematica}}<br />
|<br />
|<br />
| {{ic|1=$ export MATHEMATICA_USERBASE="$XDG_CONFIG_HOME"/mathematica}}<br />
|-<br />
| [http://mednafen.sourceforge.net/ mednafen]<br />
| {{ic|~/.mednafen}}<br />
|<br />
|<br />
| {{ic|1=$ export MEDNAFEN_HOME="$XDG_CONFIG_HOME"/mednafen}}<br />
|-<br />
| [[moc]]<br />
| {{ic|~/.moc}}<br />
|<br />
|<br />
| {{ic|1=$ mocp -M "$XDG_CONFIG_HOME"/moc}}<br />
<br />
{{ic|1=$ mocp -O MOCDir="$XDG_CONFIG_HOME"/moc}}<br />
|-<br />
| [[MPlayer]]<br />
| {{ic|~/.mplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer}}<br />
|-<br />
| [[msmtp]]<br />
| {{ic|~/.msmtprc}}<br />
|<br />
|<br />
| {{ic|1=$ msmtp -C "$XDG_CONFIG_HOME"/msmtp/msmtprc}}<br />
|-<br />
| [[MySQL]]<br />
| {{ic|~/.mysql_history}}<br />
|<br />
|<br />
| {{ic|1=$ export MYSQL_HISTFILE="$XDG_DATA_HOME"/mysql_history}}<br />
|-<br />
| {{pkg|ncurses}}<br />
| {{ic|~/.terminfo}}<br />
|<br />
|<br />
| Precludes system path searching:<br />
<br />
{{ic|1=$ export TERMINFO="$XDG_DATA_HOME"/terminfo}}<br />
<br />
{{ic|1=$ export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo}}<br />
|-<br />
| [http://www.musicpd.org/clients/ncmpc/ ncmpc]<br />
| {{ic|~/.ncmpc}}<br />
|<br />
|<br />
| {{ic|ncmpc -f "$XDG_CONFIG_HOME"/ncmpc/config}}<br />
|-<br />
| [[Netbeans]]<br />
| {{ic|~/.netbeans}}<br />
|<br />
| [https://netbeans.org/bugzilla/show_bug.cgi?id=215961]<br />
| {{ic|1=$ netbeans --userdir "${XDG_CONFIG_HOME}"/netbeans}}<br />
|-<br />
| [[Node.js]]<br />
| {{ic|~/.node_repl_history}}<br />
|<br />
|<br />
| {{ic|1=$ export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history}} [https://nodejs.org/api/repl.html#repl_environment_variable_options]<br />
|-<br />
| [[notmuch]]<br />
| {{ic|~/.notmuch-config}}<br />
|<br />
| [http://notmuchmail.org/pipermail/notmuch/2011/007007.html]<br />
| {{ic|1=$ export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/notmuchrc}}<br />
<br />
{{ic|1=$ export NMBGIT="$XDG_DATA_HOME"/notmuch/nmbug}}<br />
|-<br />
| {{pkg|npm}}<br />
| {{ic|~/.npm}}<br />
<br />
{{ic|~/.npmrc}}<br />
|<br />
| [https://github.com/npm/npm/issues/6675]<br />
| {{ic|1=$ export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc}}<br />
{{hc|npmrc|<nowiki><br />
prefix=${XDG_DATA_HOME}/npm<br />
cache=${XDG_CACHE_HOME}/npm<br />
tmp=${XDG_RUNTIME_DIR}/npm<br />
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js<br />
</nowiki>}}<br />
{{ic|prefix}} is unnecessary (and unsupported) if Node.js is installed by {{AUR|nvm}}.<br />
|-<br />
| [https://github.com/NVIDIA/nvidia-settings nvidia-settings]<br />
| {{ic|~/.nvidia-settings-rc}}<br />
|<br />
|<br />
| {{ic|1=$ nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings}}<br />
|-<br />
| {{AUR|nvm}}<br />
| {{ic|~/.nvm}}<br />
|<br />
|<br />
| {{ic|1=$ export NVM_DIR="$XDG_DATA_HOME"/nvm}}<br />
|-<br />
| [[Octave]]<br />
| {{ic|~/octave}}<br />
<br />
{{ic|~/.octave_packages}}<br />
<br />
{{ic|~/.octave_hist}}<br />
|<br />
|<br />
| {{ic|1=$ export OCTAVE_HISTFILE="$XDG_CACHE_HOME/octave-hsts"}}<br />
<br />
{{ic|1=$ export OCTAVE_SITE_INITFILE="$XDG_CONFIG_HOME/octave/octaverc"}}<br />
<br />
{{hc|$XDG_CONFIG_HOME/octave/octaverc|<nowiki><br />
source /usr/share/octave/site/m/startup/octaverc;<br />
pkg prefix ~/.local/share/octave/packages ~/.local/share/octave/packages;<br />
pkg local_list /home/<your username>/.local/share/octave/octave_packages;<br />
</nowiki>}}<br />
The {{ic|local_list}} option must be given an absolute path.<br />
|-<br />
| [http://www.openscad.org/ openscad]<br />
| {{ic|~/.OpenSCAD}}<br />
| [https://github.com/openscad/openscad/commit/7c3077b0f 7c3077b0f]<br />
| [https://github.com/openscad/openscad/issues/125]<br />
| Does not fully honour XDG Base Directory Specification, see [https://github.com/openscad/openscad/issues/373]<br />
<br />
Currently it [https://github.com/openscad/openscad/blob/master/src/PlatformUtils-posix.cc#L20 hard-codes] {{ic|~/.local/share}}.<br />
|-<br />
| [[OpenSSL]]<br />
| {{ic|~/.rnd}}<br />
|<br />
|<br />
| Seeding file .rnd's location can be set with RANDFILE environment variable per [https://www.openssl.org/docs/faq.html FAQ].<br />
|-<br />
| [[Pass]]<br />
| {{ic|~/.password-store}}<br />
|<br />
|<br />
| {{ic|1=$ export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass}}<br />
|-<br />
| [[Pidgin]]<br />
| {{ic|~/.purple}}<br />
|<br />
| [https://developer.pidgin.im/ticket/4911]<br />
| {{ic|1=$ pidgin --config="$XDG_DATA_HOME"/purple}}<br />
|-<br />
| [https://www.postgresql.org/ postgresql]<br />
| {{ic|~/.psqlrc}}<br />
{{ic|~/.psql_history}}<br />
<br />
{{ic|~/.pgpass}}<br />
<br />
{{ic|~/.pg_service.conf}}<br />
| 9.2<br />
| [https://www.postgresql.org/docs/current/static/app-psql.html]<br />
<br />
[https://www.postgresql.org/docs/current/static/libpq-envars.html]<br />
| {{ic|1=$ export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc"}}<br />
{{ic|1=$ export PSQL_HISTORY="$XDG_CACHE_HOME/pg/psql_history"}}<br />
<br />
{{ic|1=$ export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass"}}<br />
<br />
{{ic|1=$ export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf"}}<br />
<br />
It is required to create both directories {{ic|1=$ mkdir "$XDG_CONFIG_HOME/pg" && mkdir "$XDG_CACHE_HOME/pg"}}<br />
|-<br />
| [[PulseAudio]]<br />
| {{ic|~/.esd_auth}}<br />
|<br />
|<br />
| Very likely generated by the {{ic|module-esound-protocol-unix.so}} module. It can be configured to use a different location but it makes much more sense to just comment out this module in {{ic|/etc/pulse/default.pa}} or {{ic|"$XDG_CONFIG_HOME"/pulse/default.pa}}.<br />
|-<br />
| [https://www.pylint.org/ pylint]<br />
| {{ic|~/.pylint.d}}<br />
|<br />
| [https://github.com/PyCQA/pylint/issues/1364]<sup>won't<br />
| {{ic|1=$ export PYLINTHOME="$XDG_CACHE_HOME"/pylint}}<br />
|-<br />
| [https://pypi.python.org/pypi/setuptools python-setuptools]<br />
| {{ic|~/.python-eggs}}<br />
|<br />
|<br />
| {{ic|1=$ export PYTHON_EGG_CACHE="$XDG_CACHE_HOME"/python-eggs}}<br />
|-<br />
| [[readline]]<br />
| {{ic|~/.inputrc}}<br />
|<br />
|<br />
| {{ic|1=$ export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc}}<br />
|-<br />
| [http://utopia.knoware.nl/~hlub/uck/rlwrap/ rlwrap]<br />
| {{ic|~/.*_history}}<br />
|<br />
| [https://github.com/hanslub42/rlwrap/issues/25]<br />
| {{ic|1=$ export RLWRAP_HOME="$XDG_DATA_HOME"/rlwrap}}<br />
|-<br />
| [https://rubygems.org/ RubyGems]<br />
| {{ic|~/.gem}}<br />
|<br />
|<br />
| {{ic|1=$ export GEM_HOME="$XDG_DATA_HOME"/gem}}<br />
{{ic|1=$ export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem}}<br />
|-<br />
| [https://www.rustup.rs/ rustup]<br />
| {{ic|~/.rustup}}<br />
|<br />
| [https://github.com/rust-lang-nursery/rustup.rs/issues/247]<br />
| {{ic|1=$ export RUSTUP_HOME="$XDG_DATA_HOME"/rustup}}<br />
|-<br />
| [http://www.scala-sbt.org/ sbt]<br />
| {{ic|~/.sbt}}<br />
{{ic|~/.ivy2}}<br />
|<br />
| [https://github.com/sbt/sbt/issues/3681]<br />
| {{ic|1=$ sbt -ivy "$XDG_DATA_HOME"/ivy2 -sbt-dir "$XDG_DATA_HOME"/sbt}} (beware [https://github.com/sbt/sbt/issues/3598])<br />
|-<br />
| [[screen]]<br />
| {{ic|~/.screenrc}}<br />
|<br />
|<br />
| {{ic|1=$ export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc}}<br />
|-<br />
| [https://www.stackage.org/ stack]<br />
| {{ic|~/.stack}}<br />
|<br />
| [https://github.com/commercialhaskell/stack/issues/342]<br />
| {{ic|1=$ export STACK_ROOT="$XDG_DATA_HOME"/stack}}<br />
|-<br />
| [[subversion]]<br />
| {{ic|~/.subversion}}<br />
|<br />
| [https://issues.apache.org/jira/browse/SVN-4599] [https://mail-archives.apache.org/mod_mbox/subversion-users/201204.mbox/%3c4F8FBCC6.4080205@ritsuka.org%3e][http://mail-archives.apache.org/mod_mbox/subversion-dev/201509.mbox/%3c20150917222954.GA20331@teapot%3e]<br />
| {{ic|1=$ svn --config-dir "$XDG_CONFIG_HOME"/subversion}}<br />
|-<br />
| {{pkg|task}}<br />
| {{ic|~/.task}}<br />
<br />
{{ic|~/.taskrc}}<br />
|<br />
|<br />
| {{ic|1=$ export TASKDATA="$XDG_DATA_HOME"/task}}<br />
<br />
{{ic|1=$ export TASKRC="$XDG_CONFIG_HOME"/task/taskrc}}<br />
|-<br />
| [http://jonas.nitro.dk/tig/ tig]<br />
| {{ic|~/.tigrc}}<br />
|<br />
|<br />
| {{ic|1=$ export TIGRC_USER="$XDG_CONFIG_HOME"/tig/tigrc}}<br />
|-<br />
| [http://tiptop.gforge.inria.fr/ tiptop]<br />
| {{ic|~/.tiptoprc}}<br />
|<br />
|<br />
| This will still expect the {{ic|.tiptoprc}} file.<br />
{{ic|$ tiptop -W "$XDG_CONFIG_HOME"/tiptop}}<br />
|-<br />
| [[tmux]]<br />
| {{ic|~/.tmux.conf}}<br />
|<br />
| [http://comments.gmane.org/gmane.comp.terminal-emulators.tmux.user/6013]{{Dead link|2017|12|29}} [http://sourceforge.net/p/tmux/mailman/message/30619546/]{{Dead link|2017|12|29}}<br />
| {{ic|1=$ tmux -f "$XDG_CONFIG_HOME"/tmux/tmux.conf}}<br />
<br />
{{ic|1=$ export TMUX_TMPDIR="$XDG_RUNTIME_DIR"}}<br />
|-<br />
| [https://github.com/bengardner/uncrustify uncrustify]<br />
| {{ic|~/.uncrustify.cfg}}<br />
|<br />
|<br />
| {{ic|1=$ export UNCRUSTIFY_CONFIG="$XDG_CONFIG_HOME"/uncrustify/uncrustify.cfg}}<br />
|-<br />
| [[Unison]]<br />
| {{ic|~/.unison}}<br />
|<br />
|<br />
| {{ic|1=$ export UNISON="$XDG_DATA_HOME"/unison}}<br />
|-<br />
| [[Rxvt-unicode/Tips_and_tricks#Daemon-client|urxvtd]]<br />
| {{ic|~/.urxvt/urxvtd-hostname}}<br />
|<br />
|<br />
| {{ic|1=$ export RXVT_SOCKET="$XDG_RUNTIME_DIR"/urxvtd}}<br />
|-<br />
| [[WeeChat]]<br />
| {{ic|~/.weechat}}<br />
|<br />
| [http://savannah.nongnu.org/task/?10934]<br />
| {{ic|1=$ export WEECHAT_HOME="$XDG_CONFIG_HOME"/weechat}}<br />
<br />
{{ic|1=$ weechat -d "$XDG_CONFIG_HOME"/weechat}}<br />
|-<br />
| [[wget]]<br />
| {{ic|~/.wgetrc}}<br />
|<br />
|<br />
| <br />
{{ic|1=$ export WGETRC="$XDG_CONFIG_HOME/wgetrc"}}<br />
{{ic|1=$ wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"}}<br />
|-<br />
| [[wine]]<br />
| {{ic|~/.wine}}<br />
|<br />
| [https://bugs.winehq.org/show_bug.cgi?id=20888]<br />
| [[Wine#Winetricks|Winetricks]] uses XDG-alike location below for [[Wine#WINEPREFIX|WINEPREFIX]] management:<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/wineprefixes}}<br />
<br />
{{ic|1=$ export WINEPREFIX="$XDG_DATA_HOME"/wineprefixes/default}}<br />
|-<br />
| {{pkg|xorg-xauth}}<br />
| {{ic|~/.Xauthority}}<br />
|<br />
|<br />
| {{ic|1=$ export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority}}<br />
|-<br />
| {{pkg|xorg-xinit}}<br />
| {{ic|~/.xinitrc}}<br />
<br />
{{ic|~/.xserverrc}}<br />
|<br />
|<br />
| {{ic|1=$ export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc}}<br />
{{ic|1=$ export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc}}<br />
<br />
Note that these variables are respected by ''xinit'', but not by ''startx''. Instead, specify the filename as an argument:<br />
<br />
{{ic|1=$ startx "$XDG_CONFIG_HOME/X11/xinitrc" -- vt1}}<br />
|-<br />
| {{pkg|xorg-xrdb}}<br />
| {{ic|~/.Xresources}}<br />
<br />
{{ic|~/.Xdefaults}}<br />
|<br />
|<br />
| Ultimately you [http://superuser.com/questions/243914/xresources-or-xdefaults should be] using {{ic|Xresources}} and since these resources are loaded via {{ic|xrdb}} you can specify a path such as {{ic|1=$ xrdb -load ~/.config/X11/xresources}}.<br />
|}<br />
<br />
==Hardcoded==<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Discussion<br />
! Notes<br />
|-<br />
| [[adb]]<br />
| {{ic|~/.android}}<br />
| [https://developer.android.com/studio/command-line/variables.html#android_sdk_root]<br />
| {{ic|1=$ export ANDROID_SDK_HOME="$XDG_CONFIG_HOME"/android}}<br />
|-<br />
| [[AMule]]<br />
| {{ic|~/.aMule}}<br />
|<br />
|<br />
|-<br />
| [https://developer.android.com/studio/index.html Android Studio]<br />
| {{ic|~/.AndroidStudio2.3}}<br />
<br />
{{ic|~/.android}}<br />
<br />
{{ic|~/.java}}<br />
|<br />
|<br />
|-<br />
| [https://osdn.net/projects/anthy/ anthy]<br />
| {{ic|~/.anthy}}<br />
| [https://osdn.net/ticket/browse.php?group_id=14&tid=28397]<br />
|<br />
|-<br />
| [https://directory.apache.org/studio/ Apache Directory Studio]<br />
| {{ic|~/.ApacheDirectoryStudio}}<br />
|<br />
|-<br />
| [[Arduino]]<br />
| {{ic|~/.arduino15}}<br />
{{ic|~/.jssc}} <br />
| [https://github.com/arduino/Arduino/issues/3915]<sup>won't<br />
|<br />
|-<br />
| [https://christian.amsuess.com/tools/arandr/ ARandR]<br />
| {{ic|~/.screenlayout}}<br />
|<br />
|<br />
|-<br />
| [https://www.audacityteam.org/ Audacity]<br />
| {{ic|~/.audacity-data}}<br />
|<br />
|<br />
|-<br />
| [http://fixounet.free.fr/avidemux/ Avidemux]<br />
| {{ic|~/.avidemux6}}<br />
|<br />
|<br />
|-<br />
| [[bash]]<br />
| {{ic|~/.bashrc}}<br />
<br />
{{ic|~/.bash_history}}<br />
<br />
{{ic|~/.bash_profile}}<br />
<br />
{{ic|~/.bash_login}}<br />
<br />
{{ic|~/.bash_logout}}<br />
| [http://savannah.gnu.org/support/?108134]<sup>won't<br />
| {{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/bash/history}}<br />
A specified {{ic|bashrc}} can be sourced from {{ic|/etc/bashrc}}.<br />
<br />
Specify {{ic|--init-file <file>}} as an alternative to {{ic|~/.bashrc}} for interactive shells.<br />
|-<br />
| [https://www.haskell.org/cabal/ cabal]<br />
| {{ic|~/.cabal}}<br />
| [https://github.com/haskell/cabal/issues/680]<br />
| See discussion for potential workarounds. It is not very easy or straightforward but may be possible to emulate Base Directory compliance.<br />
|-<br />
| [https://calibre-ebook.com/ calibre]<br />
| {{ic|~/Calibre Library}}<br />
|<br />
|<br />
|-<br />
| [[CUPS]]<br />
| {{ic|~/.cups}}<br />
| [http://www.cups.org/str.php?L4243]<sup>won't<br />
|<br />
|-<br />
| [[darcs]]<br />
| {{ic|~/.darcs}}<br />
| [http://bugs.darcs.net/issue2453]<br />
|<br />
|-<br />
| [[dbus]]<br />
| {{ic|~/.dbus}}<br />
| [https://bugs.freedesktop.org/show_bug.cgi?id=35887]<br />
| This should be avoidable with kdbus [citation needed].<br />
|-<br />
| [https://wiki.gnome.org/Apps/Dia Dia]<br />
| {{ic|~/.dia}}<br />
|<br />
|-<br />
| [[eclipse]]<br />
| {{ic|~/.eclipse}}<br />
| [https://bugs.eclipse.org/bugs/show_bug.cgi?id=200809]<br />
| Option {{ic|1=-Dosgi.configuration.area=@user.home/.config/..}} overrides but must be added to {{ic|"$ECLIPSE_HOME"/eclipse.ini"}} rather than command line which means you must have write access to {{ic|$ECLIPSE_HOME}}. (Arch Linux hard-codes {{ic|$ECLIPSE_HOME}} in {{ic|/usr/bin/eclipse}})<br />
|-<br />
| [https://www.gnu.org/software/emacs/ emacs]<br />
| {{ic|~/.emacs}}<br />
<br />
{{ic|~/.emacs.d}}<br />
| [http://debbugs.gnu.org/cgi/bugreport.cgi?bug=583]<br />
| It's possible to set {{ic|HOME}}, but it has unexpected side effects. So far the most promising approach is modifying another Emacs environment variable to alter the load path and author your own site file which can manually load up your init file, but it changes the load process significantly.<br />
|-<br />
| [http://www.fetchmail.info/ Fetchmail]<br />
| {{ic|~/.fetchmailrc}}<br />
|<br />
|<br />
|-<br />
| [[Firefox]]<br />
| {{ic|~/.mozilla}}<br />
| [https://bugzil.la/259356]<br />
|<br />
|-<br />
| [[Flatpak]]<br />
| {{ic|~/.var/}}<br />
| [https://github.com/flatpak/flatpak/issues/46] [https://github.com/flatpak/flatpak.github.io/issues/191]<br />
|<br />
|-<br />
| [https://www.haskell.org/ghc/ GHC]<br />
| {{ic|~/.ghc}}<br />
| [https://ghc.haskell.org/trac/ghc/ticket/6077]<br />
|<br />
|-<br />
| [http://www.gnu.org/software/parallel/ GNU parallel]<br />
| {{ic|~/.parallel}}<br />
|<br />
|<br />
|-<br />
| [http://recordmydesktop.sourceforge.net/about.php gtk-recordMyDesktop]<br />
| {{ic|~/.gtk-recordmydesktop}}<br />
|<br />
|<br />
|-<br />
| [http://www.idris-lang.org/ idris]<br />
| {{ic|~/.idris}}<br />
| [https://github.com/idris-lang/Idris-dev/pull/3456]<br />
|<br />
|-<br />
| [[Java]] (OpenJDK)<br />
| {{ic|~/.java/fonts}}, {{ic|~/.java/webview}}<sup>JavaFX<br />
| [https://bugzilla.redhat.com/show_bug.cgi?id=1154277]<sup>RedHat<br />
|<br />
|-<br />
| [http://julialang.org/ julia]<br />
| {{ic|~/.juliarc.jl}}<br />
<br />
{{ic|~/.julia_history}}<br />
| [https://github.com/JuliaLang/julia/issues/4630] [https://github.com/JuliaLang/julia/issues/10016]<br />
|<br />
|-<br />
| [http://www.linux-pam.org/ Linux PAM]<br />
| {{ic|~/.pam_environment}}<br />
| [https://github.com/linux-pam/linux-pam/issues/7]<br />
| Hardcoded in [https://github.com/linux-pam/linux-pam/blob/master/modules/pam_env/pam_env.c modules/pam_env/pam_env.c]<br />
|-<br />
| [http://lldb.llvm.org/ lldb]<br />
| {{ic|~/.lldb}}<br />
<br />
{{ic|~/.lldbinit}}<br />
|<br />
|<br />
|-<br />
| [http://www.mathomatic.org/ mathomatic]<br />
| {{ic|~/.mathomaticrc}}<br />
<br />
{{ic|~/.matho_history}}<br />
|<br />
| History can be moved by using {{ic|rlwrap mathomatic -r}} with the {{ic|RLWRAP_HOME}} environment set appropriately.<br />
|-<br />
| [http://www.milkytracker.org/ milkytracker]<br />
| {{ic|~/.milkytracker_config}}<br />
| [https://github.com/Deltafire/MilkyTracker/issues/12]<br />
|<br />
|-<br />
| [https://minecraft.net/ Minecraft]<br />
| {{ic|~/.minecraft}}<br />
| [https://bugs.mojang.com/browse/MCL-2563]<br />
|<br />
|-<br />
| [https://www.mongodb.org/ mongodb]<br />
| {{ic|~/.mongorc.js}}<br />
<br />
{{ic|~/.dbshell}}<br />
| [https://jira.mongodb.org/browse/DOCS-5652?jql=text%20~%20%22.mongorc.js%22]<br />
| [http://stackoverflow.com/a/22349050/4200039 This Stack Overflow thread] suggests a partial workaround using command-line switch {{ic|--norc}}.<br />
|-<br />
|<br />
| {{ic|~/.netrc}}<br />
|<br />
| Like {{ic|~/.ssh}}, many programs expect this file to be here. These include projects like curl ({{ic|CURLOPT_NETRC_FILE}}), ftp ({{ic|NETRC}}), s-nail ({{ic|NETRC}}), etc. While some of them offer alternative configurable locations, many do not such as w3m, wget and lftp.<br />
|-<br />
| [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS NSS]<br />
| {{ic|~/.pki}}<br />
| [https://bugzilla.mozilla.org/show_bug.cgi?id=818686]<br />
|<br />
|-<br />
| [https://www.openssh.com/ OpenSSH]<br />
| {{ic|~/.ssh}}<br />
| [https://bugzilla.mindrot.org/show_bug.cgi?id=2050]<br />
| Assumed to be present by many ssh daemons and clients such as DropBear and OpenSSH.<br />
|-<br />
| [https://www.palemoon.org/ palemoon]<br />
| {{ic|~/.moonchild productions}}<br />
| [https://forum.palemoon.org/viewtopic.php?f=5&t=9639]<br />
|<br />
|-<br />
| [https://perf.wiki.kernel.org/index.php/Main_Page perf]<br />
| {{ic|~/.debug}}<br />
|<br />
| Hardcoded in [https://github.com/torvalds/linux/blob/master/tools/perf/util/config.c#L29 tools/perf/util/config.c:29].<br />
|-<br />
| various [[shell]]s and [[display manager]]s<br />
| {{ic|~/.profile}}<br />
|<br />
|<br />
|-<br />
| [[python]]<br />
| {{ic|~/.python_history}}<br />
|<br />
| All history from interactive sessions is saved to {{ic|~/.python_history}} by default since [https://bugs.python.org/issue5845 version 3.4], custom path can still be set the same way as in older versions (see [https://docs.python.org/3/library/readline.html?highlight=readline#example this example]).<br />
|-<br />
| [https://doc.qt.io/qt-5/qtdesigner-manual.html Qt Designer]<br />
| {{ic|~/.designer}}<br />
|<br />
|<br />
|-<br />
| [https://quodlibet.readthedocs.io/en/latest/ Quod Libet]<br />
| {{ic|~/.quodlibet}}<br />
| [https://github.com/quodlibet/quodlibet/issues/138]<br />
|<br />
|-<br />
| [https://racket-lang.org/ racket]<br />
| {{ic|~/.racketrc}}<br />
|<br />
|<br />
|-<br />
| [http://rednotebook.sourceforge.net/ RedNotebook]<br />
| {{ic|~/.rednotebook}}<br />
|<br />
|<br />
|-<br />
| [https://remarkableapp.github.io/linux.html Remarkable]<br />
| {{ic|~/.remarkable}}<br />
|<br />
|<br />
|-<br />
| [https://www.renpy.org/ Ren'Py]<br />
| {{ic|~/.renpy}}<br />
| [https://github.com/renpy/renpy/issues/1377]<br />
|<br />
|-<br />
| [https://www.scribus.net/ Scribus]<br />
| {{ic|~/.scribus}}<br />
|<br />
|-<br />
| [http://www.seamonkey-project.org/ SeaMonkey]<br />
| {{ic|~/.mozilla}}<br />
| [https://bugzil.la/726939]<br />
|<br />
|-<br />
| [https://www.gnu.org/software/solfege/solfege.html Solfege]<br />
| {{ic|~/.solfege}}<br />
<br />
{{ic|~/.solfegerc}}<br />
<br />
{{ic|~/lessonfiles}}<br />
| [https://savannah.gnu.org/bugs/index.php?50251]<br />
|<br />
|-<br />
| [https://spamassassin.apache.org/ SpamAssassin]<br />
| {{ic|~/.spamassassin}}<br />
|<br />
|<br />
|-<br />
| [[spectrwm]]<br />
| {{ic|~/.spectrwm}}<br />
|<br />
|<br />
|-<br />
| [[SQLite]]<br />
| {{ic|~/.sqlite_history}}<br />
<br />
{{ic|~/.sqliterc}}<br />
| [https://unix.stackexchange.com/questions/306890/change-location-of-sqlite-history-file][http://sqlite.1065341.n5.nabble.com/Customizing-the-location-of-the-sqlite-history-td87055.html]<br />
| {{ic|$ sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc}}<br />
|-<br />
| [[Steam]]<br />
| {{ic|~/.steam}}<br />
{{ic|~/.steampath}}<br />
{{ic|~/.steampid}}<br />
| [https://github.com/ValveSoftware/steam-for-linux/issues/1890]<br />
| Many game engines (Unity 3D, Unreal) follow the specification, but then individual game publishers hardcode the paths in [https://www.ctrl.blog/entry/flatpak-steamcloud-xdg Steam Auto-Cloud] causing game-saves to sync to the wrong directory.<br />
|-<br />
| [[TeamSpeak]]<br />
| {{ic|~/.ts3client}}<br />
|<br />
|-<br />
| [http://www.texmacs.org/ TeXmacs]<br />
| {{ic|~/.TeXmacs}}<br />
|<br />
|<br />
|-<br />
| [[Thunderbird]]<br />
| {{ic|~/.thunderbird}}<br />
| [https://bugzil.la/735285]<br />
|<br />
|-<br />
| [https://git.archlinux.org/users/remy/texlive-localmanager.git/ tllocalmgr]<br />
| {{ic|~/.texlive}}<br />
|<br />
|-<br />
| [[vim]]<br />
| {{ic|~/.vim}}<br />
<br />
{{ic|~/.vimrc}}<br />
<br />
{{ic|~/.viminfo}}<br />
|<br />
| Since [https://github.com/vim/vim/commit/6a459902592e2a4ba68 7.3.1178] vim will search for {{ic|~/.vim/vimrc}} if {{ic|~/.vimrc}} is not found.<br />
<br />
{{ic|1=<nowiki>$ mkdir -p "$XDG_CACHE_HOME"/vim/{undo,swap,backup}</nowiki>}}<br />
<br />
{{hc|"$XDG_CONFIG_HOME"/vim/vimrc|<br />
set undodir&#61;$XDG_CACHE_HOME/vim/undo<br />
set directory&#61;$XDG_CACHE_HOME/vim/swap<br />
set backupdir&#61;$XDG_CACHE_HOME/vim/backup<br />
set viminfo+&#61;'1000,n$XDG_CACHE_HOME/vim/viminfo<br />
set runtimepath&#61;$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIMRUNTIME<br />
}}<br />
<br />
{{hc|~/.profile|<br />
export VIMINIT&#61;":source $XDG_CONFIG_HOME"/vim/vimrc<br />
}}<br />
<br />
* https://tlvince.com/vim-respect-xdg<br />
|-<br />
| [http://www.vimperator.org/ vimperator]<br />
| {{ic|~/.vimperatorrc}}<br />
| [http://www.mozdev.org/pipermail/vimperator/2009-October/004848.html]<br />
| {{ic|1=$ export VIMPERATOR_INIT=":source $XDG_CONFIG_HOME/vimperator/vimperatorrc"}}<br />
<br />
{{ic|1=$ export VIMPERATOR_RUNTIME="$XDG_CONFIG_HOME"/vimperator}}<br />
|-<br />
| {{pkg|w3m}}<br />
| {{ic|~/.w3m}}<br />
| [https://sourceforge.net/p/w3m/feature-requests/31/]<br />
|<br />
|-<br />
| [https://w1.fi/ wpa_cli]<br />
| {{ic|~/.wpa_cli_history}}<br />
|<br />
|<br />
|-<br />
| {{pkg|xdg-utils}}<br />
| {{ic|~/.gnome}}<br />
|<br />
| For some reason the script {{ic|xdg-desktop-menu}} hard-codes {{ic|gnome_user_dir&#61;"$HOME/.gnome/apps"}}. This is used by [[chromium]] amoung others.<br />
|-<br />
| [https://opensource.conformal.com/wiki/xombrero xombrero]<br />
| {{ic|~/.xombrero}}<br />
| [https://github.com/conformal/xombrero/issues/74]<br />
|<br />
|-<br />
| {{pkg|yarn}}<br />
| {{ic|~/.yarnrc}}<br />
<br />
{{ic|~/.yarn/}}<br />
<br />
{{ic|~/.yarncache/}}<br />
<br />
{{ic|~/.yarn-config/}}<br />
| [https://github.com/yarnpkg/yarn/issues/2334]<br />
|<br />
|-<br />
| [[zsh]]<br />
| {{ic|~/.zshrc}}<br />
<br />
{{ic|~/.zprofile}} {{ic|~/.zshenv}}<br />
<br />
{{ic|~/.zlogin}} {{ic|~/.zlogout}}<br />
<br />
{{ic|~/.histfile}}<br />
| [http://www.zsh.org/mla/workers/2013/msg00692.html]<br />
| Consider exporting {{ic|1=ZDOTDIR=$HOME/.config/zsh}} in {{ic|~/.zshenv}} (this is hardcoded due to the bootstrap problem). You could also add this to {{ic|/etc/zsh/zshenv}} and avoid the need for any dotfiles in your {{ic|HOME}}. Doing this however requires root privilege which may not be viable and is system-wide.<br />
<br />
{{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/zsh/history}}<br />
|}<br />
<br />
==Library and language support==<br />
<br />
; C<br />
: [https://github.com/Cloudef/chck/tree/master/chck/xdg C99: Cloudef's simple implementation].<br />
<br />
; JVM: Java, Kotlin, Clojure, Scala, ...<br />
: [https://github.com/soc/directories directories]<br />
<br />
; Haskell<br />
: Officially in [https://hackage.haskell.org/package/directory directory] since 1.2.3.0 [https://github.com/haskell/directory/commit/ab9d0810ce ab9d0810ce].<br />
: [https://hackage.haskell.org/package/xdg-basedir xdg-basedir]<br />
<br />
; Perl<br />
: [http://search.cpan.org/dist/File-BaseDir/lib/File/BaseDir.pm File-BaseDir]<br />
: [https://github.com/Aerdan/perl-file-xdg perl-file-xdg]<br />
<br />
; Ruby<br />
: [https://github.com/rubyworks/xdg rubyworks/xdg]<br />
<br />
; Python<br />
: [http://freedesktop.org/wiki/Software/pyxdg/ pyxdg]<br />
<br />
; Vala<br />
: Builtin support via [http://valadoc.org/#!api=glib-2.0/GLib.Environment GLib.Environment].<br />
: See {{ic|get_user_cache_dir}}, {{ic|get_user_data_dir}}, {{ic|get_user_config_dir}}, etc.<br />
<br />
==See also==<br />
<br />
* [https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders GNOME Goal: XDG Base Directory Specification Usage]<br />
* [https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp Rob Pike: "Dotfiles" being hidden is a UNIXv2 mistake].<br />
* [http://www.freedesktop.org/software/systemd/man/systemd-path.html systemd-path(1)]<br />
* [http://www.freedesktop.org/software/systemd/man/file-hierarchy.html file-hierarchy(7)]<br />
* [https://github.com/grawity/dotfiles/blob/master/.dotfiles.notes Grawity's notes on dotfiles].<br />
* [https://github.com/grawity/dotfiles/blob/master/.environ.notes Grawity's notes on environment variables].<br />
* [https://ploum.net/207-modify-your-application-to-use-xdg-folders/ ploum.net: Modify Your Application to use XDG Folders].</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=LMMS&diff=509417LMMS2018-02-03T04:44:40Z<p>GenkiSky: /* Installation */ Clarify package alternative reasons</p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:Multimedia]]<br />
[[ja:LMMS]]<br />
[[ru:LMMS]]<br />
{{Style|More a scratchpad than an article}}<br />
[https://lmms.io/ LMMS] is a free cross-platform software which allows you to produce music <br />
with your computer. This covers creating melodies and beats, <br />
synthesizing and mixing sounds and arranging samples. You can have fun <br />
with your MIDI keyboard and much more – all in a user-friendly and <br />
modern interface. Furthermore LMMS comes with many ready-to-use <br />
instrument and effect plugins, presets and samples.<br />
<br />
== Installation ==<br />
<br />
{{Pkg|lmms}} is in the offical Archlinux repository. Alternatively, because LMMS has seen many changes since the stable release at time of writing, you may want {{AUR|lmms-git}} for the latest in upstream development, or {{AUR|lmms-beta-bin}} for a pre-compiled pre-release version. See [https://github.com/LMMS/lmms/releases] for release notes.<br />
<br />
As always, if you want to use multiple audio applications simultaneously but your hardware does not natively support this, you will need either a [[Sound#Sound_servers|usermode sound server]], or to configure ALSA [[Alsa#Dmix|dmix]].<br />
<br />
== MIDI and soundfonts ==<br />
<br />
Depending on your setup and the installation method, you might need to manually setup a [[Timidity#SoundFonts|soundfont]] and [[Timidity]].<br />
<br />
Then, you will need to edit the FluidSynth configuration file as <br />
mentioned in the package’s [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.install?h=packages/fluidsynth post-installation script]. For the audio driver, choose the sound <br />
server that you installed.<br />
<br />
[[Start]] {{ic|fluidsynth.service}}.<br />
<br />
When LMMS starts, it will prompt you with the settings. Go to the audio settings, choose the same interface that you set for FluidSynth, and restart LMMS if you made a switch.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=LMMS&diff=509415LMMS2018-02-03T03:50:10Z<p>GenkiSky: /* Installation */ Further clarify note about sound servers / dmix</p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:Multimedia]]<br />
[[ja:LMMS]]<br />
[[ru:LMMS]]<br />
{{Style|More a scratchpad than an article}}<br />
[https://lmms.io/ LMMS] is a free cross-platform software which allows you to produce music <br />
with your computer. This covers creating melodies and beats, <br />
synthesizing and mixing sounds and arranging samples. You can have fun <br />
with your MIDI keyboard and much more – all in a user-friendly and <br />
modern interface. Furthermore LMMS comes with many ready-to-use <br />
instrument and effect plugins, presets and samples.<br />
<br />
== Installation ==<br />
<br />
{{Pkg|lmms}} is in the offical Archlinux repository. You may also want {{AUR|lmms-git}} for the latest in upstream development, or {{AUR|lmms-beta-bin}} for a pre-compiled pre-release version.<br />
<br />
As always, if you want to use multiple audio applications simultaneously but your hardware does not natively support this, you will need either a [[Sound#Sound_servers|usermode sound server]], or to configure ALSA [[Alsa#Dmix|dmix]].<br />
<br />
== MIDI and soundfonts ==<br />
<br />
Depending on your setup and the installation method, you might need to manually setup a [[Timidity#SoundFonts|soundfont]] and [[Timidity]].<br />
<br />
Then, you will need to edit the FluidSynth configuration file as <br />
mentioned in the package’s [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.install?h=packages/fluidsynth post-installation script]. For the audio driver, choose the sound <br />
server that you installed.<br />
<br />
[[Start]] {{ic|fluidsynth.service}}.<br />
<br />
When LMMS starts, it will prompt you with the settings. Go to the audio settings, choose the same interface that you set for FluidSynth, and restart LMMS if you made a switch.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=LMMS&diff=509414LMMS2018-02-03T03:48:35Z<p>GenkiSky: /* Installation */ Add missing comma, improve wording.</p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:Multimedia]]<br />
[[ja:LMMS]]<br />
[[ru:LMMS]]<br />
{{Style|More a scratchpad than an article}}<br />
[https://lmms.io/ LMMS] is a free cross-platform software which allows you to produce music <br />
with your computer. This covers creating melodies and beats, <br />
synthesizing and mixing sounds and arranging samples. You can have fun <br />
with your MIDI keyboard and much more – all in a user-friendly and <br />
modern interface. Furthermore LMMS comes with many ready-to-use <br />
instrument and effect plugins, presets and samples.<br />
<br />
== Installation ==<br />
<br />
{{Pkg|lmms}} is in the offical Archlinux repository. You may also want {{AUR|lmms-git}} for the latest in upstream development, or {{AUR|lmms-beta-bin}} for a pre-compiled pre-release version.<br />
<br />
As always, if you want to use multiple audio applications simultaneously, you will need either a [[Sound#Sound_servers|usermode sound server]], or configure ALSA [[Alsa#Dmix|dmix]].<br />
<br />
== MIDI and soundfonts ==<br />
<br />
Depending on your setup and the installation method, you might need to manually setup a [[Timidity#SoundFonts|soundfont]] and [[Timidity]].<br />
<br />
Then, you will need to edit the FluidSynth configuration file as <br />
mentioned in the package’s [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.install?h=packages/fluidsynth post-installation script]. For the audio driver, choose the sound <br />
server that you installed.<br />
<br />
[[Start]] {{ic|fluidsynth.service}}.<br />
<br />
When LMMS starts, it will prompt you with the settings. Go to the audio settings, choose the same interface that you set for FluidSynth, and restart LMMS if you made a switch.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=LMMS&diff=509413LMMS2018-02-03T03:46:36Z<p>GenkiSky: Clarify section on MIDI/soundfonts</p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:Multimedia]]<br />
[[ja:LMMS]]<br />
[[ru:LMMS]]<br />
{{Style|More a scratchpad than an article}}<br />
[https://lmms.io/ LMMS] is a free cross-platform software which allows you to produce music <br />
with your computer. This covers creating melodies and beats, <br />
synthesizing and mixing sounds and arranging samples. You can have fun <br />
with your MIDI keyboard and much more – all in a user-friendly and <br />
modern interface. Furthermore LMMS comes with many ready-to-use <br />
instrument and effect plugins, presets and samples.<br />
<br />
== Installation ==<br />
<br />
{{Pkg|lmms}} is in the offical Archlinux repository. You may also want {{AUR|lmms-git}} for the latest in upstream development, or {{AUR|lmms-beta-bin}} for a pre-compiled pre-release version.<br />
<br />
As always, if you want to use multiple audio applications simultaneously you will need either a [[Sound#Sound_servers|usermode sound server]], or ALSA [[Alsa#Dmix|dmix]].<br />
<br />
== MIDI and soundfonts ==<br />
<br />
Depending on your setup and the installation method, you might need to manually setup a [[Timidity#SoundFonts|soundfont]] and [[Timidity]].<br />
<br />
Then, you will need to edit the FluidSynth configuration file as <br />
mentioned in the package’s [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.install?h=packages/fluidsynth post-installation script]. For the audio driver, choose the sound <br />
server that you installed.<br />
<br />
[[Start]] {{ic|fluidsynth.service}}.<br />
<br />
When LMMS starts, it will prompt you with the settings. Go to the audio settings, choose the same interface that you set for FluidSynth, and restart LMMS if you made a switch.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=LMMS&diff=509412LMMS2018-02-03T03:44:49Z<p>GenkiSky: /* Installation */ Clarify note about sound server, remove {{Accuracy}}, remove extraneous "the"</p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:Multimedia]]<br />
[[ja:LMMS]]<br />
[[ru:LMMS]]<br />
{{Style|More a scratchpad than an article}}<br />
[https://lmms.io/ LMMS] is a free cross-platform software which allows you to produce music <br />
with your computer. This covers creating melodies and beats, <br />
synthesizing and mixing sounds and arranging samples. You can have fun <br />
with your MIDI keyboard and much more – all in a user-friendly and <br />
modern interface. Furthermore LMMS comes with many ready-to-use <br />
instrument and effect plugins, presets and samples.<br />
<br />
== Installation ==<br />
<br />
{{Pkg|lmms}} is in the offical Archlinux repository. You may also want {{AUR|lmms-git}} for the latest in upstream development, or {{AUR|lmms-beta-bin}} for a pre-compiled pre-release version.<br />
<br />
You will need a [[Timidity#SoundFonts|soundfont]] and [[Timidity]].<br />
<br />
As always, if you want to use multiple audio applications simultaneously you will need either a [[Sound#Sound_servers|usermode sound server]], or ALSA [[Alsa#Dmix|dmix]].<br />
<br />
Then, you will need to edit the FluidSynth configuration file as <br />
mentioned in the package’s [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.install?h=packages/fluidsynth post-installation script]. For the audio driver, choose the sound <br />
server that you installed.<br />
<br />
[[Start]] {{ic|fluidsynth.service}}.<br />
<br />
When LMMS starts, it will prompt you with the settings. Go to the audio <br />
settings, choose the same interface that you set for FluidSynth, and <br />
restart LMMS if you made a switch.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=LMMS&diff=509411LMMS2018-02-03T03:41:47Z<p>GenkiSky: /* Installation */ Add note on lmms-beta-bin</p>
<hr />
<div>[[Category:Applications]]<br />
[[Category:Multimedia]]<br />
[[ja:LMMS]]<br />
[[ru:LMMS]]<br />
{{Style|More a scratchpad than an article}}<br />
[https://lmms.io/ LMMS] is a free cross-platform software which allows you to produce music <br />
with your computer. This covers creating melodies and beats, <br />
synthesizing and mixing sounds and arranging samples. You can have fun <br />
with your MIDI keyboard and much more – all in a user-friendly and <br />
modern interface. Furthermore LMMS comes with many ready-to-use <br />
instrument and effect plugins, presets and samples.<br />
<br />
== Installation ==<br />
<br />
{{Pkg|lmms}} is in the offical Archlinux repository. You may also want {{AUR|lmms-git}} for the latest in upstream development, or the {{AUR|lmms-beta-bin}} for a pre-compiled pre-release version.<br />
<br />
You will need a [[Timidity#SoundFonts|soundfont]] and [[Timidity]].<br />
<br />
{{Accuracy|sound server "needed": no bug report or further explanation: unlikely to be the real cause of the issue}}<br />
<br />
If you will use other audio apps like VLC during a single login, you <br />
will need a [[Sound#Sound_servers|usermode sound server]]<br />
<br />
Then, you will need to edit the FluidSynth configuration file as <br />
mentioned in the package’s [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/fluidsynth.install?h=packages/fluidsynth post-installation script]. For the audio driver, choose the sound <br />
server that you installed.<br />
<br />
[[Start]] {{ic|fluidsynth.service}}.<br />
<br />
When LMMS starts, it will prompt you with the settings. Go to the audio <br />
settings, choose the same interface that you set for FluidSynth, and <br />
restart LMMS if you made a switch.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Systemd/User&diff=502934Systemd/User2017-12-16T22:18:47Z<p>GenkiSky: /* Environment variables */ Fix minor typo</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[es:Systemd/User]]<br />
[[fr:Systemd/utilisateur]]<br />
[[it:Systemd/User]]<br />
[[ja:Systemd/ユーザー]]<br />
[[ru:Systemd/User]]<br />
[[zh-hans:Systemd/User]]<br />
{{Related articles start}}<br />
{{Related|systemd}}<br />
{{Related|Automatic login to virtual console}}<br />
{{Related|Start X at login}}<br />
{{Related articles end}}<br />
<br />
[[systemd]] offers users the ability to manage services under the user's control with a per-user systemd instance, enabling users to start, stop, enable, and disable their own units. This is convenient for daemons and other services that are commonly run for a single user, such as [[mpd]], or to perform automated tasks like fetching mail. With some caveats it is even possible to run xorg and the entire window manager from user services.<br />
<br />
== How it works ==<br />
<br />
As per default configuration in {{ic|/etc/pam.d/system-login}}, the {{ic|pam_systemd}} module automatically launches a {{ic|systemd --user}} instance when the user logs in for the first time. This process will survive as long as there is some session for that user, and will be killed as soon as the last session for the user is closed. When [[#Automatic start-up of systemd user instances]] is enabled, the instance is started on boot and will not be killed. The systemd user instance is responsible for managing user services, which can be used to run daemons or automated tasks, with all the benefits of systemd, such as socket activation, timers, dependency system or strict process control via cgroups.<br />
<br />
Similarly to system units, user units are located in the following directories (ordered by ascending precedence):<br />
<br />
* {{ic|/usr/lib/systemd/user/}} where units provided by installed packages belong.<br />
* {{ic|~/.local/share/systemd/user/}} where units of packages that have been installed in the home directory belong.<br />
* {{ic|/etc/systemd/user/}} where system-wide user units are placed by the system administrator.<br />
* {{ic|~/.config/systemd/user/}} where the user puts its own units.<br />
<br />
When systemd user instance starts, it brings up the target {{ic|default.target}}. Other units can be controlled manually with {{ic|systemctl --user}}.<br />
<br />
{{Note|<br />
* Be aware that the {{ic|systemd --user}} instance is a per-user process, and not per-session. The rationale is that most resources handled by user services, like sockets or state files will be per-user (live on the user's home dir) and not per session. This means that all user services run outside of a session. As a consequence, programs that need to be run inside a session will probably break in user services. The way systemd handles user sessions is pretty much in flux. See [https://mail.gnome.org/archives/desktop-devel-list/2014-January/msg00079.html] and [http://lists.freedesktop.org/archives/systemd-devel/2014-March/017552.html] for some hints on where things are going.<br />
* {{ic|systemd --user}} runs as a separate process from the {{ic|systemd --system}} process. User units can not reference or depend on system units.<br />
}}<br />
<br />
== Basic setup ==<br />
<br />
All the user services will be placed in {{ic|~/.config/systemd/user/}}. If you want to run services on first login, execute {{ic|systemctl --user enable ''service''}} for any service you want to be autostarted.<br />
<br />
=== Environment variables ===<br />
<br />
The user instance of systemd does not inherit any of the [[environment variables]] set in places like {{ic|.bashrc}} etc. There are several ways to set environment variables for the systemd user instance:<br />
<br />
# For users with a {{ic|$HOME}} directory, create a ''.conf'' file in the {{ic|~/.config/environment.d/}} directory with lines of the form {{ic|1=NAME=VAL}}. Affects only that user's user unit. See {{man|5|environment.d}} for more information.<br />
# Use the {{ic|DefaultEnvironment}} option in {{ic|/etc/systemd/user.conf}} file. Affects all user units.<br />
# Add a drop-in config file in {{ic|/etc/systemd/system/user@.service.d/}}. Affects all user units; see [[#Service example]]<br />
# At any time, use {{ic|systemctl --user set-environment}} or {{ic|systemctl --user import-environment}}. Affects all user units started after setting the environment variables, but not the units that were already running.<br />
# Using the {{ic|dbus-update-activation-environment --systemd --all}} command provided by [[dbus]]. Has the same effect as {{ic|systemctl --user import-environment}}, but also affects the D-Bus session. You can add this to the end of your shell initialization file.<br />
# For "global" environment variables for the user environment you can use the environment.d directories which are parsed by systemd generators. See {{man|5|environment.d}} for more information.<br />
# You can also write an environment generator script which can produce environment variables that vary from user to user, this is probably the best way if you need per-user environments (this is the case for XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESS, etc). See {{man|7|systemd.environment-generator}}.<br />
<br />
One variable you may want to set is {{ic|PATH}}.<br />
<br />
After configuration, the command {{ic|systemctl --user show-environment}} can be used to verify that the values are correct.<br />
<br />
==== Service example ====<br />
Create the [[Systemd#Drop-in files|drop-in]] directory {{ic|/etc/systemd/system/user@.service.d/}} and inside create a file that has the extension {{ic|.conf}} (e.g. {{ic|local.conf}}):<br />
{{hc|/etc/systemd/system/user@.service.d/local.conf|2=<br />
[Service]<br />
Environment="PATH=/usr/lib/ccache/bin:/usr/local/bin:/usr/bin:/bin"<br />
Environment="EDITOR=nano -c"<br />
Environment="BROWSER=firefox"<br />
Environment="NO_AT_BRIDGE=1"<br />
}}<br />
<br />
==== DISPLAY and XAUTHORITY ====<br />
<br />
{{ic|DISPLAY}} is used by any X application to know which display to use and {{ic|XAUTHORITY}} to provide a path to the user's {{ic|.Xauthority}} file and thus the cookie needed to access the X server. If you plan on launching X applications from systemd units, these variables need to be set. Systemd provides a script in {{ic|/etc/X11/xinit/xinitrc.d/50-systemd-user.sh}} to import those variables into the systemd user session on X launch. [https://github.com/systemd/systemd/blob/v219/NEWS#L194] So unless you start X in a nonstandard way, user services should be aware of the {{ic|DISPLAY}} and {{ic|XAUTHORITY}}.<br />
<br />
==== PATH ====<br />
<br />
If you customize your {{ic|PATH}} and plan on launching applications that make use of it from systemd units, you should make sure the modified {{ic|PATH}} is set on the systemd environment. Assuming you set your {{ic|PATH}} in {{ic|.bash_profile}}, the best way to make systemd aware of your modified {{ic|PATH}} is by adding the following to {{ic|.bash_profile}} after the {{ic|PATH}} variable is set:<br />
<br />
{{hc|~/.bash_profile|<nowiki><br />
systemctl --user import-environment PATH<br />
</nowiki>}}<br />
<br />
Note that this will not affect systemd services started before {{ic|~/.bash_profile}} is sourced.<br />
<br />
==== pam_environment ====<br />
<br />
Environment variables can be made available through use of the {{ic|pam_env.so}} module. See [[Environment variables#Using pam_env]] for configuration details.<br />
<br />
=== Automatic start-up of systemd user instances ===<br />
<br />
The systemd user instance is started after the first login of a user and killed after the last session of the user is closed. Sometimes it may be useful to start it right after boot, and keep the systemd user instance running after the last session closes, for instance to have some user process running without any open session. Lingering is used to that effect. Use the following command to enable lingering for specific user:<br />
<br />
# loginctl enable-linger ''username''<br />
<br />
{{Warning|systemd services are '''not''' sessions, they run outside of ''logind''. Do not use lingering to enable automatic login as it will [[General troubleshooting#Session permissions|break the session]].}}<br />
<br />
== Xorg and systemd ==<br />
<br />
There are several ways to run xorg within systemd units. Below there are two options, either by starting a new user session with an xorg process, or by launching xorg from a systemd user service.<br />
<br />
=== Automatic login into Xorg without display manager ===<br />
<br />
{{Accuracy|This setup ends up with two user D-Bus buses, one for the desktop, and an other for systemd. Why can't we use the systemd one alone? }}<br />
<br />
This option will launch a system unit that will start a user session with an xorg server and then run the usual {{ic|~/.xinitrc}} to launch the window manager, etc. You need to have {{AUR|xlogin-git}} installed. Set up your xinitrc as specified in the [[Xinit#xinitrc]] section.<br />
<br />
The session will use its own dbus daemon, but various systemd utilities will automatically connect to the {{ic|dbus.service}} instance. Finally, [[enable]] the {{ic|xlogin@''username''}} service for automatic login at boot. The user session lives entirely inside a systemd scope and everything in the user session should work just fine.<br />
<br />
=== Xorg as a systemd user service ===<br />
<br />
Alternatively, [[xorg]] can be run from within a systemd user service. This is nice since other X-related units can be made to depend on xorg, etc, but on the other hand, it has some drawbacks explained below.<br />
<br />
{{Pkg|xorg-server}} provides integration with systemd in two ways:<br />
* Can be run unprivileged, delegating device management to logind (see Hans de Goede commits around [http://cgit.freedesktop.org/xorg/xserver/commit/?id=82863656ec449644cd34a86388ba40f36cea11e9 this commit]).<br />
* Can be made into a socket activated service (see [http://cgit.freedesktop.org/xorg/xserver/commit/?id=b3d3ffd19937827bcbdb833a628f9b1814a6e189 this commit]). This removes the need for {{AUR|systemd-xorg-launch-helper-git}}.<br />
<br />
Unfortunately, to be able to run xorg in unprivileged mode, it needs to run inside a session. So, right now the handicap of running xorg as user service is that it must be run with root privileges (like before 1.16), and can't take advantage of the unprivileged mode introduced in 1.16.<br />
<br />
{{Note|This is not a fundamental restriction imposed by logind, but the reason seems to be that xorg needs to know which session to take over, and right now it gets this information calling [http://www.freedesktop.org/wiki/Software/systemd/logind logind]'s {{ic|GetSessionByPID}} using its own pid as argument. See [http://lists.x.org/archives/xorg-devel/2014-February/040476.html this thread] and [http://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/os-support/linux/systemd-logind.c xorg sources]. It seems likely that xorg could be modified to get the session from the tty it is attaching to, and then it could run unprivileged from a user service outside a session.}}<br />
<br />
{{Warning|1=On xorg 1.18 socket activation seems to be broken. The client triggering the activation deadlocks. See the upstream bug report [https://bugs.freedesktop.org/show_bug.cgi?id=93072]. As a temporary workaround you can start the xorg server without socket activation, making sure the clients connect after a delay, so the server is fully started. There seems to be no nice mechanism te get startup notification for the X server.}}<br />
<br />
This is how to launch xorg from a user service:<br />
<br />
1. Make xorg run with root privileges and for any user, by editing {{ic|/etc/X11/Xwrapper.config}} <br />
<br />
{{hc|/etc/X11/Xwrapper.config|<nowiki><br />
allowed_users=anybody<br />
needs_root_rights=yes<br />
</nowiki>}}<br />
<br />
2. Add the following units to {{ic|~/.config/systemd/user}}<br />
<br />
{{hc|~/.config/systemd/user/xorg@.socket|<nowiki><br />
[Unit]<br />
Description=Socket for xorg at display %i<br />
<br />
[Socket]<br />
ListenStream=/tmp/.X11-unix/X%i<br />
</nowiki>}}<br />
<br />
{{hc|~/.config/systemd/user/xorg@.service|<nowiki><br />
[Unit]<br />
Description=Xorg server at display %i<br />
<br />
Requires=xorg@%i.socket<br />
After=xorg@%i.socket<br />
<br />
[Service]<br />
Type=simple<br />
SuccessExitStatus=0 1<br />
<br />
ExecStart=/usr/bin/Xorg :%i -nolisten tcp -noreset -verbose 2 "vt${XDG_VTNR}"<br />
</nowiki>}}<br />
<br />
where {{ic|${XDG_VTNR} }} is the virtual terminal where xorg will be launched, either hard-coded in the service unit, or set in the systemd environment with<br />
<br />
$ systemctl --user set-environment XDG_VTNR=1<br />
<br />
{{Note|xorg should be launched at the same virtual terminal where the user logged in. Otherwise logind will consider the session inactive.}}<br />
<br />
3. Make sure to configure the {{ic|DISPLAY}} environment variable as explained [[#DISPLAY_and_XAUTHORITY|above]].<br />
<br />
4. Then, to enable socket activation for xorg on display 0 and tty 2 one would do:<br />
<br />
$ systemctl --user set-environment XDG_VTNR=2 # So that xorg@.service knows which vt use<br />
$ systemctl --user start xorg@0.socket # Start listening on the socket for display 0<br />
<br />
Now running any X application will launch xorg on virtual terminal 2 automatically.<br />
<br />
The environment variable {{ic|XDG_VTNR}} can be set in the systemd environment from {{ic|.bash_profile}}, and then one could start any X application, including a window manager, as a systemd unit that depends on {{ic|xorg@0.socket}}.<br />
<br />
{{Warning|Currently running a window manager as a user service means it runs outside of a session with the problems this may bring: [[General troubleshooting#Session permissions|break the session]]. However, it seems that systemd developers intend to make something like this possible. See [https://mail.gnome.org/archives/desktop-devel-list/2014-January/msg00079.html] and [http://lists.freedesktop.org/archives/systemd-devel/2014-March/017552.html]}}<br />
<br />
== Writing user units ==<br />
<br />
=== Example ===<br />
<br />
The following is an example of a user version of the mpd service.<br />
{{hc|~/.config/systemd/user/mpd.service|<nowiki><br />
[Unit]<br />
Description=Music Player Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/mpd --no-daemon<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
=== Example with variables ===<br />
<br />
The following is an example of a user version of {{ic|sickbeard.service}}, which takes into account variable home directories where [[SickBeard]] can find certain files:<br />
<br />
{{hc|~/.config/systemd/user/sickbeard.service|<nowiki><br />
[Unit]<br />
Description=SickBeard Daemon<br />
<br />
[Service]<br />
ExecStart=/usr/bin/env python2 /opt/sickbeard/SickBeard.py --config %h/.sickbeard/config.ini --datadir %h/.sickbeard<br />
<br />
[Install]<br />
WantedBy=default.target<br />
</nowiki>}}<br />
<br />
As detailed in {{man|5|systemd.unit}}, the {{ic|%h}} variable is replaced by the home directory of the user running the service. There are other variables that can be taken into account in the [[systemd]] manpages.<br />
<br />
=== Note about X applications ===<br />
<br />
Most X apps need a {{ic|DISPLAY}} variable to run. See [[#DISPLAY and XAUTHORITY]] for how to this variable is set for the entire systemd user instance.<br />
<br />
=== Reading the journal ===<br />
<br />
The journal for the user can be read using the analogous command:<br />
<br />
$ journalctl --user<br />
<br />
{{Expansion|Explain the difference between {{ic|-u}} and {{ic|--user-unit}} used along with {{ic|--user}}.}}<br />
<br />
To specify a unit, one can use<br />
<br />
$ journalctl --user -u myunit.service<br />
<br />
For a user unit, use<br />
<br />
$ journalctl --user --user-unit myunit.service<br />
<br />
{{Accuracy|Unreferenced "bug reports" don't belong to the wiki.}}<br />
<br />
Note that there seems to be some sort of bug that can sometimes stop output from user services from being properly attributed to their service unit. Therefore, filtering by the {{ic|-u}} may unwittingly exclude some of the output from the service units.<br />
<br />
== Some use cases ==<br />
<br />
=== Persistent terminal multiplexer ===<br />
<br />
{{Out of date|References {{ic|user-session@.service}} instead of {{ic|user@.service}}; the latter does not contain {{ic|1=Conflicts=getty@tty1.service}}.}}<br />
<br />
You may wish your user session to default to running a terminal multiplexer, such as [[GNU Screen]] or [[Tmux]], in the background rather than logging you into a window manager session. Separating login from X login is most likely only useful for those who boot to a TTY instead of to a display manager (in which case you can simply bundle everything you start in with myStuff.target). <br />
<br />
To create this type of user session, procede as above, but instead of creating wm.target, create multiplexer.target:<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=Terminal multiplexer<br />
Documentation=info:screen man:screen(1) man:tmux(1)<br />
After=cruft.target<br />
Wants=cruft.target<br />
<br />
[Install]<br />
Alias=default.target<br />
}}<br />
<br />
{{ic|cruft.target}}, like {{ic|mystuff.target}} above, should start anything you think should run before tmux or screen starts (or which you want started at boot regardless of timing), such as a GnuPG daemon session.<br />
<br />
You then need to create a service for your multiplexer session. Here is a sample service, using tmux as an example and sourcing a gpg-agent session which wrote its information to {{ic|/tmp/gpg-agent-info}}. This sample session, when you start X, will also be able to run X programs, since DISPLAY is set.<br />
<br />
{{bc|1=<br />
[Unit]<br />
Description=tmux: A terminal multiplixer <br />
Documentation=man:tmux(1)<br />
After=gpg-agent.service<br />
Wants=gpg-agent.service<br />
<br />
[Service]<br />
Type=forking<br />
ExecStart=/usr/bin/tmux start<br />
ExecStop=/usr/bin/tmux kill-server<br />
Environment=DISPLAY=:0<br />
EnvironmentFile=/tmp/gpg-agent-info<br />
<br />
[Install]<br />
WantedBy=multiplexer.target<br />
}}<br />
<br />
Once this is done, {{ic|systemctl --user enable}} {{ic|tmux.service}}, {{ic|multiplexer.target}} and any services you created to be run by {{ic|cruft.target}} and you should be set to go! Activated {{ic|user-session@.service}} as described above, but be sure to remove the {{ic|1=Conflicts=getty@tty1.service}} from {{ic|user-session@.service}}, since your user session will not be taking over a TTY. Congratulations! You have a running terminal multiplexer and some other useful programs ready to start at boot!<br />
<br />
=== Window manager ===<br />
<br />
To run a window manager as a systemd service, you first need to run [[#Xorg as a systemd user service]]. In the following we will use awesome as an example:<br />
<br />
{{hc|~/.config/systemd/user/awesome.service|<nowiki><br />
[Unit]<br />
Description=Awesome window manager<br />
After=xorg.target<br />
Requires=xorg.target<br />
<br />
[Service]<br />
ExecStart=/usr/bin/awesome<br />
Restart=always<br />
RestartSec=10<br />
<br />
[Install]<br />
WantedBy=wm.target<br />
</nowiki>}}<br />
<br />
{{Note|The {{ic|[Install]}} section includes a {{ic|WantedBy}} part. When using {{ic|systemctl --user enable}} it will link this as {{ic|~/.config/systemd/user/wm.target.wants/''window_manager''.service}}, allowing it to be started at login. Is recommended to enable this service, not to link it manually.}}<br />
<br />
== Kill user processes on logout ==<br />
<br />
Arch Linux builds the {{pkg|systemd}} package with {{ic|--without-kill-user-processes}}, setting {{ic|1=KillUserProcesses}} to {{ic|no}} by default. This setting causes user processes not to be killed when the user completely logs out. To change this behavior in order to have all user processes killed on the user's logout, set {{ic|1=KillUserProcesses=yes}} in {{ic|/etc/systemd/logind.conf}}. <br />
<br />
Note that changing this setting breaks terminal multiplexers such as [[tmux]] and [[screen]]. If you change this setting, you can still use a terminal multiplexer by using {{ic|systemd-run}} as follows:<br />
<br />
$ systemd-run --scope --user ''command'' ''args''<br />
<br />
For example, to run {{ic|screen}} you would do:<br />
<br />
$ systemd-run --scope --user screen -S ''foo''<br />
<br />
== Known issues ==<br />
<br />
* Enabling systemd user units [https://github.com/systemd/systemd/issues/2863 causes login problems].<br />
<br />
== See also ==<br />
* [https://bitbucket.org/KaiSforza/systemd-user-units/wiki/Home KaiSforza's Bitbucket wiki]<br />
* [https://github.com/zoqaeski/systemd-user-units Zoqaeski's units on GitHub]<br />
* [https://bbs.archlinux.org/viewtopic.php?id=167115 Arch forum thread about changes in systemd 206 user instances]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Systemd&diff=502771Systemd2017-12-16T06:10:38Z<p>GenkiSky: /* Troubleshooting */ Remove unneeded workaround ( see https://bugzilla.redhat.com/show_bug.cgi?id=955379#c37 )</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[Category:Init]]<br />
[[ar:Systemd]]<br />
[[de:Systemd]]<br />
[[el:Systemd]]<br />
[[es:Systemd]]<br />
[[fa:Systemd]]<br />
[[fr:Systemd]]<br />
[[it:Systemd]]<br />
[[ja:Systemd]]<br />
[[pt:Systemd]]<br />
[[ru:Systemd]]<br />
[[zh-hans:Systemd]]<br />
[[zh-hant:Systemd]]<br />
{{Related articles start}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd/Timers}}<br />
{{Related|systemd FAQ}}<br />
{{Related|init}}<br />
{{Related|Daemons#List of daemons}}<br />
{{Related|udev}}<br />
{{Related|Improve boot performance}}<br />
{{Related|Allow users to shutdown}}<br />
{{Related articles end}}<br />
<br />
From the [http://freedesktop.org/wiki/Software/systemd project web page]:<br />
<br />
:''systemd'' is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system. systemd provides aggressive parallelization capabilities, uses socket and [[D-Bus]] activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux [[control groups]], maintains mount and automount points, and implements an elaborate transactional dependency-based service control logic. ''systemd'' supports SysV and LSB init scripts and works as a replacement for sysvinit. Other parts include a logging daemon, utilities to control basic system configuration like the hostname, date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution.<br />
<br />
{{Note|1=For a detailed explanation as to why Arch has moved to ''systemd'', see [https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 this forum post].}}<br />
<br />
== Basic systemctl usage ==<br />
<br />
The main command used to introspect and control ''systemd'' is ''systemctl''. Some of its uses are examining the system state and managing the system and services. See {{man|1|systemctl}} for more details.<br />
<br />
{{Tip|<br />
* You can use all of the following ''systemctl'' commands with the {{ic|-H ''user''@''host''}} switch to control a ''systemd'' instance on a remote machine. This will use [[SSH]] to connect to the remote ''systemd'' instance.<br />
* ''systemadm'' is the official graphical frontend for ''systemctl'' and is provided by the {{Pkg|systemd-ui}} package.<br />
* [[Plasma]] users can install {{Pkg|systemd-kcm}} as a graphical frontend for ''systemctl''. After installing the module will be added under ''System administration''.}}<br />
<br />
=== Analyzing the system state ===<br />
<br />
Show '''system status''' using:<br />
<br />
$ systemctl status<br />
<br />
'''List running''' units:<br />
<br />
$ systemctl<br />
<br />
or:<br />
<br />
$ systemctl list-units<br />
<br />
'''List failed''' units:<br />
<br />
$ systemctl --failed<br />
<br />
The available unit files can be seen in {{ic|/usr/lib/systemd/system/}} and {{ic|/etc/systemd/system/}} (the latter takes precedence). '''List installed''' unit files with:<br />
<br />
$ systemctl list-unit-files<br />
<br />
=== Using units ===<br />
<br />
Units can be, for example, services (''.service''), mount points (''.mount''), devices (''.device'') or sockets (''.socket'').<br />
<br />
When using ''systemctl'', you generally have to specify the complete name of the unit file, including its suffix, for example {{ic|sshd.socket}}. There are however a few short forms when specifying the unit in the following ''systemctl'' commands:<br />
<br />
* If you do not specify the suffix, systemctl will assume ''.service''. For example, {{ic|netctl}} and {{ic|netctl.service}} are equivalent.<br />
* Mount points will automatically be translated into the appropriate ''.mount'' unit. For example, specifying {{ic|/home}} is equivalent to {{ic|home.mount}}.<br />
* Similar to mount points, devices are automatically translated into the appropriate ''.device'' unit, therefore specifying {{ic|/dev/sda2}} is equivalent to {{ic|dev-sda2.device}}.<br />
<br />
See {{man|5|systemd.unit}} for details.<br />
<br />
{{Note|Some unit names contain an {{ic|@}} sign (e.g. {{ic|name@''string''.service}}): this means that they are [http://0pointer.de/blog/projects/instances.html instances] of a ''template'' unit, whose actual file name does not contain the {{ic|''string''}} part (e.g. {{ic|name@.service}}). {{ic|''string''}} is called the ''instance identifier'', and is similar to an argument that is passed to the template unit when called with the ''systemctl'' command: in the unit file it will substitute the {{ic|%i}} specifier. <br />
<br />
To be more accurate, ''before'' trying to instantiate the {{ic|name@.suffix}} template unit, ''systemd'' will actually look for a unit with the exact {{ic|name@string.suffix}} file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an {{ic|@}} sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will just fail, since the {{ic|%i}} specifier cannot be substituted.<br />
}}<br />
<br />
{{Tip|<br />
* Most of the following commands also work if multiple units are specified, see {{man|1|systemctl}} for more information.<br />
* The {{ic|--now}} switch can be used in conjunction with {{ic|enable}}, {{ic|disable}}, and {{ic|mask}} to respectively start, stop, or mask immediately the unit rather than after the next boot.<br />
* A package may offer units for different purposes. If you just installed a package, {{ic|pacman -Qql ''package'' <nowiki>|</nowiki> grep -Fe .service -e .socket}} can be used to check and find them.}}<br />
<br />
'''Start''' a unit immediately:<br />
<br />
# systemctl start ''unit''<br />
<br />
'''Stop''' a unit immediately:<br />
<br />
# systemctl stop ''unit''<br />
<br />
'''Restart''' a unit:<br />
<br />
# systemctl restart ''unit''<br />
<br />
Ask a unit to '''reload''' its configuration:<br />
<br />
# systemctl reload ''unit''<br />
<br />
Show the '''status''' of a unit, including whether it is running or not:<br />
<br />
$ systemctl status ''unit''<br />
<br />
'''Check''' whether a unit is already enabled or not:<br />
<br />
$ systemctl is-enabled ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''':<br />
<br />
# systemctl enable ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''' and '''Start''' immediately:<br />
<br />
# systemctl enable --now ''unit''<br />
<br />
'''Disable''' a unit to not start during bootup:<br />
<br />
# systemctl disable ''unit''<br />
<br />
'''Mask''' a unit to make it impossible to start it:<br />
<br />
# systemctl mask ''unit''<br />
<br />
'''Unmask''' a unit:<br />
<br />
# systemctl unmask ''unit''<br />
<br />
Show the '''manual page''' associated with a unit (this has to be supported by the unit file):<br />
<br />
$ systemctl help ''unit''<br />
<br />
Reload ''systemd'', scanning for '''new or changed units''':<br />
<br />
# systemctl daemon-reload<br />
<br />
=== Power management ===<br />
<br />
[[polkit]] is necessary for power management as an unprivileged user. If you are in a local ''systemd-logind'' user session and no other session is active, the following commands will work without root privileges. If not (for example, because another user is logged into a tty), ''systemd'' will automatically ask you for the root password.<br />
<br />
Shut down and reboot the system:<br />
<br />
$ systemctl reboot<br />
<br />
Shut down and power-off the system:<br />
<br />
$ systemctl poweroff<br />
<br />
Suspend the system:<br />
<br />
$ systemctl suspend<br />
<br />
Put the system into hibernation:<br />
<br />
$ systemctl hibernate<br />
<br />
Put the system into hybrid-sleep state (or suspend-to-both):<br />
<br />
$ systemctl hybrid-sleep<br />
<br />
== Writing unit files ==<br />
<br />
The syntax of ''systemd'''s [http://www.freedesktop.org/software/systemd/man/systemd.unit.html unit files] is inspired by XDG Desktop Entry Specification ''.desktop'' files, which are in turn inspired by Microsoft Windows ''.ini'' files. Unit files are loaded from two locations. From lowest to highest precedence they are:<br />
<br />
* {{ic|/usr/lib/systemd/system/}}: units provided by installed packages<br />
* {{ic|/etc/systemd/system/}}: units installed by the system administrator<br />
<br />
{{Note|<br />
* The load paths are completely different when running ''systemd'' in [[systemd/User#How it works|user mode]].<br />
* systemd unit names may only contain ASCII alphanumeric characters, underscores and periods. All other characters must be replaced by C-style "\x2d" escapes, or employ their pre defined semantics ('@', '-'). See {{man|5|systemd.unit}} and {{man|1|systemd-escape}} for more information.}}<br />
<br />
Look at the units installed by your packages for examples, as well as the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples annotated example section] of {{man|5|systemd.service}}.<br />
<br />
{{Tip|Comments prepended with {{ic|#}} may be used in unit-files as well, but only in new lines. Do not use end-line comments after ''systemd'' parameters or the unit will fail to activate.}}<br />
<br />
=== Handling dependencies ===<br />
<br />
With ''systemd'', dependencies can be resolved by designing the unit files correctly. The most typical case is that the unit ''A'' requires the unit ''B'' to be running before ''A'' is started. In that case add {{ic|1=Requires=''B''}} and {{ic|1=After=''B''}} to the {{ic|[Unit]}} section of ''A''. If the dependency is optional, add {{ic|1=Wants=''B''}} and {{ic|1=After=''B''}} instead. Note that {{ic|1=Wants=}} and {{ic|1=Requires=}} do not imply {{ic|1=After=}}, meaning that if {{ic|1=After=}} is not specified, the two units will be started in parallel.<br />
<br />
Dependencies are typically placed on services and not on [[#Targets]]. For example, {{ic|network.target}} is pulled in by whatever service configures your network interfaces, therefore ordering your custom unit after it is sufficient since {{ic|network.target}} is started anyway.<br />
<br />
=== Service types ===<br />
<br />
There are several different start-up types to consider when writing a custom service file. This is set with the {{ic|1=Type=}} parameter in the {{ic|[Service]}} section:<br />
<br />
* {{ic|1=Type=simple}} (default): ''systemd'' considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.<br />
* {{ic|1=Type=forking}}: ''systemd'' considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify {{ic|1=PIDFile=}} as well so ''systemd'' can keep track of the main process.<br />
* {{ic|1=Type=oneshot}}: this is useful for scripts that do a single job and then exit. You may want to set {{ic|1=RemainAfterExit=yes}} as well so that ''systemd'' still considers the service as active after the process has exited.<br />
* {{ic|1=Type=notify}}: identical to {{ic|1=Type=simple}}, but with the stipulation that the daemon will send a signal to ''systemd'' when it is ready. The reference implementation for this notification is provided by ''libsystemd-daemon.so''.<br />
* {{ic|1=Type=dbus}}: the service is considered ready when the specified {{ic|BusName}} appears on DBus's system bus.<br />
* {{ic|1=Type=idle}}: ''systemd'' will delay execution of the service binary until all jobs are dispatched. Other than that behavior is very similar to {{ic|1=Type=simple}}. <br />
<br />
See the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= systemd.service(5)] man page for a more detailed explanation of the {{ic|Type}} values.<br />
<br />
=== Editing provided units ===<br />
<br />
To avoid conflicts with pacman, unit files provided by packages should not be directly edited. There are two safe ways to modify a unit without touching the original file: create a new unit file which [[#Replacement unit files|overrides the original unit]] or create [[#Drop-in files|drop-in snippets]] which are applied on top of the original unit. For both methods, you must reload the unit afterwards to apply your changes. This can be done either by editing the unit with {{ic|systemctl edit}} (which reloads the unit automatically) or by reloading all units with:<br />
<br />
# systemctl daemon-reload<br />
<br />
{{Tip|<br />
* You can use ''systemd-delta'' to see which unit files have been overridden or extended and what exactly has been changed.<br />
* Use {{ic|systemctl cat ''unit''}} to view the content of a unit file and all associated drop-in snippets.<br />
* The default syntax highlighting for ''systemd'' unit files within [[Vim]] is the same as for [[Wikipedia:Ini_file|INI files]]. However, if you want something more systemd-specific, install {{Pkg|vim-systemd}}.<br />
}}<br />
<br />
==== Replacement unit files ====<br />
<br />
To replace the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the file {{ic|/etc/systemd/system/''unit''}} and reenable the unit to update the symlinks:<br />
<br />
# systemctl reenable ''unit''<br />
<br />
Alternatively, run:<br />
<br />
# systemctl edit --full ''unit''<br />
<br />
This opens {{ic|/etc/systemd/system/''unit''}} in your editor (copying the installed version if it does not exist yet) and automatically reloads it when you finish editing.<br />
<br />
{{Note|Pacman does not update the replacement unit files when the originals are updated, so this method can make system maintenance more difficult. For this reason the next approach is recommended.}}<br />
<br />
==== Drop-in files ====<br />
<br />
To create drop-in files for the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the directory {{ic|/etc/systemd/system/''unit''.d/}} and place ''.conf'' files there to override or add new options. ''systemd'' will parse these ''.conf'' files and apply them on top of the original unit.<br />
<br />
The easiest way to do this is to run:<br />
<br />
# systemctl edit ''unit''<br />
<br />
This opens the file {{ic|/etc/systemd/system/''unit''.d/override.conf}} in your text editor (creating it if necessary) and automatically reloads the unit when you are done editing.<br />
<br />
==== Revert to vendor version ====<br />
<br />
To revert any changes to a unit made using {{ic|systemctl edit}} do:<br />
<br />
# systemctl revert ''unit''<br />
<br />
==== Examples ====<br />
<br />
For example, if you simply want to add an additional dependency to a unit, you may create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customdependency.conf|2=<br />
[Unit]<br />
Requires=''new dependency''<br />
After=''new dependency''<br />
}}<br />
<br />
As another example, in order to replace the {{ic|ExecStart}} directive for a unit that is not of type {{ic|oneshot}}, create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customexec.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=''new command''<br />
}}<br />
<br />
Note how {{ic|ExecStart}} must be cleared before being re-assigned [https://bugzilla.redhat.com/show_bug.cgi?id=756787#c9]. The same holds for every item that can be specified multiple times, e.g. {{ic|OnCalendar}} for timers.<br />
<br />
One more example to automatically restart a service:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/restart.conf|2=<br />
[Service]<br />
Restart=always<br />
RestartSec=30<br />
}}<br />
<br />
== Targets ==<br />
<br />
{{Style|Unclear description, copy-pasted content (explicitly mentions "Fedora").|section=Make section "Targets" more clearly}}<br />
<br />
''systemd'' uses ''targets'' which serve a similar purpose as [[wikipedia:Runlevel|runlevels]] but act a little different. Each ''target'' is named instead of numbered and is intended to serve a specific purpose with the possibility of having multiple ones active at the same time. Some ''target''s are implemented by inheriting all of the services of another ''target'' and adding additional services to it. There are ''systemd'' ''target''s that mimic the common SystemVinit runlevels so you can still switch ''target''s using the familiar {{ic|telinit RUNLEVEL}} command.<br />
<br />
=== Get current targets ===<br />
<br />
The following should be used under ''systemd'' instead of running {{ic|runlevel}}:<br />
<br />
$ systemctl list-units --type=target<br />
<br />
=== Create custom target ===<br />
<br />
The runlevels that held a defined meaning under sysvinit (i.e., 0, 1, 3, 5, and 6); have a 1:1 mapping with a specific ''systemd'' ''target''. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named ''systemd'' ''target'' as {{ic|/etc/systemd/system/''your target''}} that takes one of the existing runlevels as a base (you can look at {{ic|/usr/lib/systemd/system/graphical.target}} as an example), make a directory {{ic|/etc/systemd/system/''your target''.wants}}, and then symlink the additional services from {{ic|/usr/lib/systemd/system/}} that you wish to enable.<br />
<br />
=== Mapping between SysV runlevels and systemd targets ===<br />
<br />
{| class="wikitable"<br />
! SysV Runlevel !! systemd Target !! Notes<br />
|-<br />
| 0 || runlevel0.target, poweroff.target || Halt the system.<br />
|-<br />
| 1, s, single || runlevel1.target, rescue.target || Single user mode.<br />
|-<br />
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.<br />
|-<br />
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.<br />
|-<br />
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.<br />
|-<br />
| 6 || runlevel6.target, reboot.target || Reboot<br />
|-<br />
| emergency || emergency.target || Emergency shell<br />
|-<br />
|}<br />
<br />
=== Change current target ===<br />
<br />
In ''systemd'' targets are exposed via ''target units''. You can change them like this:<br />
<br />
# systemctl isolate graphical.target<br />
<br />
This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as {{ic|telinit 3}} or {{ic|telinit 5}} in Sysvinit.<br />
<br />
=== Change default target to boot into ===<br />
<br />
The standard target is {{ic|default.target}}, which is aliased by default to {{ic|graphical.target}} (which roughly corresponds to the old runlevel 5). To change the default target at boot-time, append one of the following [[kernel parameters]] to your bootloader:<br />
<br />
* {{ic|1=systemd.unit=multi-user.target}} (which roughly corresponds to the old runlevel 3),<br />
* {{ic|1=systemd.unit=rescue.target}} (which roughly corresponds to the old runlevel 1).<br />
<br />
Alternatively, you may leave the bootloader alone and change {{ic|default.target}}. This can be done using ''systemctl'':<br />
<br />
# systemctl set-default multi-user.target<br />
<br />
To be able to override the previously set {{ic|default.target}}, use the force option:<br />
<br />
# systemctl set-default -f multi-user.target<br />
<br />
The effect of this command is output by ''systemctl''; a symlink to the new default target is made at {{ic|/etc/systemd/system/default.target}}.<br />
<br />
== Temporary files ==<br />
<br />
"''systemd-tmpfiles'' creates, deletes and cleans up volatile and temporary files and directories." It reads configuration files in {{ic|/etc/tmpfiles.d/}} and {{ic|/usr/lib/tmpfiles.d/}} to discover which actions to perform. Configuration files in the former directory take precedence over those in the latter directory.<br />
<br />
Configuration files are usually provided together with service files, and they are named in the style of {{ic|/usr/lib/tmpfiles.d/''program''.conf}}. For example, the [[Samba]] daemon expects the directory {{ic|/run/samba}} to exist and to have the correct permissions. Therefore, the {{Pkg|samba}} package ships with this configuration:<br />
<br />
{{hc|/usr/lib/tmpfiles.d/samba.conf|<br />
D /run/samba 0755 root root}}<br />
<br />
Configuration files may also be used to write values into certain files on boot. For example, if you used {{ic|/etc/rc.local}} to disable wakeup from USB devices with {{ic|echo USBE > /proc/acpi/wakeup}}, you may use the following tmpfile instead:<br />
<br />
{{hc|/etc/tmpfiles.d/disable-usb-wake.conf|<br />
w /proc/acpi/wakeup - - - - USBE}}<br />
<br />
See the {{man|8|systemd-tmpfiles}} and {{man|5|tmpfiles.d}} man pages for details.<br />
<br />
{{Note|This method may not work to set options in {{ic|/sys}} since the ''systemd-tmpfiles-setup'' service may run before the appropriate device modules is loaded. In this case you could check whether the module has a parameter for the option you want to set with {{ic|modinfo ''module''}} and set this option with a [[Kernel modules#Setting module options|config file in /etc/modprobe.d]]. Otherwise you will have to write a [[Udev#About_udev_rules|udev rule]] to set the appropriate attribute as soon as the device appears.}}<br />
<br />
== Timers ==<br />
<br />
A timer is a unit configuration file whose name ends with ''.timer'' and encodes information about a timer controlled and supervised by ''systemd'', for timer-based activation. See [[systemd/Timers]].<br />
<br />
{{Note|Timers can replace [[cron]] functionality to a great extent. See [[systemd/Timers#As a cron replacement]].}}<br />
<br />
== Mounting ==<br />
<br />
Since systemd is a replacement for System V init, it is in charge of the mounts specified in {{ic|/etc/fstab}}. In fact, it goes beyond the usual {{ic|fstab}} capabilities, implementing special mount options prefixed with {{ic|x-systemd.}}. See [[Fstab#Automount with systemd]] for an example of ''automounting'' (mounting on-demand) using these extensions. See [https://www.freedesktop.org/software/systemd/man/systemd.mount.html#fstab] for the complete documentation of these extensions.<br />
<br />
== Journal ==<br />
<br />
''systemd'' has its own logging system called the journal; therefore, running a {{ic|syslog}} daemon is no longer required. To read the log, use:<br />
<br />
# journalctl<br />
<br />
In Arch Linux, the directory {{ic|/var/log/journal/}} is a part of the {{Pkg|systemd}} package, and the journal (when {{ic|1=Storage=}} is set to {{ic|auto}} in {{ic|/etc/systemd/journald.conf}}) will write to {{ic|/var/log/journal/}}. If you or some program delete that directory, ''systemd'' will '''not''' recreate it automatically and instead will write its logs to {{ic|/run/systemd/journal}} in a nonpersistent way. However, the folder will be recreated when you set {{ic|1=Storage=persistent}} and run {{ic|systemctl restart systemd-journald}} (or reboot).<br />
<br />
Systemd journal classifies messages by [[#Priority level|Priority level]] and [[#Facility|Facility]]. Logging classification corresponds to classic [[wikipedia:Syslog|Syslog]] protocol ([https://tools.ietf.org/html/rfc5424 RFC 5424]).<br />
<br />
===Priority level===<br />
<br />
A syslog severity code (in systemd called priority) is used to mark the importance of a message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
|-<br />
! Value !! Severity !! Keyword !! Description || Examples<br />
|-<br />
| 0 || Emergency || emerg || System is unusable || Severe Kernel BUG, systemd dumped core.<br>This level should not be used by applications.<br />
|-<br />
| 1 || Alert || alert || Should be corrected immediately || Vital subsystem goes out of work. Data loss. <br>{{ic|kernel: BUG: unable to handle kernel paging request at ffffc90403238ffc|}}.<br />
|-<br />
| 2 || Critical || crit || Critical conditions || Crashes, coredumps. Like familiar flash:<br>{{ic|systemd-coredump[25319]: Process 25310 (plugin-containe) of user 1000 dumped core}}<br>Failure in the system primary application, like X11. <br />
|-<br />
| 3 || Error || err || Error conditions || Not severe error reported:<br>{{ic|kernel: usb 1-3: 3:1: cannot get freq at ep 0x84}},<br>{{ic|systemd[1]: Failed unmounting /var.}},<br>{{ic|libvirtd[1720]: internal error: Failed to initialize a valid firewall backend}}).<br />
|-<br />
| 4 || Warning || warning || May indicate that an error will occur if action is not taken. || A non-root file system has only 1GB free.<br>{{ic|org.freedesktop. Notifications[1860]: (process:5999): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale}}.<br />
|-<br />
| 5 || Notice || notice || Events that are unusual, but not error conditions. || {{ic|systemd[1]: var.mount: Directory /var to mount over is not empty, mounting anyway}}. {{ic|gcr-prompter[4997]: Gtk: GtkDialog mapped without a transient parent. This is discouraged}}.<br />
|-<br />
| 6 || Informational || info || Normal operational messages that require no action. || {{ic|lvm[585]: 7 logical volume(s) in volume group "archvg" now active}}.<br />
|-<br />
| 7 || Debug || debug || Information useful to developers for debugging the application. || {{ic|kdeinit5[1900]: powerdevil: Scheduling inhibition from ":1.14" "firefox" with cookie 13 and reason "screen"}}.<br />
|}<br />
<br />
If you cannot find a message on the expected priority level, also search a couple of levels above and below: these rules are recommendations, and the developer of the affected application may have a different perception of the issue's importance from yours.<br />
<br />
===Facility===<br />
<br />
A syslog facility code is used to specify the type of program that is logging the message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
! Facility code !! Keyword !! Description !! Info<br />
|-<br />
| 0 || kern || kernel messages<br />
|-<br />
| 1 || user || user-level messages<br />
|-<br />
| 2 || mail || mail system || Archaic POSIX still supported and sometimes used system, for more {{man|1|mail}})<br />
|-<br />
| 3 || daemon || system daemons || All daemons, including systemd and its subsystems<br />
|-<br />
| 4 || auth || security/authorization messages || Also watch for different facility 10<br />
|-<br />
| 5 || syslog || messages generated internally by syslogd || As it standartized for syslogd, not used by systemd (see facility 3)<br />
|-<br />
| 6 || lpr || line printer subsystem (archaic subsystem)<br />
|-<br />
| 7 || news || network news subsystem (archaic subsystem)<br />
|-<br />
| 8 || uucp || UUCP subsystem (archaic subsystem)<br />
|-<br />
| 9 || || clock daemon || systemd-timesyncd<br />
|-<br />
| 10 || authpriv || security/authorization messages || Also watch for different facility 4<br />
|-<br />
| 11 || ftp || FTP daemon<br />
|-<br />
| 12 || - || NTP subsystem<br />
|-<br />
| 13 || - || log audit<br />
|-<br />
| 14 || - || log alert<br />
|-<br />
| 15 || cron || scheduling daemon<br />
|-<br />
| 16 || local0 || local use 0 (local0)<br />
|-<br />
| 17 || local1 || local use 1 (local1)<br />
|-<br />
| 18 || local2 || local use 2 (local2)<br />
|-<br />
| 19 || local3 || local use 3 (local3)<br />
|-<br />
| 20 || local4 || local use 4 (local4)<br />
|-<br />
| 21 || local5 || local use 5 (local5)<br />
|-<br />
| 22 || local6 || local use 6 (local6)<br />
|-<br />
| 23 || local7 || local use 7 (local7)<br />
|}<br />
<br />
So, useful facilities to watch: 0,1,3,4,9,10,15.<br />
<br />
=== Filtering output ===<br />
<br />
''journalctl'' allows you to filter the output by specific fields. Be aware that if there are many messages to display or filtering of large time span has to be done, the output of this command can be delayed for quite some time.<br />
<br />
{{Tip|While the journal is stored in a binary format, the content of stored messages is not modified. This means it is viewable with ''strings'', for example for recovery in an environment which does not have ''systemd'' installed. Example command:<br />
{{bc|$ strings /mnt/arch/var/log/journal/af4967d77fba44c6b093d0e9862f6ddd/system.journal <nowiki>| grep -i</nowiki> ''message''}}<br />
}}<br />
<br />
Examples:<br />
<br />
* Show all messages from this boot: {{bc|# journalctl -b}} However, often one is interested in messages not from the current, but from the previous boot (e.g. if an unrecoverable system crash happened). This is possible through optional offset parameter of the {{ic|-b}} flag: {{ic|journalctl -b -0}} shows messages from the current boot, {{ic|journalctl -b -1}} from the previous boot, {{ic|journalctl -b -2}} from the second previous and so on. See {{man|1|journalctl}} for full description, the semantics is much more powerful.<br />
* Show all messages from date (and optional time): {{bc|1=# journalctl --since="2012-10-30 18:17:16"}}<br />
* Show all messages since 20 minutes ago: {{bc|1=# journalctl --since "20 min ago"}}<br />
* Follow new messages: {{bc|# journalctl -f}}<br />
* Show all messages by a specific executable: {{bc|# journalctl /usr/lib/systemd/systemd}}<br />
* Show all messages by a specific process: {{bc|1=# journalctl _PID=1}}<br />
* Show all messages by a specific unit: {{bc|# journalctl -u netcfg}}<br />
* Show kernel ring buffer: {{bc|1=# journalctl -k}}<br />
* Show only error, critical, and alert priority messages {{bc|# journalctl -p err..alert}} Numbers also can be used, {{ic|journalctl -p 3..1}}. If single number/keyword used, {{ic|journalctl -p 3}} - all higher priority levels also included.<br />
* Show auth.log equivalent by filtering on syslog facility: {{bc|1=# journalctl SYSLOG_FACILITY=10}}<br />
<br />
See {{man|1|journalctl}}, {{man|7|systemd.journal-fields}}, or Lennart's [http://0pointer.de/blog/projects/journalctl.html blog post] for details.<br />
<br />
{{Tip|1=<br />
By default, ''journalctl'' truncates lines longer than screen width, but in some cases, it may be better to enable wrapping instead of truncating. This can be controlled by the {{ic|SYSTEMD_LESS}} [[environment variable]], which contains options passed to [[Core utilities#less|less]] (the default pager) and defaults to {{ic|FRSXMK}} (see {{man|1|less}} and {{man|1|journalctl}} for details).<br />
<br />
By omitting the {{ic|S}} option, the output will be wrapped instead of truncated. For example, start ''journalctl'' as follows:<br />
<br />
$ SYSTEMD_LESS=FRXMK journalctl<br />
<br />
If you would like to set this behaviour as default, [[Environment variables#Per_user|export]] the variable from {{ic|~/.bashrc}} or {{ic|~/.zshrc}}.<br />
}}<br />
<br />
=== Journal size limit ===<br />
<br />
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the underlying file system but capped to 4 GiB. For example, with {{ic|/var/log/journal/}} located on a 20 GiB partition, journal data may take up to 2 GiB. On a 50 GiB partition, it would max at 4 GiB.<br />
<br />
The maximum size of the persistent journal can be controlled by uncommenting and changing the following:<br />
<br />
{{hc|/etc/systemd/journald.conf|2=<br />
SystemMaxUse=50M<br />
}}<br />
<br />
It is also possible to use the drop-in snippets configuration override mechanism rather than editing the global configuration file. In this case do not forget to place the overrides under the {{ic|[Journal]}} header:<br />
<br />
{{hc|/etc/systemd/journald.conf.d/00-journal-size.conf|2=<br />
[Journal]<br />
SystemMaxUse=50M<br />
}}<br />
<br />
Restart the {{ic|systemd-journald}} service after changing this setting to immediately apply the new limit.<br />
<br />
See {{man|5|journald.conf}} for more info.<br />
<br />
=== Clean journal files manually ===<br />
<br />
Journal files can be globally removed from {{ic|/var/log/journal/}} using ''e.g.'' {{ic|rm}}, or can be trimmed according to various criteria using {{ic|journalctl}}. Examples:<br />
<br />
* Remove archived journal files until the disk space they use falls below 100M: {{bc|1=# journalctl --vacuum-size=100M}}<br />
* Make all journal files contain no data older than 2 weeks. {{bc|1=# journalctl --vacuum-time=2weeks}}<br />
<br />
See {{man|1|journalctl}} for more info.<br />
<br />
=== Journald in conjunction with syslog ===<br />
<br />
Compatibility with a classic, non-journald aware [[Syslog-ng|syslog]] implementation can be provided by letting ''systemd'' forward all messages via the socket {{ic|/run/systemd/journal/syslog}}. To make the syslog daemon work with the journal, it has to bind to this socket instead of {{ic|/dev/log}} ([http://lwn.net/Articles/474968/ official announcement]). <br />
<br />
The default {{ic|journald.conf}} for forwarding to the socket is {{ic|1=ForwardToSyslog=no}} to avoid system overhead, because [[rsyslog]] or [[syslog-ng]] pull the messages from the journal by [http://lists.freedesktop.org/archives/systemd-devel/2014-August/022295.html#journald itself]. <br />
<br />
See [[Syslog-ng#Overview]] and [[Syslog-ng#syslog-ng and systemd journal]], or [[rsyslog]] respectively, for details on configuration.<br />
<br />
=== Forward journald to /dev/tty12 ===<br />
<br />
Create a [[#Editing provided units|drop-in directory]] {{ic|/etc/systemd/journald.conf.d}} and create a {{ic|fw-tty12.conf}} file in it:<br />
<br />
{{hc|1=/etc/systemd/journald.conf.d/fw-tty12.conf|2=<br />
[Journal]<br />
ForwardToConsole=yes<br />
TTYPath=/dev/tty12<br />
MaxLevelConsole=info<br />
}}<br />
<br />
Then [[restart]] systemd-journald.<br />
<br />
=== Specify a different journal to view ===<br />
There may be a need to check the logs of another system that is dead in the water, like booting from a live system to recover a production system. In such case, one can mount the disk in e.g. {{ic|/mnt}}, and specify the journal path via {{ic|-D}}/{{ic|--directory}}, like so:<br />
<br />
$ journalctl -D ''/mnt''/var/log/journal -xe<br />
<br />
== Tips and tricks ==<br />
<br />
=== Enable installed units by default ===<br />
<br />
{{Expansion|How does it work with instantiated units?}}<br />
<br />
Arch Linux ships with {{ic|/usr/lib/systemd/system-preset/99-default.preset}} containing {{ic|disable *}}. This causes ''systemctl preset'' to disable all units by default, such that when a new package is installed, the user must manually enable the unit.<br />
<br />
If this behavior is not desired, simply create a symlink from {{ic|/etc/systemd/system-preset/99-default.preset}} to {{ic|/dev/null}} in order to override the configuration file. This will cause ''systemctl preset'' to enable all units that get installed—regardless of unit type—unless specified in another file in one ''systemctl preset'''s configuration directories. User units are not affected. See {{man|5|systemd.preset}} for more information.<br />
<br />
{{Note|Enabling all units by default may cause problems with packages that contain two or more mutually exclusive units. ''systemctl preset'' is designed to be used by distributions and spins or system administrators. In the case where two conflicting units would be enabled, you should explicitly specify which one is to be disabled in a preset configuration file as specified in the manpage for {{ic|systemd.preset}}.}}<br />
<br />
=== Sandboxing application environments ===<br />
A unit file can be created as a sandbox to isolate applications and their processes within a hardened virtual environment. systemd leverages [[wikipedia:Linux_namespaces|namespaces]], white-/blacklisting of [[Capabilities]], and [[control groups]] to container processes through an extensive [https://www.freedesktop.org/software/systemd/man/systemd.exec.html execution environment configuration].<br />
<br />
The enhancement of an existing systemd unit file with application sandboxing typically requires trial-and-error tests accompanied by the generous use of {{Pkg|strace}}, [[wikipedia:Standard_streams#Standard_error_.28stderr.29|stderr]] and [https://www.freedesktop.org/software/systemd/man/journalctl.html journalctl] error logging and output facilities. You may want to first search upstream documentation for already done tests to base trials on.<br />
<br />
Some examples on how sandboxing with systemd can be deployed:<br />
* {{Ic|CapabilityBoundingSet}} defines a whitelisted set of allowed capabilities, but may also be used to blacklist a specific capability for a unit.<br />
** The {{Ic|CAP_SYS_ADM}} capability, for example, which should be one of the [https://lwn.net/Articles/486306/ goals of a secure sandbox]: {{ic|1=CapabilityBoundingSet=~ CAP_SYS_ADM}}<br />
* [[Unbound#Sandboxing]]{{Broken section link}} shows a full-scale example of systemd features for sandboxing.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Investigating systemd errors ===<br />
<br />
As an example, we will investigate an error with {{ic|systemd-modules-load}} service:<br />
<br />
'''1.''' Lets find the ''systemd'' services which fail to start at boot time:<br />
<br />
{{hc|1=$ systemctl --state=failed|2=<br />
systemd-modules-load.service loaded '''failed failed''' Load Kernel Modules}}<br />
<br />
Another way is to live log ''systemd'' messages:<br />
<br />
$ journalctl -fp err<br />
<br />
'''2.''' Ok, we found a problem with {{ic|systemd-modules-load}} service. We want to know more:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''failed''' (Result: exit-code) since So 2013-08-25 11:48:13 CEST; 32s ago<br />
Docs: man:systemd-modules-load.service(8).<br />
man:modules-load.d(5)<br />
Process: '''15630''' ExecStart=/usr/lib/systemd/systemd-modules-load ('''code=exited, status=1/FAILURE''')<br />
}}<br />
If the {{ic|Process ID}} is not listed, just restart the failed service with {{ic|systemctl restart systemd-modules-load}}<br />
<br />
'''3.''' Now we have the process id (PID) to investigate this error in depth. Enter the following command with the current {{ic|Process ID}} (here: 15630):<br />
{{hc|1=$ journalctl _PID=15630|2=<br />
-- Logs begin at Sa 2013-05-25 10:31:12 CEST, end at So 2013-08-25 11:51:17 CEST. --<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'blacklist usblp''''<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'install usblp /bin/false'''' <br />
}}<br />
<br />
'''4.''' We see that some of the kernel module configs have wrong settings. Therefore we have a look at these settings in {{ic|/etc/modules-load.d/}}:<br />
{{hc|$ ls -Al /etc/modules-load.d/|<br />
...<br />
-rw-r--r-- 1 root root 79 1. Dez 2012 blacklist.conf<br />
-rw-r--r-- 1 root root 1 2. Mär 14:30 encrypt.conf<br />
-rw-r--r-- 1 root root 3 5. Dez 2012 printing.conf<br />
-rw-r--r-- 1 root root 6 14. Jul 11:01 realtek.conf<br />
-rw-r--r-- 1 root root 65 2. Jun 23:01 virtualbox.conf<br />
...<br />
}}<br />
<br />
'''5.''' The {{ic|Failed to find module 'blacklist usblp'}} error message might be related to a wrong setting inside of {{ic|blacklist.conf}}. Lets deactivate it with inserting a trailing '''#''' before each option we found via step 3:<br />
{{hc|/etc/modules-load.d/blacklist.conf|<br />
'''#''' blacklist usblp<br />
'''#''' install usblp /bin/false<br />
}}<br />
<br />
'''6.''' Now, try to start {{ic|systemd-modules-load}}:<br />
$ systemctl start systemd-modules-load<br />
If it was successful, this should not prompt anything. If you see any error, go back to step 3 and use the new PID for solving the errors left.<br />
<br />
If everything is ok, you can verify that the service was started successfully with:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: '''loaded''' (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''active (exited)''' since So 2013-08-25 12:22:31 CEST; 34s ago<br />
Docs: man:systemd-modules-load.service(8)<br />
man:modules-load.d(5)<br />
Process: 19005 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)<br />
Aug 25 12:22:31 mypc systemd[1]: '''Started Load Kernel Modules'''.<br />
}}<br />
<br />
=== Diagnosing boot problems ===<br />
<br />
''systemd'' has several options for diagnosing problems with the boot process. See [[boot debugging]] for more general instructions and options to capture boot messages before ''systemd'' takes over the [[boot process]]. Also see the [http://freedesktop.org/wiki/Software/systemd/Debugging/ systemd debugging documentation].<br />
<br />
=== Diagnosing problems with a specific service ===<br />
<br />
{{Accuracy|This may not catch all errors such as missing libraries.|User talk:Alucryd#Plex}}<br />
<br />
If some ''systemd'' service misbehaves and you want to get more information about what is going on, set the {{ic|SYSTEMD_LOG_LEVEL}} [[environment variable]] to {{ic|debug}}. For example, to run the ''systemd-networkd'' daemon in debug mode:<br />
<br />
# systemctl stop systemd-networkd<br />
# SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd<br />
<br />
Or, equivalently, modify the service file temporarily for gathering enough output. For example: <br />
<br />
{{hc|/usr/lib/systemd/system/systemd-networkd.service|2=<br />
[Service]<br />
...<br />
Environment=SYSTEMD_LOG_LEVEL=debug<br />
....<br />
}}<br />
<br />
If debug information is required long-term, add the variable the [[#Editing provided units|regular]] way.<br />
<br />
=== Shutdown/reboot takes terribly long ===<br />
<br />
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. ''systemd'' waits some time for each service to exit before trying to kill it. To find out if you are affected, see [http://freedesktop.org/wiki/Software/systemd/Debugging/#shutdowncompleteseventually this article].<br />
<br />
=== Short lived processes do not seem to log any output ===<br />
<br />
If {{ic|journalctl -u foounit}} does not show any output for a short lived service, look at the PID instead. For example, if {{ic|systemd-modules-load.service}} fails, and {{ic|systemctl status systemd-modules-load}} shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i.e. {{ic|journalctl -b _PID&#61;123}}. Metadata fields for the journal such as {{ic|_SYSTEMD_UNIT}} and {{ic|_COMM}} are collected asynchronously and rely on the {{ic|/proc}} directory for the process existing. Fixing this requires fixing the kernel to provide this data via a socket connection, similar to {{ic|SCM_CREDENTIALS}}.<br />
<br />
=== Boot time increasing over time ===<br />
<br />
After using {{ic|systemd-analyze}} a number of users have noticed that their boot time has increased significantly in comparison with what it used to be. After using {{ic|systemd-analyze blame}} [[NetworkManager]] is being reported as taking an unusually large amount of time to start. <br />
<br />
The problem for some users has been due to {{ic|/var/log/journal}} becoming too large. This may have other impacts on performance, such as for {{ic|systemctl status}} or {{ic|journalctl}}. As such the solution is to remove every file within the folder (ideally making a backup of it somewhere, at least temporarily) and then setting a journal file size limit as described in [[#Journal size limit]].<br />
<br />
=== systemd-tmpfiles-setup.service fails to start at boot ===<br />
<br />
Starting with systemd 219, {{ic|/usr/lib/tmpfiles.d/systemd.conf}} specifies ACL attributes for directories under {{ic|/var/log/journal}} and, therefore, requires ACL support to be enabled for the filesystem the journal resides on.<br />
<br />
See [[Access Control Lists#Enabling ACL]] for instructions on how to enable ACL on the filesystem that houses {{ic|/var/log/journal}}.<br />
<br />
=== systemd version printed on boot is not the same as installed package version ===<br />
<br />
You need to [[Mkinitcpio#Image_creation_and_activation|regenerate your initramfs]] and the versions should match. <br />
<br />
{{Tip|1=A pacman hook can be used to automatically regenerate the initramfs every time {{pkg|systemd}} is upgraded. See [https://bbs.archlinux.org/viewtopic.php?id=215411 this forum thread] and [[Pacman#Hooks]].}}<br />
<br />
=== Disable emergency mode on remote machine ===<br />
<br />
You may want to disable emergency mode on a remote machine, for example, a virtual machine hosted at Azure or Google Cloud. It is because if emergency mode is triggered, the machine will be blocked from connecting to network.<br />
<br />
# systemctl mask emergency.service<br />
# systemctl mask emergency.target<br />
<br />
== See also ==<br />
<br />
*[[Wikipedia:systemd|Wikipedia article]]<br />
*[http://www.freedesktop.org/wiki/Software/systemd systemd Official web site]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/Optimizations systemd optimizations]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions systemd FAQ]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks systemd Tips and tricks]<br />
*[http://wiki.gentoo.org/wiki/Systemd Gentoo Wiki systemd page]<br />
*[http://fedoraproject.org/wiki/Systemd Fedora Project - About systemd]<br />
*[http://fedoraproject.org/wiki/How_to_debug_Systemd_problems Fedora Project - How to debug systemd problems]<br />
*[http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet Fedora Project - SysVinit to systemd cheatsheet]<br />
*[[gentoo:Systemd|Gentoo Wiki systemd page]]<br />
*[[debian:systemd|Debian Wiki systemd page]]<br />
*[http://0pointer.de/public/systemd-man/ Manual pages]<br />
*[http://0pointer.de/blog/projects/systemd.html Lennart's blog story], [http://0pointer.de/blog/projects/systemd-update.html update 1], [http://0pointer.de/blog/projects/systemd-update-2.html update 2], [http://0pointer.de/blog/projects/systemd-update-3.html update 3], [http://0pointer.de/blog/projects/why.html summary]<br />
*[http://0pointer.de/public/systemd-ebook-psankar.pdf systemd for Administrators (PDF)]<br />
*[https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units How To Use Systemctl to Manage Systemd Services and Units ]<br />
*[https://dvdhrm.wordpress.com/2013/08/24/session-management-on-linux/ Session management with systemd-logind]<br />
*[[Emacs#Syntax highlighting for systemd Files|Emacs Syntax highlighting for Systemd files]]<br />
*[http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html Two] [http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html part] introductory article in ''The H Open'' magazine.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Systemd&diff=502770Systemd2017-12-16T05:48:11Z<p>GenkiSky: /* Enable installed units by default */ Use man template for systemd.preset</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[Category:Init]]<br />
[[ar:Systemd]]<br />
[[de:Systemd]]<br />
[[el:Systemd]]<br />
[[es:Systemd]]<br />
[[fa:Systemd]]<br />
[[fr:Systemd]]<br />
[[it:Systemd]]<br />
[[ja:Systemd]]<br />
[[pt:Systemd]]<br />
[[ru:Systemd]]<br />
[[zh-hans:Systemd]]<br />
[[zh-hant:Systemd]]<br />
{{Related articles start}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd/Timers}}<br />
{{Related|systemd FAQ}}<br />
{{Related|init}}<br />
{{Related|Daemons#List of daemons}}<br />
{{Related|udev}}<br />
{{Related|Improve boot performance}}<br />
{{Related|Allow users to shutdown}}<br />
{{Related articles end}}<br />
<br />
From the [http://freedesktop.org/wiki/Software/systemd project web page]:<br />
<br />
:''systemd'' is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system. systemd provides aggressive parallelization capabilities, uses socket and [[D-Bus]] activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux [[control groups]], maintains mount and automount points, and implements an elaborate transactional dependency-based service control logic. ''systemd'' supports SysV and LSB init scripts and works as a replacement for sysvinit. Other parts include a logging daemon, utilities to control basic system configuration like the hostname, date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution.<br />
<br />
{{Note|1=For a detailed explanation as to why Arch has moved to ''systemd'', see [https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 this forum post].}}<br />
<br />
== Basic systemctl usage ==<br />
<br />
The main command used to introspect and control ''systemd'' is ''systemctl''. Some of its uses are examining the system state and managing the system and services. See {{man|1|systemctl}} for more details.<br />
<br />
{{Tip|<br />
* You can use all of the following ''systemctl'' commands with the {{ic|-H ''user''@''host''}} switch to control a ''systemd'' instance on a remote machine. This will use [[SSH]] to connect to the remote ''systemd'' instance.<br />
* ''systemadm'' is the official graphical frontend for ''systemctl'' and is provided by the {{Pkg|systemd-ui}} package.<br />
* [[Plasma]] users can install {{Pkg|systemd-kcm}} as a graphical frontend for ''systemctl''. After installing the module will be added under ''System administration''.}}<br />
<br />
=== Analyzing the system state ===<br />
<br />
Show '''system status''' using:<br />
<br />
$ systemctl status<br />
<br />
'''List running''' units:<br />
<br />
$ systemctl<br />
<br />
or:<br />
<br />
$ systemctl list-units<br />
<br />
'''List failed''' units:<br />
<br />
$ systemctl --failed<br />
<br />
The available unit files can be seen in {{ic|/usr/lib/systemd/system/}} and {{ic|/etc/systemd/system/}} (the latter takes precedence). '''List installed''' unit files with:<br />
<br />
$ systemctl list-unit-files<br />
<br />
=== Using units ===<br />
<br />
Units can be, for example, services (''.service''), mount points (''.mount''), devices (''.device'') or sockets (''.socket'').<br />
<br />
When using ''systemctl'', you generally have to specify the complete name of the unit file, including its suffix, for example {{ic|sshd.socket}}. There are however a few short forms when specifying the unit in the following ''systemctl'' commands:<br />
<br />
* If you do not specify the suffix, systemctl will assume ''.service''. For example, {{ic|netctl}} and {{ic|netctl.service}} are equivalent.<br />
* Mount points will automatically be translated into the appropriate ''.mount'' unit. For example, specifying {{ic|/home}} is equivalent to {{ic|home.mount}}.<br />
* Similar to mount points, devices are automatically translated into the appropriate ''.device'' unit, therefore specifying {{ic|/dev/sda2}} is equivalent to {{ic|dev-sda2.device}}.<br />
<br />
See {{man|5|systemd.unit}} for details.<br />
<br />
{{Note|Some unit names contain an {{ic|@}} sign (e.g. {{ic|name@''string''.service}}): this means that they are [http://0pointer.de/blog/projects/instances.html instances] of a ''template'' unit, whose actual file name does not contain the {{ic|''string''}} part (e.g. {{ic|name@.service}}). {{ic|''string''}} is called the ''instance identifier'', and is similar to an argument that is passed to the template unit when called with the ''systemctl'' command: in the unit file it will substitute the {{ic|%i}} specifier. <br />
<br />
To be more accurate, ''before'' trying to instantiate the {{ic|name@.suffix}} template unit, ''systemd'' will actually look for a unit with the exact {{ic|name@string.suffix}} file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an {{ic|@}} sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will just fail, since the {{ic|%i}} specifier cannot be substituted.<br />
}}<br />
<br />
{{Tip|<br />
* Most of the following commands also work if multiple units are specified, see {{man|1|systemctl}} for more information.<br />
* The {{ic|--now}} switch can be used in conjunction with {{ic|enable}}, {{ic|disable}}, and {{ic|mask}} to respectively start, stop, or mask immediately the unit rather than after the next boot.<br />
* A package may offer units for different purposes. If you just installed a package, {{ic|pacman -Qql ''package'' <nowiki>|</nowiki> grep -Fe .service -e .socket}} can be used to check and find them.}}<br />
<br />
'''Start''' a unit immediately:<br />
<br />
# systemctl start ''unit''<br />
<br />
'''Stop''' a unit immediately:<br />
<br />
# systemctl stop ''unit''<br />
<br />
'''Restart''' a unit:<br />
<br />
# systemctl restart ''unit''<br />
<br />
Ask a unit to '''reload''' its configuration:<br />
<br />
# systemctl reload ''unit''<br />
<br />
Show the '''status''' of a unit, including whether it is running or not:<br />
<br />
$ systemctl status ''unit''<br />
<br />
'''Check''' whether a unit is already enabled or not:<br />
<br />
$ systemctl is-enabled ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''':<br />
<br />
# systemctl enable ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''' and '''Start''' immediately:<br />
<br />
# systemctl enable --now ''unit''<br />
<br />
'''Disable''' a unit to not start during bootup:<br />
<br />
# systemctl disable ''unit''<br />
<br />
'''Mask''' a unit to make it impossible to start it:<br />
<br />
# systemctl mask ''unit''<br />
<br />
'''Unmask''' a unit:<br />
<br />
# systemctl unmask ''unit''<br />
<br />
Show the '''manual page''' associated with a unit (this has to be supported by the unit file):<br />
<br />
$ systemctl help ''unit''<br />
<br />
Reload ''systemd'', scanning for '''new or changed units''':<br />
<br />
# systemctl daemon-reload<br />
<br />
=== Power management ===<br />
<br />
[[polkit]] is necessary for power management as an unprivileged user. If you are in a local ''systemd-logind'' user session and no other session is active, the following commands will work without root privileges. If not (for example, because another user is logged into a tty), ''systemd'' will automatically ask you for the root password.<br />
<br />
Shut down and reboot the system:<br />
<br />
$ systemctl reboot<br />
<br />
Shut down and power-off the system:<br />
<br />
$ systemctl poweroff<br />
<br />
Suspend the system:<br />
<br />
$ systemctl suspend<br />
<br />
Put the system into hibernation:<br />
<br />
$ systemctl hibernate<br />
<br />
Put the system into hybrid-sleep state (or suspend-to-both):<br />
<br />
$ systemctl hybrid-sleep<br />
<br />
== Writing unit files ==<br />
<br />
The syntax of ''systemd'''s [http://www.freedesktop.org/software/systemd/man/systemd.unit.html unit files] is inspired by XDG Desktop Entry Specification ''.desktop'' files, which are in turn inspired by Microsoft Windows ''.ini'' files. Unit files are loaded from two locations. From lowest to highest precedence they are:<br />
<br />
* {{ic|/usr/lib/systemd/system/}}: units provided by installed packages<br />
* {{ic|/etc/systemd/system/}}: units installed by the system administrator<br />
<br />
{{Note|<br />
* The load paths are completely different when running ''systemd'' in [[systemd/User#How it works|user mode]].<br />
* systemd unit names may only contain ASCII alphanumeric characters, underscores and periods. All other characters must be replaced by C-style "\x2d" escapes, or employ their pre defined semantics ('@', '-'). See {{man|5|systemd.unit}} and {{man|1|systemd-escape}} for more information.}}<br />
<br />
Look at the units installed by your packages for examples, as well as the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples annotated example section] of {{man|5|systemd.service}}.<br />
<br />
{{Tip|Comments prepended with {{ic|#}} may be used in unit-files as well, but only in new lines. Do not use end-line comments after ''systemd'' parameters or the unit will fail to activate.}}<br />
<br />
=== Handling dependencies ===<br />
<br />
With ''systemd'', dependencies can be resolved by designing the unit files correctly. The most typical case is that the unit ''A'' requires the unit ''B'' to be running before ''A'' is started. In that case add {{ic|1=Requires=''B''}} and {{ic|1=After=''B''}} to the {{ic|[Unit]}} section of ''A''. If the dependency is optional, add {{ic|1=Wants=''B''}} and {{ic|1=After=''B''}} instead. Note that {{ic|1=Wants=}} and {{ic|1=Requires=}} do not imply {{ic|1=After=}}, meaning that if {{ic|1=After=}} is not specified, the two units will be started in parallel.<br />
<br />
Dependencies are typically placed on services and not on [[#Targets]]. For example, {{ic|network.target}} is pulled in by whatever service configures your network interfaces, therefore ordering your custom unit after it is sufficient since {{ic|network.target}} is started anyway.<br />
<br />
=== Service types ===<br />
<br />
There are several different start-up types to consider when writing a custom service file. This is set with the {{ic|1=Type=}} parameter in the {{ic|[Service]}} section:<br />
<br />
* {{ic|1=Type=simple}} (default): ''systemd'' considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.<br />
* {{ic|1=Type=forking}}: ''systemd'' considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify {{ic|1=PIDFile=}} as well so ''systemd'' can keep track of the main process.<br />
* {{ic|1=Type=oneshot}}: this is useful for scripts that do a single job and then exit. You may want to set {{ic|1=RemainAfterExit=yes}} as well so that ''systemd'' still considers the service as active after the process has exited.<br />
* {{ic|1=Type=notify}}: identical to {{ic|1=Type=simple}}, but with the stipulation that the daemon will send a signal to ''systemd'' when it is ready. The reference implementation for this notification is provided by ''libsystemd-daemon.so''.<br />
* {{ic|1=Type=dbus}}: the service is considered ready when the specified {{ic|BusName}} appears on DBus's system bus.<br />
* {{ic|1=Type=idle}}: ''systemd'' will delay execution of the service binary until all jobs are dispatched. Other than that behavior is very similar to {{ic|1=Type=simple}}. <br />
<br />
See the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= systemd.service(5)] man page for a more detailed explanation of the {{ic|Type}} values.<br />
<br />
=== Editing provided units ===<br />
<br />
To avoid conflicts with pacman, unit files provided by packages should not be directly edited. There are two safe ways to modify a unit without touching the original file: create a new unit file which [[#Replacement unit files|overrides the original unit]] or create [[#Drop-in files|drop-in snippets]] which are applied on top of the original unit. For both methods, you must reload the unit afterwards to apply your changes. This can be done either by editing the unit with {{ic|systemctl edit}} (which reloads the unit automatically) or by reloading all units with:<br />
<br />
# systemctl daemon-reload<br />
<br />
{{Tip|<br />
* You can use ''systemd-delta'' to see which unit files have been overridden or extended and what exactly has been changed.<br />
* Use {{ic|systemctl cat ''unit''}} to view the content of a unit file and all associated drop-in snippets.<br />
* The default syntax highlighting for ''systemd'' unit files within [[Vim]] is the same as for [[Wikipedia:Ini_file|INI files]]. However, if you want something more systemd-specific, install {{Pkg|vim-systemd}}.<br />
}}<br />
<br />
==== Replacement unit files ====<br />
<br />
To replace the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the file {{ic|/etc/systemd/system/''unit''}} and reenable the unit to update the symlinks:<br />
<br />
# systemctl reenable ''unit''<br />
<br />
Alternatively, run:<br />
<br />
# systemctl edit --full ''unit''<br />
<br />
This opens {{ic|/etc/systemd/system/''unit''}} in your editor (copying the installed version if it does not exist yet) and automatically reloads it when you finish editing.<br />
<br />
{{Note|Pacman does not update the replacement unit files when the originals are updated, so this method can make system maintenance more difficult. For this reason the next approach is recommended.}}<br />
<br />
==== Drop-in files ====<br />
<br />
To create drop-in files for the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the directory {{ic|/etc/systemd/system/''unit''.d/}} and place ''.conf'' files there to override or add new options. ''systemd'' will parse these ''.conf'' files and apply them on top of the original unit.<br />
<br />
The easiest way to do this is to run:<br />
<br />
# systemctl edit ''unit''<br />
<br />
This opens the file {{ic|/etc/systemd/system/''unit''.d/override.conf}} in your text editor (creating it if necessary) and automatically reloads the unit when you are done editing.<br />
<br />
==== Revert to vendor version ====<br />
<br />
To revert any changes to a unit made using {{ic|systemctl edit}} do:<br />
<br />
# systemctl revert ''unit''<br />
<br />
==== Examples ====<br />
<br />
For example, if you simply want to add an additional dependency to a unit, you may create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customdependency.conf|2=<br />
[Unit]<br />
Requires=''new dependency''<br />
After=''new dependency''<br />
}}<br />
<br />
As another example, in order to replace the {{ic|ExecStart}} directive for a unit that is not of type {{ic|oneshot}}, create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customexec.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=''new command''<br />
}}<br />
<br />
Note how {{ic|ExecStart}} must be cleared before being re-assigned [https://bugzilla.redhat.com/show_bug.cgi?id=756787#c9]. The same holds for every item that can be specified multiple times, e.g. {{ic|OnCalendar}} for timers.<br />
<br />
One more example to automatically restart a service:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/restart.conf|2=<br />
[Service]<br />
Restart=always<br />
RestartSec=30<br />
}}<br />
<br />
== Targets ==<br />
<br />
{{Style|Unclear description, copy-pasted content (explicitly mentions "Fedora").|section=Make section "Targets" more clearly}}<br />
<br />
''systemd'' uses ''targets'' which serve a similar purpose as [[wikipedia:Runlevel|runlevels]] but act a little different. Each ''target'' is named instead of numbered and is intended to serve a specific purpose with the possibility of having multiple ones active at the same time. Some ''target''s are implemented by inheriting all of the services of another ''target'' and adding additional services to it. There are ''systemd'' ''target''s that mimic the common SystemVinit runlevels so you can still switch ''target''s using the familiar {{ic|telinit RUNLEVEL}} command.<br />
<br />
=== Get current targets ===<br />
<br />
The following should be used under ''systemd'' instead of running {{ic|runlevel}}:<br />
<br />
$ systemctl list-units --type=target<br />
<br />
=== Create custom target ===<br />
<br />
The runlevels that held a defined meaning under sysvinit (i.e., 0, 1, 3, 5, and 6); have a 1:1 mapping with a specific ''systemd'' ''target''. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named ''systemd'' ''target'' as {{ic|/etc/systemd/system/''your target''}} that takes one of the existing runlevels as a base (you can look at {{ic|/usr/lib/systemd/system/graphical.target}} as an example), make a directory {{ic|/etc/systemd/system/''your target''.wants}}, and then symlink the additional services from {{ic|/usr/lib/systemd/system/}} that you wish to enable.<br />
<br />
=== Mapping between SysV runlevels and systemd targets ===<br />
<br />
{| class="wikitable"<br />
! SysV Runlevel !! systemd Target !! Notes<br />
|-<br />
| 0 || runlevel0.target, poweroff.target || Halt the system.<br />
|-<br />
| 1, s, single || runlevel1.target, rescue.target || Single user mode.<br />
|-<br />
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.<br />
|-<br />
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.<br />
|-<br />
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.<br />
|-<br />
| 6 || runlevel6.target, reboot.target || Reboot<br />
|-<br />
| emergency || emergency.target || Emergency shell<br />
|-<br />
|}<br />
<br />
=== Change current target ===<br />
<br />
In ''systemd'' targets are exposed via ''target units''. You can change them like this:<br />
<br />
# systemctl isolate graphical.target<br />
<br />
This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as {{ic|telinit 3}} or {{ic|telinit 5}} in Sysvinit.<br />
<br />
=== Change default target to boot into ===<br />
<br />
The standard target is {{ic|default.target}}, which is aliased by default to {{ic|graphical.target}} (which roughly corresponds to the old runlevel 5). To change the default target at boot-time, append one of the following [[kernel parameters]] to your bootloader:<br />
<br />
* {{ic|1=systemd.unit=multi-user.target}} (which roughly corresponds to the old runlevel 3),<br />
* {{ic|1=systemd.unit=rescue.target}} (which roughly corresponds to the old runlevel 1).<br />
<br />
Alternatively, you may leave the bootloader alone and change {{ic|default.target}}. This can be done using ''systemctl'':<br />
<br />
# systemctl set-default multi-user.target<br />
<br />
To be able to override the previously set {{ic|default.target}}, use the force option:<br />
<br />
# systemctl set-default -f multi-user.target<br />
<br />
The effect of this command is output by ''systemctl''; a symlink to the new default target is made at {{ic|/etc/systemd/system/default.target}}.<br />
<br />
== Temporary files ==<br />
<br />
"''systemd-tmpfiles'' creates, deletes and cleans up volatile and temporary files and directories." It reads configuration files in {{ic|/etc/tmpfiles.d/}} and {{ic|/usr/lib/tmpfiles.d/}} to discover which actions to perform. Configuration files in the former directory take precedence over those in the latter directory.<br />
<br />
Configuration files are usually provided together with service files, and they are named in the style of {{ic|/usr/lib/tmpfiles.d/''program''.conf}}. For example, the [[Samba]] daemon expects the directory {{ic|/run/samba}} to exist and to have the correct permissions. Therefore, the {{Pkg|samba}} package ships with this configuration:<br />
<br />
{{hc|/usr/lib/tmpfiles.d/samba.conf|<br />
D /run/samba 0755 root root}}<br />
<br />
Configuration files may also be used to write values into certain files on boot. For example, if you used {{ic|/etc/rc.local}} to disable wakeup from USB devices with {{ic|echo USBE > /proc/acpi/wakeup}}, you may use the following tmpfile instead:<br />
<br />
{{hc|/etc/tmpfiles.d/disable-usb-wake.conf|<br />
w /proc/acpi/wakeup - - - - USBE}}<br />
<br />
See the {{man|8|systemd-tmpfiles}} and {{man|5|tmpfiles.d}} man pages for details.<br />
<br />
{{Note|This method may not work to set options in {{ic|/sys}} since the ''systemd-tmpfiles-setup'' service may run before the appropriate device modules is loaded. In this case you could check whether the module has a parameter for the option you want to set with {{ic|modinfo ''module''}} and set this option with a [[Kernel modules#Setting module options|config file in /etc/modprobe.d]]. Otherwise you will have to write a [[Udev#About_udev_rules|udev rule]] to set the appropriate attribute as soon as the device appears.}}<br />
<br />
== Timers ==<br />
<br />
A timer is a unit configuration file whose name ends with ''.timer'' and encodes information about a timer controlled and supervised by ''systemd'', for timer-based activation. See [[systemd/Timers]].<br />
<br />
{{Note|Timers can replace [[cron]] functionality to a great extent. See [[systemd/Timers#As a cron replacement]].}}<br />
<br />
== Mounting ==<br />
<br />
Since systemd is a replacement for System V init, it is in charge of the mounts specified in {{ic|/etc/fstab}}. In fact, it goes beyond the usual {{ic|fstab}} capabilities, implementing special mount options prefixed with {{ic|x-systemd.}}. See [[Fstab#Automount with systemd]] for an example of ''automounting'' (mounting on-demand) using these extensions. See [https://www.freedesktop.org/software/systemd/man/systemd.mount.html#fstab] for the complete documentation of these extensions.<br />
<br />
== Journal ==<br />
<br />
''systemd'' has its own logging system called the journal; therefore, running a {{ic|syslog}} daemon is no longer required. To read the log, use:<br />
<br />
# journalctl<br />
<br />
In Arch Linux, the directory {{ic|/var/log/journal/}} is a part of the {{Pkg|systemd}} package, and the journal (when {{ic|1=Storage=}} is set to {{ic|auto}} in {{ic|/etc/systemd/journald.conf}}) will write to {{ic|/var/log/journal/}}. If you or some program delete that directory, ''systemd'' will '''not''' recreate it automatically and instead will write its logs to {{ic|/run/systemd/journal}} in a nonpersistent way. However, the folder will be recreated when you set {{ic|1=Storage=persistent}} and run {{ic|systemctl restart systemd-journald}} (or reboot).<br />
<br />
Systemd journal classifies messages by [[#Priority level|Priority level]] and [[#Facility|Facility]]. Logging classification corresponds to classic [[wikipedia:Syslog|Syslog]] protocol ([https://tools.ietf.org/html/rfc5424 RFC 5424]).<br />
<br />
===Priority level===<br />
<br />
A syslog severity code (in systemd called priority) is used to mark the importance of a message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
|-<br />
! Value !! Severity !! Keyword !! Description || Examples<br />
|-<br />
| 0 || Emergency || emerg || System is unusable || Severe Kernel BUG, systemd dumped core.<br>This level should not be used by applications.<br />
|-<br />
| 1 || Alert || alert || Should be corrected immediately || Vital subsystem goes out of work. Data loss. <br>{{ic|kernel: BUG: unable to handle kernel paging request at ffffc90403238ffc|}}.<br />
|-<br />
| 2 || Critical || crit || Critical conditions || Crashes, coredumps. Like familiar flash:<br>{{ic|systemd-coredump[25319]: Process 25310 (plugin-containe) of user 1000 dumped core}}<br>Failure in the system primary application, like X11. <br />
|-<br />
| 3 || Error || err || Error conditions || Not severe error reported:<br>{{ic|kernel: usb 1-3: 3:1: cannot get freq at ep 0x84}},<br>{{ic|systemd[1]: Failed unmounting /var.}},<br>{{ic|libvirtd[1720]: internal error: Failed to initialize a valid firewall backend}}).<br />
|-<br />
| 4 || Warning || warning || May indicate that an error will occur if action is not taken. || A non-root file system has only 1GB free.<br>{{ic|org.freedesktop. Notifications[1860]: (process:5999): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale}}.<br />
|-<br />
| 5 || Notice || notice || Events that are unusual, but not error conditions. || {{ic|systemd[1]: var.mount: Directory /var to mount over is not empty, mounting anyway}}. {{ic|gcr-prompter[4997]: Gtk: GtkDialog mapped without a transient parent. This is discouraged}}.<br />
|-<br />
| 6 || Informational || info || Normal operational messages that require no action. || {{ic|lvm[585]: 7 logical volume(s) in volume group "archvg" now active}}.<br />
|-<br />
| 7 || Debug || debug || Information useful to developers for debugging the application. || {{ic|kdeinit5[1900]: powerdevil: Scheduling inhibition from ":1.14" "firefox" with cookie 13 and reason "screen"}}.<br />
|}<br />
<br />
If you cannot find a message on the expected priority level, also search a couple of levels above and below: these rules are recommendations, and the developer of the affected application may have a different perception of the issue's importance from yours.<br />
<br />
===Facility===<br />
<br />
A syslog facility code is used to specify the type of program that is logging the message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
! Facility code !! Keyword !! Description !! Info<br />
|-<br />
| 0 || kern || kernel messages<br />
|-<br />
| 1 || user || user-level messages<br />
|-<br />
| 2 || mail || mail system || Archaic POSIX still supported and sometimes used system, for more {{man|1|mail}})<br />
|-<br />
| 3 || daemon || system daemons || All daemons, including systemd and its subsystems<br />
|-<br />
| 4 || auth || security/authorization messages || Also watch for different facility 10<br />
|-<br />
| 5 || syslog || messages generated internally by syslogd || As it standartized for syslogd, not used by systemd (see facility 3)<br />
|-<br />
| 6 || lpr || line printer subsystem (archaic subsystem)<br />
|-<br />
| 7 || news || network news subsystem (archaic subsystem)<br />
|-<br />
| 8 || uucp || UUCP subsystem (archaic subsystem)<br />
|-<br />
| 9 || || clock daemon || systemd-timesyncd<br />
|-<br />
| 10 || authpriv || security/authorization messages || Also watch for different facility 4<br />
|-<br />
| 11 || ftp || FTP daemon<br />
|-<br />
| 12 || - || NTP subsystem<br />
|-<br />
| 13 || - || log audit<br />
|-<br />
| 14 || - || log alert<br />
|-<br />
| 15 || cron || scheduling daemon<br />
|-<br />
| 16 || local0 || local use 0 (local0)<br />
|-<br />
| 17 || local1 || local use 1 (local1)<br />
|-<br />
| 18 || local2 || local use 2 (local2)<br />
|-<br />
| 19 || local3 || local use 3 (local3)<br />
|-<br />
| 20 || local4 || local use 4 (local4)<br />
|-<br />
| 21 || local5 || local use 5 (local5)<br />
|-<br />
| 22 || local6 || local use 6 (local6)<br />
|-<br />
| 23 || local7 || local use 7 (local7)<br />
|}<br />
<br />
So, useful facilities to watch: 0,1,3,4,9,10,15.<br />
<br />
=== Filtering output ===<br />
<br />
''journalctl'' allows you to filter the output by specific fields. Be aware that if there are many messages to display or filtering of large time span has to be done, the output of this command can be delayed for quite some time.<br />
<br />
{{Tip|While the journal is stored in a binary format, the content of stored messages is not modified. This means it is viewable with ''strings'', for example for recovery in an environment which does not have ''systemd'' installed. Example command:<br />
{{bc|$ strings /mnt/arch/var/log/journal/af4967d77fba44c6b093d0e9862f6ddd/system.journal <nowiki>| grep -i</nowiki> ''message''}}<br />
}}<br />
<br />
Examples:<br />
<br />
* Show all messages from this boot: {{bc|# journalctl -b}} However, often one is interested in messages not from the current, but from the previous boot (e.g. if an unrecoverable system crash happened). This is possible through optional offset parameter of the {{ic|-b}} flag: {{ic|journalctl -b -0}} shows messages from the current boot, {{ic|journalctl -b -1}} from the previous boot, {{ic|journalctl -b -2}} from the second previous and so on. See {{man|1|journalctl}} for full description, the semantics is much more powerful.<br />
* Show all messages from date (and optional time): {{bc|1=# journalctl --since="2012-10-30 18:17:16"}}<br />
* Show all messages since 20 minutes ago: {{bc|1=# journalctl --since "20 min ago"}}<br />
* Follow new messages: {{bc|# journalctl -f}}<br />
* Show all messages by a specific executable: {{bc|# journalctl /usr/lib/systemd/systemd}}<br />
* Show all messages by a specific process: {{bc|1=# journalctl _PID=1}}<br />
* Show all messages by a specific unit: {{bc|# journalctl -u netcfg}}<br />
* Show kernel ring buffer: {{bc|1=# journalctl -k}}<br />
* Show only error, critical, and alert priority messages {{bc|# journalctl -p err..alert}} Numbers also can be used, {{ic|journalctl -p 3..1}}. If single number/keyword used, {{ic|journalctl -p 3}} - all higher priority levels also included.<br />
* Show auth.log equivalent by filtering on syslog facility: {{bc|1=# journalctl SYSLOG_FACILITY=10}}<br />
<br />
See {{man|1|journalctl}}, {{man|7|systemd.journal-fields}}, or Lennart's [http://0pointer.de/blog/projects/journalctl.html blog post] for details.<br />
<br />
{{Tip|1=<br />
By default, ''journalctl'' truncates lines longer than screen width, but in some cases, it may be better to enable wrapping instead of truncating. This can be controlled by the {{ic|SYSTEMD_LESS}} [[environment variable]], which contains options passed to [[Core utilities#less|less]] (the default pager) and defaults to {{ic|FRSXMK}} (see {{man|1|less}} and {{man|1|journalctl}} for details).<br />
<br />
By omitting the {{ic|S}} option, the output will be wrapped instead of truncated. For example, start ''journalctl'' as follows:<br />
<br />
$ SYSTEMD_LESS=FRXMK journalctl<br />
<br />
If you would like to set this behaviour as default, [[Environment variables#Per_user|export]] the variable from {{ic|~/.bashrc}} or {{ic|~/.zshrc}}.<br />
}}<br />
<br />
=== Journal size limit ===<br />
<br />
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the underlying file system but capped to 4 GiB. For example, with {{ic|/var/log/journal/}} located on a 20 GiB partition, journal data may take up to 2 GiB. On a 50 GiB partition, it would max at 4 GiB.<br />
<br />
The maximum size of the persistent journal can be controlled by uncommenting and changing the following:<br />
<br />
{{hc|/etc/systemd/journald.conf|2=<br />
SystemMaxUse=50M<br />
}}<br />
<br />
It is also possible to use the drop-in snippets configuration override mechanism rather than editing the global configuration file. In this case do not forget to place the overrides under the {{ic|[Journal]}} header:<br />
<br />
{{hc|/etc/systemd/journald.conf.d/00-journal-size.conf|2=<br />
[Journal]<br />
SystemMaxUse=50M<br />
}}<br />
<br />
Restart the {{ic|systemd-journald}} service after changing this setting to immediately apply the new limit.<br />
<br />
See {{man|5|journald.conf}} for more info.<br />
<br />
=== Clean journal files manually ===<br />
<br />
Journal files can be globally removed from {{ic|/var/log/journal/}} using ''e.g.'' {{ic|rm}}, or can be trimmed according to various criteria using {{ic|journalctl}}. Examples:<br />
<br />
* Remove archived journal files until the disk space they use falls below 100M: {{bc|1=# journalctl --vacuum-size=100M}}<br />
* Make all journal files contain no data older than 2 weeks. {{bc|1=# journalctl --vacuum-time=2weeks}}<br />
<br />
See {{man|1|journalctl}} for more info.<br />
<br />
=== Journald in conjunction with syslog ===<br />
<br />
Compatibility with a classic, non-journald aware [[Syslog-ng|syslog]] implementation can be provided by letting ''systemd'' forward all messages via the socket {{ic|/run/systemd/journal/syslog}}. To make the syslog daemon work with the journal, it has to bind to this socket instead of {{ic|/dev/log}} ([http://lwn.net/Articles/474968/ official announcement]). <br />
<br />
The default {{ic|journald.conf}} for forwarding to the socket is {{ic|1=ForwardToSyslog=no}} to avoid system overhead, because [[rsyslog]] or [[syslog-ng]] pull the messages from the journal by [http://lists.freedesktop.org/archives/systemd-devel/2014-August/022295.html#journald itself]. <br />
<br />
See [[Syslog-ng#Overview]] and [[Syslog-ng#syslog-ng and systemd journal]], or [[rsyslog]] respectively, for details on configuration.<br />
<br />
=== Forward journald to /dev/tty12 ===<br />
<br />
Create a [[#Editing provided units|drop-in directory]] {{ic|/etc/systemd/journald.conf.d}} and create a {{ic|fw-tty12.conf}} file in it:<br />
<br />
{{hc|1=/etc/systemd/journald.conf.d/fw-tty12.conf|2=<br />
[Journal]<br />
ForwardToConsole=yes<br />
TTYPath=/dev/tty12<br />
MaxLevelConsole=info<br />
}}<br />
<br />
Then [[restart]] systemd-journald.<br />
<br />
=== Specify a different journal to view ===<br />
There may be a need to check the logs of another system that is dead in the water, like booting from a live system to recover a production system. In such case, one can mount the disk in e.g. {{ic|/mnt}}, and specify the journal path via {{ic|-D}}/{{ic|--directory}}, like so:<br />
<br />
$ journalctl -D ''/mnt''/var/log/journal -xe<br />
<br />
== Tips and tricks ==<br />
<br />
=== Enable installed units by default ===<br />
<br />
{{Expansion|How does it work with instantiated units?}}<br />
<br />
Arch Linux ships with {{ic|/usr/lib/systemd/system-preset/99-default.preset}} containing {{ic|disable *}}. This causes ''systemctl preset'' to disable all units by default, such that when a new package is installed, the user must manually enable the unit.<br />
<br />
If this behavior is not desired, simply create a symlink from {{ic|/etc/systemd/system-preset/99-default.preset}} to {{ic|/dev/null}} in order to override the configuration file. This will cause ''systemctl preset'' to enable all units that get installed—regardless of unit type—unless specified in another file in one ''systemctl preset'''s configuration directories. User units are not affected. See {{man|5|systemd.preset}} for more information.<br />
<br />
{{Note|Enabling all units by default may cause problems with packages that contain two or more mutually exclusive units. ''systemctl preset'' is designed to be used by distributions and spins or system administrators. In the case where two conflicting units would be enabled, you should explicitly specify which one is to be disabled in a preset configuration file as specified in the manpage for {{ic|systemd.preset}}.}}<br />
<br />
=== Sandboxing application environments ===<br />
A unit file can be created as a sandbox to isolate applications and their processes within a hardened virtual environment. systemd leverages [[wikipedia:Linux_namespaces|namespaces]], white-/blacklisting of [[Capabilities]], and [[control groups]] to container processes through an extensive [https://www.freedesktop.org/software/systemd/man/systemd.exec.html execution environment configuration].<br />
<br />
The enhancement of an existing systemd unit file with application sandboxing typically requires trial-and-error tests accompanied by the generous use of {{Pkg|strace}}, [[wikipedia:Standard_streams#Standard_error_.28stderr.29|stderr]] and [https://www.freedesktop.org/software/systemd/man/journalctl.html journalctl] error logging and output facilities. You may want to first search upstream documentation for already done tests to base trials on.<br />
<br />
Some examples on how sandboxing with systemd can be deployed:<br />
* {{Ic|CapabilityBoundingSet}} defines a whitelisted set of allowed capabilities, but may also be used to blacklist a specific capability for a unit.<br />
** The {{Ic|CAP_SYS_ADM}} capability, for example, which should be one of the [https://lwn.net/Articles/486306/ goals of a secure sandbox]: {{ic|1=CapabilityBoundingSet=~ CAP_SYS_ADM}}<br />
* [[Unbound#Sandboxing]]{{Broken section link}} shows a full-scale example of systemd features for sandboxing.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Investigating systemd errors ===<br />
<br />
As an example, we will investigate an error with {{ic|systemd-modules-load}} service:<br />
<br />
'''1.''' Lets find the ''systemd'' services which fail to start at boot time:<br />
<br />
{{hc|1=$ systemctl --state=failed|2=<br />
systemd-modules-load.service loaded '''failed failed''' Load Kernel Modules}}<br />
<br />
Another way is to live log ''systemd'' messages:<br />
<br />
$ journalctl -fp err<br />
<br />
'''2.''' Ok, we found a problem with {{ic|systemd-modules-load}} service. We want to know more:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''failed''' (Result: exit-code) since So 2013-08-25 11:48:13 CEST; 32s ago<br />
Docs: man:systemd-modules-load.service(8).<br />
man:modules-load.d(5)<br />
Process: '''15630''' ExecStart=/usr/lib/systemd/systemd-modules-load ('''code=exited, status=1/FAILURE''')<br />
}}<br />
If the {{ic|Process ID}} is not listed, just restart the failed service with {{ic|systemctl restart systemd-modules-load}}<br />
<br />
'''3.''' Now we have the process id (PID) to investigate this error in depth. Enter the following command with the current {{ic|Process ID}} (here: 15630):<br />
{{hc|1=$ journalctl _PID=15630|2=<br />
-- Logs begin at Sa 2013-05-25 10:31:12 CEST, end at So 2013-08-25 11:51:17 CEST. --<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'blacklist usblp''''<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'install usblp /bin/false'''' <br />
}}<br />
<br />
'''4.''' We see that some of the kernel module configs have wrong settings. Therefore we have a look at these settings in {{ic|/etc/modules-load.d/}}:<br />
{{hc|$ ls -Al /etc/modules-load.d/|<br />
...<br />
-rw-r--r-- 1 root root 79 1. Dez 2012 blacklist.conf<br />
-rw-r--r-- 1 root root 1 2. Mär 14:30 encrypt.conf<br />
-rw-r--r-- 1 root root 3 5. Dez 2012 printing.conf<br />
-rw-r--r-- 1 root root 6 14. Jul 11:01 realtek.conf<br />
-rw-r--r-- 1 root root 65 2. Jun 23:01 virtualbox.conf<br />
...<br />
}}<br />
<br />
'''5.''' The {{ic|Failed to find module 'blacklist usblp'}} error message might be related to a wrong setting inside of {{ic|blacklist.conf}}. Lets deactivate it with inserting a trailing '''#''' before each option we found via step 3:<br />
{{hc|/etc/modules-load.d/blacklist.conf|<br />
'''#''' blacklist usblp<br />
'''#''' install usblp /bin/false<br />
}}<br />
<br />
'''6.''' Now, try to start {{ic|systemd-modules-load}}:<br />
$ systemctl start systemd-modules-load<br />
If it was successful, this should not prompt anything. If you see any error, go back to step 3 and use the new PID for solving the errors left.<br />
<br />
If everything is ok, you can verify that the service was started successfully with:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: '''loaded''' (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''active (exited)''' since So 2013-08-25 12:22:31 CEST; 34s ago<br />
Docs: man:systemd-modules-load.service(8)<br />
man:modules-load.d(5)<br />
Process: 19005 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)<br />
Aug 25 12:22:31 mypc systemd[1]: '''Started Load Kernel Modules'''.<br />
}}<br />
<br />
=== Diagnosing boot problems ===<br />
<br />
''systemd'' has several options for diagnosing problems with the boot process. See [[boot debugging]] for more general instructions and options to capture boot messages before ''systemd'' takes over the [[boot process]]. Also see the [http://freedesktop.org/wiki/Software/systemd/Debugging/ systemd debugging documentation].<br />
<br />
=== Diagnosing problems with a specific service ===<br />
<br />
{{Accuracy|This may not catch all errors such as missing libraries.|User talk:Alucryd#Plex}}<br />
<br />
If some ''systemd'' service misbehaves and you want to get more information about what is going on, set the {{ic|SYSTEMD_LOG_LEVEL}} [[environment variable]] to {{ic|debug}}. For example, to run the ''systemd-networkd'' daemon in debug mode:<br />
<br />
# systemctl stop systemd-networkd<br />
# SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd<br />
<br />
Or, equivalently, modify the service file temporarily for gathering enough output. For example: <br />
<br />
{{hc|/usr/lib/systemd/system/systemd-networkd.service|2=<br />
[Service]<br />
...<br />
Environment=SYSTEMD_LOG_LEVEL=debug<br />
....<br />
}}<br />
<br />
If debug information is required long-term, add the variable the [[#Editing provided units|regular]] way.<br />
<br />
=== Shutdown/reboot takes terribly long ===<br />
<br />
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. ''systemd'' waits some time for each service to exit before trying to kill it. To find out if you are affected, see [http://freedesktop.org/wiki/Software/systemd/Debugging/#shutdowncompleteseventually this article].<br />
<br />
=== Short lived processes do not seem to log any output ===<br />
<br />
If {{ic|journalctl -u foounit}} does not show any output for a short lived service, look at the PID instead. For example, if {{ic|systemd-modules-load.service}} fails, and {{ic|systemctl status systemd-modules-load}} shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i.e. {{ic|journalctl -b _PID&#61;123}}. Metadata fields for the journal such as {{ic|_SYSTEMD_UNIT}} and {{ic|_COMM}} are collected asynchronously and rely on the {{ic|/proc}} directory for the process existing. Fixing this requires fixing the kernel to provide this data via a socket connection, similar to {{ic|SCM_CREDENTIALS}}.<br />
<br />
=== Boot time increasing over time ===<br />
<br />
After using {{ic|systemd-analyze}} a number of users have noticed that their boot time has increased significantly in comparison with what it used to be. After using {{ic|systemd-analyze blame}} [[NetworkManager]] is being reported as taking an unusually large amount of time to start. <br />
<br />
The problem for some users has been due to {{ic|/var/log/journal}} becoming too large. This may have other impacts on performance, such as for {{ic|systemctl status}} or {{ic|journalctl}}. As such the solution is to remove every file within the folder (ideally making a backup of it somewhere, at least temporarily) and then setting a journal file size limit as described in [[#Journal size limit]].<br />
<br />
=== systemd-tmpfiles-setup.service fails to start at boot ===<br />
<br />
Starting with systemd 219, {{ic|/usr/lib/tmpfiles.d/systemd.conf}} specifies ACL attributes for directories under {{ic|/var/log/journal}} and, therefore, requires ACL support to be enabled for the filesystem the journal resides on.<br />
<br />
See [[Access Control Lists#Enabling ACL]] for instructions on how to enable ACL on the filesystem that houses {{ic|/var/log/journal}}.<br />
<br />
=== systemctl enable fails for symlinks in /etc/systemd/system ===<br />
<br />
If {{ic|/etc/systemd/system/''foo''.service}} is a symlink and {{ic|systemctl enable ''foo''.service}} is run, it will fail with this error:<br />
<br />
Failed to issue method call: No such file or directory<br />
<br />
This is a [https://bugzilla.redhat.com/show_bug.cgi?id=955379#c14 design choice] of systemd. As a workaround, enabling by absolute path works:<br />
<br />
# systemctl enable ''/absolute/path/foo''.service<br />
<br />
=== systemd version printed on boot is not the same as installed package version ===<br />
<br />
You need to [[Mkinitcpio#Image_creation_and_activation|regenerate your initramfs]] and the versions should match. <br />
<br />
{{Tip|1=A pacman hook can be used to automatically regenerate the initramfs every time {{pkg|systemd}} is upgraded. See [https://bbs.archlinux.org/viewtopic.php?id=215411 this forum thread] and [[Pacman#Hooks]].}}<br />
<br />
=== Disable emergency mode on remote machine ===<br />
<br />
You may want to disable emergency mode on a remote machine, for example, a virtual machine hosted at Azure or Google Cloud. It is because if emergency mode is triggered, the machine will be blocked from connecting to network.<br />
<br />
# systemctl mask emergency.service<br />
# systemctl mask emergency.target<br />
<br />
== See also ==<br />
<br />
*[[Wikipedia:systemd|Wikipedia article]]<br />
*[http://www.freedesktop.org/wiki/Software/systemd systemd Official web site]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/Optimizations systemd optimizations]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions systemd FAQ]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks systemd Tips and tricks]<br />
*[http://wiki.gentoo.org/wiki/Systemd Gentoo Wiki systemd page]<br />
*[http://fedoraproject.org/wiki/Systemd Fedora Project - About systemd]<br />
*[http://fedoraproject.org/wiki/How_to_debug_Systemd_problems Fedora Project - How to debug systemd problems]<br />
*[http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet Fedora Project - SysVinit to systemd cheatsheet]<br />
*[[gentoo:Systemd|Gentoo Wiki systemd page]]<br />
*[[debian:systemd|Debian Wiki systemd page]]<br />
*[http://0pointer.de/public/systemd-man/ Manual pages]<br />
*[http://0pointer.de/blog/projects/systemd.html Lennart's blog story], [http://0pointer.de/blog/projects/systemd-update.html update 1], [http://0pointer.de/blog/projects/systemd-update-2.html update 2], [http://0pointer.de/blog/projects/systemd-update-3.html update 3], [http://0pointer.de/blog/projects/why.html summary]<br />
*[http://0pointer.de/public/systemd-ebook-psankar.pdf systemd for Administrators (PDF)]<br />
*[https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units How To Use Systemctl to Manage Systemd Services and Units ]<br />
*[https://dvdhrm.wordpress.com/2013/08/24/session-management-on-linux/ Session management with systemd-logind]<br />
*[[Emacs#Syntax highlighting for systemd Files|Emacs Syntax highlighting for Systemd files]]<br />
*[http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html Two] [http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html part] introductory article in ''The H Open'' magazine.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Systemd&diff=502695Systemd2017-12-14T18:09:53Z<p>GenkiSky: /* Editing provided units */ Add links to new terms in subsections (See #Journal for analogy, also because there is a "Tip" box separating this paragraph and the subsections)</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[Category:Init]]<br />
[[ar:Systemd]]<br />
[[de:Systemd]]<br />
[[el:Systemd]]<br />
[[es:Systemd]]<br />
[[fa:Systemd]]<br />
[[fr:Systemd]]<br />
[[it:Systemd]]<br />
[[ja:Systemd]]<br />
[[pt:Systemd]]<br />
[[ru:Systemd]]<br />
[[zh-hans:Systemd]]<br />
[[zh-hant:Systemd]]<br />
{{Related articles start}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd/Timers}}<br />
{{Related|systemd FAQ}}<br />
{{Related|init}}<br />
{{Related|Daemons#List of daemons}}<br />
{{Related|udev}}<br />
{{Related|Improve boot performance}}<br />
{{Related|Allow users to shutdown}}<br />
{{Related articles end}}<br />
<br />
From the [http://freedesktop.org/wiki/Software/systemd project web page]:<br />
<br />
:''systemd'' is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system. systemd provides aggressive parallelization capabilities, uses socket and [[D-Bus]] activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux [[control groups]], maintains mount and automount points, and implements an elaborate transactional dependency-based service control logic. ''systemd'' supports SysV and LSB init scripts and works as a replacement for sysvinit. Other parts include a logging daemon, utilities to control basic system configuration like the hostname, date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution.<br />
<br />
{{Note|1=For a detailed explanation as to why Arch has moved to ''systemd'', see [https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 this forum post].}}<br />
<br />
== Basic systemctl usage ==<br />
<br />
The main command used to introspect and control ''systemd'' is ''systemctl''. Some of its uses are examining the system state and managing the system and services. See {{man|1|systemctl}} for more details.<br />
<br />
{{Tip|<br />
* You can use all of the following ''systemctl'' commands with the {{ic|-H ''user''@''host''}} switch to control a ''systemd'' instance on a remote machine. This will use [[SSH]] to connect to the remote ''systemd'' instance.<br />
* ''systemadm'' is the official graphical frontend for ''systemctl'' and is provided by the {{Pkg|systemd-ui}} package.<br />
* [[Plasma]] users can install {{Pkg|systemd-kcm}} as a graphical frontend for ''systemctl''. After installing the module will be added under ''System administration''.}}<br />
<br />
=== Analyzing the system state ===<br />
<br />
Show '''system status''' using:<br />
<br />
$ systemctl status<br />
<br />
'''List running''' units:<br />
<br />
$ systemctl<br />
<br />
or:<br />
<br />
$ systemctl list-units<br />
<br />
'''List failed''' units:<br />
<br />
$ systemctl --failed<br />
<br />
The available unit files can be seen in {{ic|/usr/lib/systemd/system/}} and {{ic|/etc/systemd/system/}} (the latter takes precedence). '''List installed''' unit files with:<br />
<br />
$ systemctl list-unit-files<br />
<br />
=== Using units ===<br />
<br />
Units can be, for example, services (''.service''), mount points (''.mount''), devices (''.device'') or sockets (''.socket'').<br />
<br />
When using ''systemctl'', you generally have to specify the complete name of the unit file, including its suffix, for example {{ic|sshd.socket}}. There are however a few short forms when specifying the unit in the following ''systemctl'' commands:<br />
<br />
* If you do not specify the suffix, systemctl will assume ''.service''. For example, {{ic|netctl}} and {{ic|netctl.service}} are equivalent.<br />
* Mount points will automatically be translated into the appropriate ''.mount'' unit. For example, specifying {{ic|/home}} is equivalent to {{ic|home.mount}}.<br />
* Similar to mount points, devices are automatically translated into the appropriate ''.device'' unit, therefore specifying {{ic|/dev/sda2}} is equivalent to {{ic|dev-sda2.device}}.<br />
<br />
See {{man|5|systemd.unit}} for details.<br />
<br />
{{Note|Some unit names contain an {{ic|@}} sign (e.g. {{ic|name@''string''.service}}): this means that they are [http://0pointer.de/blog/projects/instances.html instances] of a ''template'' unit, whose actual file name does not contain the {{ic|''string''}} part (e.g. {{ic|name@.service}}). {{ic|''string''}} is called the ''instance identifier'', and is similar to an argument that is passed to the template unit when called with the ''systemctl'' command: in the unit file it will substitute the {{ic|%i}} specifier. <br />
<br />
To be more accurate, ''before'' trying to instantiate the {{ic|name@.suffix}} template unit, ''systemd'' will actually look for a unit with the exact {{ic|name@string.suffix}} file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an {{ic|@}} sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will just fail, since the {{ic|%i}} specifier cannot be substituted.<br />
}}<br />
<br />
{{Tip|<br />
* Most of the following commands also work if multiple units are specified, see {{man|1|systemctl}} for more information.<br />
* The {{ic|--now}} switch can be used in conjunction with {{ic|enable}}, {{ic|disable}}, and {{ic|mask}} to respectively start, stop, or mask immediately the unit rather than after the next boot.<br />
* A package may offer units for different purposes. If you just installed a package, {{ic|pacman -Qql ''package'' <nowiki>|</nowiki> grep -Fe .service -e .socket}} can be used to check and find them.}}<br />
<br />
'''Start''' a unit immediately:<br />
<br />
# systemctl start ''unit''<br />
<br />
'''Stop''' a unit immediately:<br />
<br />
# systemctl stop ''unit''<br />
<br />
'''Restart''' a unit:<br />
<br />
# systemctl restart ''unit''<br />
<br />
Ask a unit to '''reload''' its configuration:<br />
<br />
# systemctl reload ''unit''<br />
<br />
Show the '''status''' of a unit, including whether it is running or not:<br />
<br />
$ systemctl status ''unit''<br />
<br />
'''Check''' whether a unit is already enabled or not:<br />
<br />
$ systemctl is-enabled ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''':<br />
<br />
# systemctl enable ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''' and '''Start''' immediately:<br />
<br />
# systemctl enable --now ''unit''<br />
<br />
'''Disable''' a unit to not start during bootup:<br />
<br />
# systemctl disable ''unit''<br />
<br />
'''Mask''' a unit to make it impossible to start it:<br />
<br />
# systemctl mask ''unit''<br />
<br />
'''Unmask''' a unit:<br />
<br />
# systemctl unmask ''unit''<br />
<br />
Show the '''manual page''' associated with a unit (this has to be supported by the unit file):<br />
<br />
$ systemctl help ''unit''<br />
<br />
Reload ''systemd'', scanning for '''new or changed units''':<br />
<br />
# systemctl daemon-reload<br />
<br />
=== Power management ===<br />
<br />
[[polkit]] is necessary for power management as an unprivileged user. If you are in a local ''systemd-logind'' user session and no other session is active, the following commands will work without root privileges. If not (for example, because another user is logged into a tty), ''systemd'' will automatically ask you for the root password.<br />
<br />
Shut down and reboot the system:<br />
<br />
$ systemctl reboot<br />
<br />
Shut down and power-off the system:<br />
<br />
$ systemctl poweroff<br />
<br />
Suspend the system:<br />
<br />
$ systemctl suspend<br />
<br />
Put the system into hibernation:<br />
<br />
$ systemctl hibernate<br />
<br />
Put the system into hybrid-sleep state (or suspend-to-both):<br />
<br />
$ systemctl hybrid-sleep<br />
<br />
== Writing unit files ==<br />
<br />
The syntax of ''systemd'''s [http://www.freedesktop.org/software/systemd/man/systemd.unit.html unit files] is inspired by XDG Desktop Entry Specification ''.desktop'' files, which are in turn inspired by Microsoft Windows ''.ini'' files. Unit files are loaded from two locations. From lowest to highest precedence they are:<br />
<br />
* {{ic|/usr/lib/systemd/system/}}: units provided by installed packages<br />
* {{ic|/etc/systemd/system/}}: units installed by the system administrator<br />
<br />
{{Note|<br />
* The load paths are completely different when running ''systemd'' in [[systemd/User#How it works|user mode]].<br />
* systemd unit names may only contain ASCII alphanumeric characters, underscores and periods. All other characters must be replaced by C-style "\x2d" escapes, or employ their pre defined semantics ('@', '-'). See {{man|5|systemd.unit}} and {{man|1|systemd-escape}} for more information.}}<br />
<br />
Look at the units installed by your packages for examples, as well as the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples annotated example section] of {{man|5|systemd.service}}.<br />
<br />
{{Tip|Comments prepended with {{ic|#}} may be used in unit-files as well, but only in new lines. Do not use end-line comments after ''systemd'' parameters or the unit will fail to activate.}}<br />
<br />
=== Handling dependencies ===<br />
<br />
With ''systemd'', dependencies can be resolved by designing the unit files correctly. The most typical case is that the unit ''A'' requires the unit ''B'' to be running before ''A'' is started. In that case add {{ic|1=Requires=''B''}} and {{ic|1=After=''B''}} to the {{ic|[Unit]}} section of ''A''. If the dependency is optional, add {{ic|1=Wants=''B''}} and {{ic|1=After=''B''}} instead. Note that {{ic|1=Wants=}} and {{ic|1=Requires=}} do not imply {{ic|1=After=}}, meaning that if {{ic|1=After=}} is not specified, the two units will be started in parallel.<br />
<br />
Dependencies are typically placed on services and not on [[#Targets]]. For example, {{ic|network.target}} is pulled in by whatever service configures your network interfaces, therefore ordering your custom unit after it is sufficient since {{ic|network.target}} is started anyway.<br />
<br />
=== Service types ===<br />
<br />
There are several different start-up types to consider when writing a custom service file. This is set with the {{ic|1=Type=}} parameter in the {{ic|[Service]}} section:<br />
<br />
* {{ic|1=Type=simple}} (default): ''systemd'' considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.<br />
* {{ic|1=Type=forking}}: ''systemd'' considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify {{ic|1=PIDFile=}} as well so ''systemd'' can keep track of the main process.<br />
* {{ic|1=Type=oneshot}}: this is useful for scripts that do a single job and then exit. You may want to set {{ic|1=RemainAfterExit=yes}} as well so that ''systemd'' still considers the service as active after the process has exited.<br />
* {{ic|1=Type=notify}}: identical to {{ic|1=Type=simple}}, but with the stipulation that the daemon will send a signal to ''systemd'' when it is ready. The reference implementation for this notification is provided by ''libsystemd-daemon.so''.<br />
* {{ic|1=Type=dbus}}: the service is considered ready when the specified {{ic|BusName}} appears on DBus's system bus.<br />
* {{ic|1=Type=idle}}: ''systemd'' will delay execution of the service binary until all jobs are dispatched. Other than that behavior is very similar to {{ic|1=Type=simple}}. <br />
<br />
See the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= systemd.service(5)] man page for a more detailed explanation of the {{ic|Type}} values.<br />
<br />
=== Editing provided units ===<br />
<br />
To avoid conflicts with pacman, unit files provided by packages should not be directly edited. There are two safe ways to modify a unit without touching the original file: create a new unit file which [[#Replacement_unit_files|overrides the original unit]] or create [[#Drop-in_files|drop-in snippets]] which are applied on top of the original unit. For both methods, you must reload the unit afterwards to apply your changes. This can be done either by editing the unit with {{ic|systemctl edit}} (which reloads the unit automatically) or by reloading all units with:<br />
<br />
# systemctl daemon-reload<br />
<br />
{{Tip|<br />
* You can use ''systemd-delta'' to see which unit files have been overridden or extended and what exactly has been changed.<br />
* Use {{ic|systemctl cat ''unit''}} to view the content of a unit file and all associated drop-in snippets.<br />
* The default syntax highlighting for ''systemd'' unit files within [[Vim]] is the same as for [[Wikipedia:Ini_file|INI files]]. However, if you want something more systemd-specific, install {{Pkg|vim-systemd}}.<br />
}}<br />
<br />
==== Replacement unit files ====<br />
<br />
To replace the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the file {{ic|/etc/systemd/system/''unit''}} and reenable the unit to update the symlinks:<br />
<br />
# systemctl reenable ''unit''<br />
<br />
Alternatively, run:<br />
<br />
# systemctl edit --full ''unit''<br />
<br />
This opens {{ic|/etc/systemd/system/''unit''}} in your editor (copying the installed version if it does not exist yet) and automatically reloads it when you finish editing.<br />
<br />
{{Note|Pacman does not update the replacement unit files when the originals are updated, so this method can make system maintenance more difficult. For this reason the next approach is recommended.}}<br />
<br />
==== Drop-in files ====<br />
<br />
To create drop-in files for the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the directory {{ic|/etc/systemd/system/''unit''.d/}} and place ''.conf'' files there to override or add new options. ''systemd'' will parse these ''.conf'' files and apply them on top of the original unit.<br />
<br />
The easiest way to do this is to run:<br />
<br />
# systemctl edit ''unit''<br />
<br />
This opens the file {{ic|/etc/systemd/system/''unit''.d/override.conf}} in your text editor (creating it if necessary) and automatically reloads the unit when you are done editing.<br />
<br />
==== Revert to vendor version ====<br />
<br />
To revert any changes to a unit made using {{ic|systemctl edit}} do:<br />
<br />
# systemctl revert ''unit''<br />
<br />
==== Examples ====<br />
<br />
For example, if you simply want to add an additional dependency to a unit, you may create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customdependency.conf|2=<br />
[Unit]<br />
Requires=''new dependency''<br />
After=''new dependency''<br />
}}<br />
<br />
As another example, in order to replace the {{ic|ExecStart}} directive for a unit that is not of type {{ic|oneshot}}, create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customexec.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=''new command''<br />
}}<br />
<br />
Note how {{ic|ExecStart}} must be cleared before being re-assigned [https://bugzilla.redhat.com/show_bug.cgi?id=756787#c9]. The same holds for every item that can be specified multiple times, e.g. {{ic|OnCalendar}} for timers.<br />
<br />
One more example to automatically restart a service:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/restart.conf|2=<br />
[Service]<br />
Restart=always<br />
RestartSec=30<br />
}}<br />
<br />
== Targets ==<br />
<br />
{{Style|Unclear description, copy-pasted content (explicitly mentions "Fedora").|section=Make section "Targets" more clearly}}<br />
<br />
''systemd'' uses ''targets'' which serve a similar purpose as [[wikipedia:Runlevel|runlevels]] but act a little different. Each ''target'' is named instead of numbered and is intended to serve a specific purpose with the possibility of having multiple ones active at the same time. Some ''target''s are implemented by inheriting all of the services of another ''target'' and adding additional services to it. There are ''systemd'' ''target''s that mimic the common SystemVinit runlevels so you can still switch ''target''s using the familiar {{ic|telinit RUNLEVEL}} command.<br />
<br />
=== Get current targets ===<br />
<br />
The following should be used under ''systemd'' instead of running {{ic|runlevel}}:<br />
<br />
$ systemctl list-units --type=target<br />
<br />
=== Create custom target ===<br />
<br />
The runlevels that held a defined meaning under sysvinit (i.e., 0, 1, 3, 5, and 6); have a 1:1 mapping with a specific ''systemd'' ''target''. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named ''systemd'' ''target'' as {{ic|/etc/systemd/system/''your target''}} that takes one of the existing runlevels as a base (you can look at {{ic|/usr/lib/systemd/system/graphical.target}} as an example), make a directory {{ic|/etc/systemd/system/''your target''.wants}}, and then symlink the additional services from {{ic|/usr/lib/systemd/system/}} that you wish to enable.<br />
<br />
=== Mapping between SysV runlevels and systemd targets ===<br />
<br />
{| class="wikitable"<br />
! SysV Runlevel !! systemd Target !! Notes<br />
|-<br />
| 0 || runlevel0.target, poweroff.target || Halt the system.<br />
|-<br />
| 1, s, single || runlevel1.target, rescue.target || Single user mode.<br />
|-<br />
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.<br />
|-<br />
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.<br />
|-<br />
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.<br />
|-<br />
| 6 || runlevel6.target, reboot.target || Reboot<br />
|-<br />
| emergency || emergency.target || Emergency shell<br />
|-<br />
|}<br />
<br />
=== Change current target ===<br />
<br />
In ''systemd'' targets are exposed via ''target units''. You can change them like this:<br />
<br />
# systemctl isolate graphical.target<br />
<br />
This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as {{ic|telinit 3}} or {{ic|telinit 5}} in Sysvinit.<br />
<br />
=== Change default target to boot into ===<br />
<br />
The standard target is {{ic|default.target}}, which is aliased by default to {{ic|graphical.target}} (which roughly corresponds to the old runlevel 5). To change the default target at boot-time, append one of the following [[kernel parameters]] to your bootloader:<br />
<br />
* {{ic|1=systemd.unit=multi-user.target}} (which roughly corresponds to the old runlevel 3),<br />
* {{ic|1=systemd.unit=rescue.target}} (which roughly corresponds to the old runlevel 1).<br />
<br />
Alternatively, you may leave the bootloader alone and change {{ic|default.target}}. This can be done using ''systemctl'':<br />
<br />
# systemctl set-default multi-user.target<br />
<br />
To be able to override the previously set {{ic|default.target}}, use the force option:<br />
<br />
# systemctl set-default -f multi-user.target<br />
<br />
The effect of this command is output by ''systemctl''; a symlink to the new default target is made at {{ic|/etc/systemd/system/default.target}}.<br />
<br />
== Temporary files ==<br />
<br />
"''systemd-tmpfiles'' creates, deletes and cleans up volatile and temporary files and directories." It reads configuration files in {{ic|/etc/tmpfiles.d/}} and {{ic|/usr/lib/tmpfiles.d/}} to discover which actions to perform. Configuration files in the former directory take precedence over those in the latter directory.<br />
<br />
Configuration files are usually provided together with service files, and they are named in the style of {{ic|/usr/lib/tmpfiles.d/''program''.conf}}. For example, the [[Samba]] daemon expects the directory {{ic|/run/samba}} to exist and to have the correct permissions. Therefore, the {{Pkg|samba}} package ships with this configuration:<br />
<br />
{{hc|/usr/lib/tmpfiles.d/samba.conf|<br />
D /run/samba 0755 root root}}<br />
<br />
Configuration files may also be used to write values into certain files on boot. For example, if you used {{ic|/etc/rc.local}} to disable wakeup from USB devices with {{ic|echo USBE > /proc/acpi/wakeup}}, you may use the following tmpfile instead:<br />
<br />
{{hc|/etc/tmpfiles.d/disable-usb-wake.conf|<br />
w /proc/acpi/wakeup - - - - USBE}}<br />
<br />
See the {{man|8|systemd-tmpfiles}} and {{man|5|tmpfiles.d}} man pages for details.<br />
<br />
{{Note|This method may not work to set options in {{ic|/sys}} since the ''systemd-tmpfiles-setup'' service may run before the appropriate device modules is loaded. In this case you could check whether the module has a parameter for the option you want to set with {{ic|modinfo ''module''}} and set this option with a [[Kernel modules#Setting module options|config file in /etc/modprobe.d]]. Otherwise you will have to write a [[Udev#About_udev_rules|udev rule]] to set the appropriate attribute as soon as the device appears.}}<br />
<br />
== Timers ==<br />
<br />
A timer is a unit configuration file whose name ends with ''.timer'' and encodes information about a timer controlled and supervised by ''systemd'', for timer-based activation. See [[systemd/Timers]].<br />
<br />
{{Note|Timers can replace [[cron]] functionality to a great extent. See [[systemd/Timers#As a cron replacement]].}}<br />
<br />
== Mounting ==<br />
<br />
Since systemd is a replacement for System V init, it is in charge of the mounts specified in {{ic|/etc/fstab}}. In fact, it goes beyond the usual {{ic|fstab}} capabilities, implementing special mount options prefixed with {{ic|x-systemd.}}. See [[Fstab#Automount with systemd]] for an example of ''automounting'' (mounting on-demand) using these extensions. See [https://www.freedesktop.org/software/systemd/man/systemd.mount.html#fstab] for the complete documentation of these extensions.<br />
<br />
== Journal ==<br />
<br />
''systemd'' has its own logging system called the journal; therefore, running a {{ic|syslog}} daemon is no longer required. To read the log, use:<br />
<br />
# journalctl<br />
<br />
In Arch Linux, the directory {{ic|/var/log/journal/}} is a part of the {{Pkg|systemd}} package, and the journal (when {{ic|1=Storage=}} is set to {{ic|auto}} in {{ic|/etc/systemd/journald.conf}}) will write to {{ic|/var/log/journal/}}. If you or some program delete that directory, ''systemd'' will '''not''' recreate it automatically and instead will write its logs to {{ic|/run/systemd/journal}} in a nonpersistent way. However, the folder will be recreated when you set {{ic|1=Storage=persistent}} and run {{ic|systemctl restart systemd-journald}} (or reboot).<br />
<br />
Systemd journal classifies messages by [[#Priority level|Priority level]] and [[#Facility|Facility]]. Logging classification corresponds to classic [[wikipedia:Syslog|Syslog]] protocol ([https://tools.ietf.org/html/rfc5424 RFC 5424]).<br />
<br />
===Priority level===<br />
<br />
A syslog severity code (in systemd called priority) is used to mark the importance of a message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
|-<br />
! Value !! Severity !! Keyword !! Description || Examples<br />
|-<br />
| 0 || Emergency || emerg || System is unusable || Severe Kernel BUG, systemd dumped core.<br>This level should not be used by applications.<br />
|-<br />
| 1 || Alert || alert || Should be corrected immediately || Vital subsystem goes out of work. Data loss. <br>{{ic|kernel: BUG: unable to handle kernel paging request at ffffc90403238ffc|}}.<br />
|-<br />
| 2 || Critical || crit || Critical conditions || Crashes, coredumps. Like familiar flash:<br>{{ic|systemd-coredump[25319]: Process 25310 (plugin-containe) of user 1000 dumped core}}<br>Failure in the system primary application, like X11. <br />
|-<br />
| 3 || Error || err || Error conditions || Not severe error reported:<br>{{ic|kernel: usb 1-3: 3:1: cannot get freq at ep 0x84}},<br>{{ic|systemd[1]: Failed unmounting /var.}},<br>{{ic|libvirtd[1720]: internal error: Failed to initialize a valid firewall backend}}).<br />
|-<br />
| 4 || Warning || warning || May indicate that an error will occur if action is not taken. || A non-root file system has only 1GB free.<br>{{ic|org.freedesktop. Notifications[1860]: (process:5999): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale}}.<br />
|-<br />
| 5 || Notice || notice || Events that are unusual, but not error conditions. || {{ic|systemd[1]: var.mount: Directory /var to mount over is not empty, mounting anyway}}. {{ic|gcr-prompter[4997]: Gtk: GtkDialog mapped without a transient parent. This is discouraged}}.<br />
|-<br />
| 6 || Informational || info || Normal operational messages that require no action. || {{ic|lvm[585]: 7 logical volume(s) in volume group "archvg" now active}}.<br />
|-<br />
| 7 || Debug || debug || Information useful to developers for debugging the application. || {{ic|kdeinit5[1900]: powerdevil: Scheduling inhibition from ":1.14" "firefox" with cookie 13 and reason "screen"}}.<br />
|}<br />
<br />
If you cannot find a message on the expected priority level, also search a couple of levels above and below: these rules are recommendations, and the developer of the affected application may have a different perception of the issue's importance from yours.<br />
<br />
===Facility===<br />
<br />
A syslog facility code is used to specify the type of program that is logging the message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
! Facility code !! Keyword !! Description !! Info<br />
|-<br />
| 0 || kern || kernel messages<br />
|-<br />
| 1 || user || user-level messages<br />
|-<br />
| 2 || mail || mail system || Archaic POSIX still supported and sometimes used system, for more {{man|1|mail}})<br />
|-<br />
| 3 || daemon || system daemons || All daemons, including systemd and its subsystems<br />
|-<br />
| 4 || auth || security/authorization messages || Also watch for different facility 10<br />
|-<br />
| 5 || syslog || messages generated internally by syslogd || As it standartized for syslogd, not used by systemd (see facility 3)<br />
|-<br />
| 6 || lpr || line printer subsystem (archaic subsystem)<br />
|-<br />
| 7 || news || network news subsystem (archaic subsystem)<br />
|-<br />
| 8 || uucp || UUCP subsystem (archaic subsystem)<br />
|-<br />
| 9 || || clock daemon || systemd-timesyncd<br />
|-<br />
| 10 || authpriv || security/authorization messages || Also watch for different facility 4<br />
|-<br />
| 11 || ftp || FTP daemon<br />
|-<br />
| 12 || - || NTP subsystem<br />
|-<br />
| 13 || - || log audit<br />
|-<br />
| 14 || - || log alert<br />
|-<br />
| 15 || cron || scheduling daemon<br />
|-<br />
| 16 || local0 || local use 0 (local0)<br />
|-<br />
| 17 || local1 || local use 1 (local1)<br />
|-<br />
| 18 || local2 || local use 2 (local2)<br />
|-<br />
| 19 || local3 || local use 3 (local3)<br />
|-<br />
| 20 || local4 || local use 4 (local4)<br />
|-<br />
| 21 || local5 || local use 5 (local5)<br />
|-<br />
| 22 || local6 || local use 6 (local6)<br />
|-<br />
| 23 || local7 || local use 7 (local7)<br />
|}<br />
<br />
So, useful facilities to watch: 0,1,3,4,9,10,15.<br />
<br />
=== Filtering output ===<br />
<br />
''journalctl'' allows you to filter the output by specific fields. Be aware that if there are many messages to display or filtering of large time span has to be done, the output of this command can be delayed for quite some time.<br />
<br />
{{Tip|While the journal is stored in a binary format, the content of stored messages is not modified. This means it is viewable with ''strings'', for example for recovery in an environment which does not have ''systemd'' installed. Example command:<br />
{{bc|$ strings /mnt/arch/var/log/journal/af4967d77fba44c6b093d0e9862f6ddd/system.journal <nowiki>| grep -i</nowiki> ''message''}}<br />
}}<br />
<br />
Examples:<br />
<br />
* Show all messages from this boot: {{bc|# journalctl -b}} However, often one is interested in messages not from the current, but from the previous boot (e.g. if an unrecoverable system crash happened). This is possible through optional offset parameter of the {{ic|-b}} flag: {{ic|journalctl -b -0}} shows messages from the current boot, {{ic|journalctl -b -1}} from the previous boot, {{ic|journalctl -b -2}} from the second previous and so on. See {{man|1|journalctl}} for full description, the semantics is much more powerful.<br />
* Show all messages from date (and optional time): {{bc|1=# journalctl --since="2012-10-30 18:17:16"}}<br />
* Show all messages since 20 minutes ago: {{bc|1=# journalctl --since "20 min ago"}}<br />
* Follow new messages: {{bc|# journalctl -f}}<br />
* Show all messages by a specific executable: {{bc|# journalctl /usr/lib/systemd/systemd}}<br />
* Show all messages by a specific process: {{bc|1=# journalctl _PID=1}}<br />
* Show all messages by a specific unit: {{bc|# journalctl -u netcfg}}<br />
* Show kernel ring buffer: {{bc|1=# journalctl -k}}<br />
* Show only error, critical, and alert priority messages {{bc|# journalctl -p err..alert}} Numbers also can be used, {{ic|journalctl -p 3..1}}. If single number/keyword used, {{ic|journalctl -p 3}} - all higher priority levels also included.<br />
* Show auth.log equivalent by filtering on syslog facility: {{bc|1=# journalctl SYSLOG_FACILITY=10}}<br />
<br />
See {{man|1|journalctl}}, {{man|7|systemd.journal-fields}}, or Lennart's [http://0pointer.de/blog/projects/journalctl.html blog post] for details.<br />
<br />
{{Tip|1=<br />
By default, ''journalctl'' truncates lines longer than screen width, but in some cases, it may be better to enable wrapping instead of truncating. This can be controlled by the {{ic|SYSTEMD_LESS}} [[environment variable]], which contains options passed to [[Core utilities#less|less]] (the default pager) and defaults to {{ic|FRSXMK}} (see {{man|1|less}} and {{man|1|journalctl}} for details).<br />
<br />
By omitting the {{ic|S}} option, the output will be wrapped instead of truncated. For example, start ''journalctl'' as follows:<br />
<br />
$ SYSTEMD_LESS=FRXMK journalctl<br />
<br />
If you would like to set this behaviour as default, [[Environment variables#Per_user|export]] the variable from {{ic|~/.bashrc}} or {{ic|~/.zshrc}}.<br />
}}<br />
<br />
=== Journal size limit ===<br />
<br />
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the underlying file system but capped to 4 GiB. For example, with {{ic|/var/log/journal/}} located on a 20 GiB partition, journal data may take up to 2 GiB. On a 50 GiB partition, it would max at 4 GiB.<br />
<br />
The maximum size of the persistent journal can be controlled by uncommenting and changing the following:<br />
<br />
{{hc|/etc/systemd/journald.conf|2=<br />
SystemMaxUse=50M<br />
}}<br />
<br />
It is also possible to use the drop-in snippets configuration override mechanism rather than editing the global configuration file. In this case do not forget to place the overrides under the {{ic|[Journal]}} header:<br />
<br />
{{hc|/etc/systemd/journald.conf.d/00-journal-size.conf|2=<br />
[Journal]<br />
SystemMaxUse=50M<br />
}}<br />
<br />
See {{man|5|journald.conf}} for more info.<br />
<br />
=== Clean journal files manually ===<br />
<br />
Journal files can be globally removed from {{ic|/var/log/journal/}} using ''e.g.'' {{ic|rm}}, or can be trimmed according to various criteria using {{ic|journalctl}}. Examples:<br />
<br />
* Remove archived journal files until the disk space they use falls below 100M: {{bc|1=# journalctl --vacuum-size=100M}}<br />
* Make all journal files contain no data older than 2 weeks. {{bc|1=# journalctl --vacuum-time=2weeks}}<br />
<br />
See {{man|1|journalctl}} for more info.<br />
<br />
=== Journald in conjunction with syslog ===<br />
<br />
Compatibility with a classic, non-journald aware [[Syslog-ng|syslog]] implementation can be provided by letting ''systemd'' forward all messages via the socket {{ic|/run/systemd/journal/syslog}}. To make the syslog daemon work with the journal, it has to bind to this socket instead of {{ic|/dev/log}} ([http://lwn.net/Articles/474968/ official announcement]). <br />
<br />
The default {{ic|journald.conf}} for forwarding to the socket is {{ic|1=ForwardToSyslog=no}} to avoid system overhead, because [[rsyslog]] or [[syslog-ng]] pull the messages from the journal by [http://lists.freedesktop.org/archives/systemd-devel/2014-August/022295.html#journald itself]. <br />
<br />
See [[Syslog-ng#Overview]] and [[Syslog-ng#syslog-ng and systemd journal]], or [[rsyslog]] respectively, for details on configuration.<br />
<br />
=== Forward journald to /dev/tty12 ===<br />
<br />
Create a [[#Editing provided units|drop-in directory]] {{ic|/etc/systemd/journald.conf.d}} and create a {{ic|fw-tty12.conf}} file in it:<br />
<br />
{{hc|1=/etc/systemd/journald.conf.d/fw-tty12.conf|2=<br />
[Journal]<br />
ForwardToConsole=yes<br />
TTYPath=/dev/tty12<br />
MaxLevelConsole=info<br />
}}<br />
<br />
Then [[restart]] systemd-journald.<br />
<br />
=== Specify a different journal to view ===<br />
There may be a need to check the logs of another system that is dead in the water, like booting from a live system to recover a production system. In such case, one can mount the disk in e.g. {{ic|/mnt}}, and specify the journal path via {{ic|-D}}/{{ic|--directory}}, like so:<br />
<br />
$ journalctl -D ''/mnt''/var/log/journal -xe<br />
<br />
== Tips and tricks ==<br />
<br />
=== Enable installed units by default ===<br />
<br />
{{Expansion|How does it work with instantiated units?}}<br />
<br />
Arch Linux ships with {{ic|/usr/lib/systemd/system-preset/99-default.preset}} containing {{ic|disable *}}. This causes ''systemctl preset'' to disable all units by default, such that when a new package is installed, the user must manually enable the unit.<br />
<br />
If this behavior is not desired, simply create a symlink from {{ic|/etc/systemd/system-preset/99-default.preset}} to {{ic|/dev/null}} in order to override the configuration file. This will cause ''systemctl preset'' to enable all units that get installed—regardless of unit type—unless specified in another file in one ''systemctl preset'''s configuration directories. User units are not affected. See the manpage for {{ic|systemd.preset}} for more information.<br />
<br />
{{Note|Enabling all units by default may cause problems with packages that contain two or more mutually exclusive units. ''systemctl preset'' is designed to be used by distributions and spins or system administrators. In the case where two conflicting units would be enabled, you should explicitly specify which one is to be disabled in a preset configuration file as specified in the manpage for {{ic|systemd.preset}}.}}<br />
<br />
=== Sandboxing application environments ===<br />
A unit file can be created as a sandbox to isolate applications and their processes within a hardened virtual environment. systemd leverages [[wikipedia:Linux_namespaces|namespaces]], white-/blacklisting of [[Capabilities]], and [[control groups]] to container processes through an extensive [https://www.freedesktop.org/software/systemd/man/systemd.exec.html execution environment configuration].<br />
<br />
The enhancement of an existing systemd unit file with application sandboxing typically requires trial-and-error tests accompanied by the generous use of {{Pkg|strace}}, [[wikipedia:Standard_streams#Standard_error_.28stderr.29|stderr]] and [https://www.freedesktop.org/software/systemd/man/journalctl.html journalctl] error logging and output facilities. You may want to first search upstream documentation for already done tests to base trials on.<br />
<br />
Some examples on how sandboxing with systemd can be deployed:<br />
* {{Ic|CapabilityBoundingSet}} defines a whitelisted set of allowed capabilities, but may also be used to blacklist a specific capability for a unit.<br />
** The {{Ic|CAP_SYS_ADM}} capability, for example, which should be one of the [https://lwn.net/Articles/486306/ goals of a secure sandbox]: {{ic|1=CapabilityBoundingSet=~ CAP_SYS_ADM}}<br />
* [[Unbound#Sandboxing]]{{Broken section link}} shows a full-scale example of systemd features for sandboxing.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Investigating systemd errors ===<br />
<br />
As an example, we will investigate an error with {{ic|systemd-modules-load}} service:<br />
<br />
'''1.''' Lets find the ''systemd'' services which fail to start at boot time:<br />
<br />
{{hc|1=$ systemctl --state=failed|2=<br />
systemd-modules-load.service loaded '''failed failed''' Load Kernel Modules}}<br />
<br />
Another way is to live log ''systemd'' messages:<br />
<br />
$ journalctl -fp err<br />
<br />
'''2.''' Ok, we found a problem with {{ic|systemd-modules-load}} service. We want to know more:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''failed''' (Result: exit-code) since So 2013-08-25 11:48:13 CEST; 32s ago<br />
Docs: man:systemd-modules-load.service(8).<br />
man:modules-load.d(5)<br />
Process: '''15630''' ExecStart=/usr/lib/systemd/systemd-modules-load ('''code=exited, status=1/FAILURE''')<br />
}}<br />
If the {{ic|Process ID}} is not listed, just restart the failed service with {{ic|systemctl restart systemd-modules-load}}<br />
<br />
'''3.''' Now we have the process id (PID) to investigate this error in depth. Enter the following command with the current {{ic|Process ID}} (here: 15630):<br />
{{hc|1=$ journalctl _PID=15630|2=<br />
-- Logs begin at Sa 2013-05-25 10:31:12 CEST, end at So 2013-08-25 11:51:17 CEST. --<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'blacklist usblp''''<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'install usblp /bin/false'''' <br />
}}<br />
<br />
'''4.''' We see that some of the kernel module configs have wrong settings. Therefore we have a look at these settings in {{ic|/etc/modules-load.d/}}:<br />
{{hc|$ ls -Al /etc/modules-load.d/|<br />
...<br />
-rw-r--r-- 1 root root 79 1. Dez 2012 blacklist.conf<br />
-rw-r--r-- 1 root root 1 2. Mär 14:30 encrypt.conf<br />
-rw-r--r-- 1 root root 3 5. Dez 2012 printing.conf<br />
-rw-r--r-- 1 root root 6 14. Jul 11:01 realtek.conf<br />
-rw-r--r-- 1 root root 65 2. Jun 23:01 virtualbox.conf<br />
...<br />
}}<br />
<br />
'''5.''' The {{ic|Failed to find module 'blacklist usblp'}} error message might be related to a wrong setting inside of {{ic|blacklist.conf}}. Lets deactivate it with inserting a trailing '''#''' before each option we found via step 3:<br />
{{hc|/etc/modules-load.d/blacklist.conf|<br />
'''#''' blacklist usblp<br />
'''#''' install usblp /bin/false<br />
}}<br />
<br />
'''6.''' Now, try to start {{ic|systemd-modules-load}}:<br />
$ systemctl start systemd-modules-load<br />
If it was successful, this should not prompt anything. If you see any error, go back to step 3 and use the new PID for solving the errors left.<br />
<br />
If everything is ok, you can verify that the service was started successfully with:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: '''loaded''' (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''active (exited)''' since So 2013-08-25 12:22:31 CEST; 34s ago<br />
Docs: man:systemd-modules-load.service(8)<br />
man:modules-load.d(5)<br />
Process: 19005 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)<br />
Aug 25 12:22:31 mypc systemd[1]: '''Started Load Kernel Modules'''.<br />
}}<br />
<br />
=== Diagnosing boot problems ===<br />
<br />
''systemd'' has several options for diagnosing problems with the boot process. See [[boot debugging]] for more general instructions and options to capture boot messages before ''systemd'' takes over the [[boot process]]. Also see the [http://freedesktop.org/wiki/Software/systemd/Debugging/ systemd debugging documentation].<br />
<br />
=== Diagnosing problems with a specific service ===<br />
<br />
{{Accuracy|This may not catch all errors such as missing libraries.|User talk:Alucryd#Plex}}<br />
<br />
If some ''systemd'' service misbehaves and you want to get more information about what is going on, set the {{ic|SYSTEMD_LOG_LEVEL}} [[environment variable]] to {{ic|debug}}. For example, to run the ''systemd-networkd'' daemon in debug mode:<br />
<br />
# systemctl stop systemd-networkd<br />
# SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd<br />
<br />
Or, equivalently, modify the service file temporarily for gathering enough output. For example: <br />
<br />
{{hc|/usr/lib/systemd/system/systemd-networkd.service|2=<br />
[Service]<br />
...<br />
Environment=SYSTEMD_LOG_LEVEL=debug<br />
....<br />
}}<br />
<br />
If debug information is required long-term, add the variable the [[#Editing provided units|regular]] way.<br />
<br />
=== Shutdown/reboot takes terribly long ===<br />
<br />
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. ''systemd'' waits some time for each service to exit before trying to kill it. To find out if you are affected, see [http://freedesktop.org/wiki/Software/systemd/Debugging/#shutdowncompleteseventually this article].<br />
<br />
=== Short lived processes do not seem to log any output ===<br />
<br />
If {{ic|journalctl -u foounit}} does not show any output for a short lived service, look at the PID instead. For example, if {{ic|systemd-modules-load.service}} fails, and {{ic|systemctl status systemd-modules-load}} shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i.e. {{ic|journalctl -b _PID&#61;123}}. Metadata fields for the journal such as {{ic|_SYSTEMD_UNIT}} and {{ic|_COMM}} are collected asynchronously and rely on the {{ic|/proc}} directory for the process existing. Fixing this requires fixing the kernel to provide this data via a socket connection, similar to {{ic|SCM_CREDENTIALS}}.<br />
<br />
=== Boot time increasing over time ===<br />
<br />
After using {{ic|systemd-analyze}} a number of users have noticed that their boot time has increased significantly in comparison with what it used to be. After using {{ic|systemd-analyze blame}} [[NetworkManager]] is being reported as taking an unusually large amount of time to start. <br />
<br />
The problem for some users has been due to {{ic|/var/log/journal}} becoming too large. This may have other impacts on performance, such as for {{ic|systemctl status}} or {{ic|journalctl}}. As such the solution is to remove every file within the folder (ideally making a backup of it somewhere, at least temporarily) and then setting a journal file size limit as described in [[#Journal size limit]].<br />
<br />
=== systemd-tmpfiles-setup.service fails to start at boot ===<br />
<br />
Starting with systemd 219, {{ic|/usr/lib/tmpfiles.d/systemd.conf}} specifies ACL attributes for directories under {{ic|/var/log/journal}} and, therefore, requires ACL support to be enabled for the filesystem the journal resides on.<br />
<br />
See [[Access Control Lists#Enabling ACL]] for instructions on how to enable ACL on the filesystem that houses {{ic|/var/log/journal}}.<br />
<br />
=== systemctl enable fails for symlinks in /etc/systemd/system ===<br />
<br />
If {{ic|/etc/systemd/system/''foo''.service}} is a symlink and {{ic|systemctl enable ''foo''.service}} is run, it will fail with this error:<br />
<br />
Failed to issue method call: No such file or directory<br />
<br />
This is a [https://bugzilla.redhat.com/show_bug.cgi?id=955379#c14 design choice] of systemd. As a workaround, enabling by absolute path works:<br />
<br />
# systemctl enable ''/absolute/path/foo''.service<br />
<br />
=== systemd version printed on boot is not the same as installed package version ===<br />
<br />
You need to [[Mkinitcpio#Image_creation_and_activation|regenerate your initramfs]] and the versions should match. <br />
<br />
{{Tip|1=A pacman hook can be used to automatically regenerate the initramfs every time {{pkg|systemd}} is upgraded. See [https://bbs.archlinux.org/viewtopic.php?id=215411 this forum thread] and [[Pacman#Hooks]].}}<br />
<br />
=== Disable emergency mode on remote machine ===<br />
<br />
You may want to disable emergency mode on a remote machine, for example, a virtual machine hosted at Azure or Google Cloud. It is because if emergency mode is triggered, the machine will be blocked from connecting to network.<br />
<br />
# systemctl mask emergency.service<br />
# systemctl mask emergency.target<br />
<br />
== See also ==<br />
<br />
*[[Wikipedia:systemd|Wikipedia article]]<br />
*[http://www.freedesktop.org/wiki/Software/systemd systemd Official web site]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/Optimizations systemd optimizations]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions systemd FAQ]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks systemd Tips and tricks]<br />
*[http://wiki.gentoo.org/wiki/Systemd Gentoo Wiki systemd page]<br />
*[http://fedoraproject.org/wiki/Systemd Fedora Project - About systemd]<br />
*[http://fedoraproject.org/wiki/How_to_debug_Systemd_problems Fedora Project - How to debug systemd problems]<br />
*[http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet Fedora Project - SysVinit to systemd cheatsheet]<br />
*[[gentoo:Systemd|Gentoo Wiki systemd page]]<br />
*[[debian:systemd|Debian Wiki systemd page]]<br />
*[http://0pointer.de/public/systemd-man/ Manual pages]<br />
*[http://0pointer.de/blog/projects/systemd.html Lennart's blog story], [http://0pointer.de/blog/projects/systemd-update.html update 1], [http://0pointer.de/blog/projects/systemd-update-2.html update 2], [http://0pointer.de/blog/projects/systemd-update-3.html update 3], [http://0pointer.de/blog/projects/why.html summary]<br />
*[http://0pointer.de/public/systemd-ebook-psankar.pdf systemd for Administrators (PDF)]<br />
*[https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units How To Use Systemctl to Manage Systemd Services and Units ]<br />
*[https://dvdhrm.wordpress.com/2013/08/24/session-management-on-linux/ Session management with systemd-logind]<br />
*[[Emacs#Syntax highlighting for systemd Files|Emacs Syntax highlighting for Systemd files]]<br />
*[http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html Two] [http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html part] introductory article in ''The H Open'' magazine.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Systemd&diff=502582Systemd2017-12-14T01:31:37Z<p>GenkiSky: /* Editing provided units */ Clarify that vim already has some default syntax highlighting for unit files</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Daemons and system services]]<br />
[[Category:Boot process]]<br />
[[Category:Init]]<br />
[[ar:Systemd]]<br />
[[de:Systemd]]<br />
[[el:Systemd]]<br />
[[es:Systemd]]<br />
[[fa:Systemd]]<br />
[[fr:Systemd]]<br />
[[it:Systemd]]<br />
[[ja:Systemd]]<br />
[[pt:Systemd]]<br />
[[ru:Systemd]]<br />
[[zh-hans:Systemd]]<br />
[[zh-hant:Systemd]]<br />
{{Related articles start}}<br />
{{Related|systemd/User}}<br />
{{Related|systemd/Timers}}<br />
{{Related|systemd FAQ}}<br />
{{Related|init}}<br />
{{Related|Daemons#List of daemons}}<br />
{{Related|udev}}<br />
{{Related|Improve boot performance}}<br />
{{Related|Allow users to shutdown}}<br />
{{Related articles end}}<br />
<br />
From the [http://freedesktop.org/wiki/Software/systemd project web page]:<br />
<br />
:''systemd'' is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system. systemd provides aggressive parallelization capabilities, uses socket and [[D-Bus]] activation for starting services, offers on-demand starting of daemons, keeps track of processes using Linux [[control groups]], maintains mount and automount points, and implements an elaborate transactional dependency-based service control logic. ''systemd'' supports SysV and LSB init scripts and works as a replacement for sysvinit. Other parts include a logging daemon, utilities to control basic system configuration like the hostname, date, locale, maintain a list of logged-in users and running containers and virtual machines, system accounts, runtime directories and settings, and daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution.<br />
<br />
{{Note|1=For a detailed explanation as to why Arch has moved to ''systemd'', see [https://bbs.archlinux.org/viewtopic.php?pid=1149530#p1149530 this forum post].}}<br />
<br />
== Basic systemctl usage ==<br />
<br />
The main command used to introspect and control ''systemd'' is ''systemctl''. Some of its uses are examining the system state and managing the system and services. See {{man|1|systemctl}} for more details.<br />
<br />
{{Tip|<br />
* You can use all of the following ''systemctl'' commands with the {{ic|-H ''user''@''host''}} switch to control a ''systemd'' instance on a remote machine. This will use [[SSH]] to connect to the remote ''systemd'' instance.<br />
* ''systemadm'' is the official graphical frontend for ''systemctl'' and is provided by the {{Pkg|systemd-ui}} package.<br />
* [[Plasma]] users can install {{Pkg|systemd-kcm}} as a graphical frontend for ''systemctl''. After installing the module will be added under ''System administration''.}}<br />
<br />
=== Analyzing the system state ===<br />
<br />
Show '''system status''' using:<br />
<br />
$ systemctl status<br />
<br />
'''List running''' units:<br />
<br />
$ systemctl<br />
<br />
or:<br />
<br />
$ systemctl list-units<br />
<br />
'''List failed''' units:<br />
<br />
$ systemctl --failed<br />
<br />
The available unit files can be seen in {{ic|/usr/lib/systemd/system/}} and {{ic|/etc/systemd/system/}} (the latter takes precedence). '''List installed''' unit files with:<br />
<br />
$ systemctl list-unit-files<br />
<br />
=== Using units ===<br />
<br />
Units can be, for example, services (''.service''), mount points (''.mount''), devices (''.device'') or sockets (''.socket'').<br />
<br />
When using ''systemctl'', you generally have to specify the complete name of the unit file, including its suffix, for example {{ic|sshd.socket}}. There are however a few short forms when specifying the unit in the following ''systemctl'' commands:<br />
<br />
* If you do not specify the suffix, systemctl will assume ''.service''. For example, {{ic|netctl}} and {{ic|netctl.service}} are equivalent.<br />
* Mount points will automatically be translated into the appropriate ''.mount'' unit. For example, specifying {{ic|/home}} is equivalent to {{ic|home.mount}}.<br />
* Similar to mount points, devices are automatically translated into the appropriate ''.device'' unit, therefore specifying {{ic|/dev/sda2}} is equivalent to {{ic|dev-sda2.device}}.<br />
<br />
See {{man|5|systemd.unit}} for details.<br />
<br />
{{Note|Some unit names contain an {{ic|@}} sign (e.g. {{ic|name@''string''.service}}): this means that they are [http://0pointer.de/blog/projects/instances.html instances] of a ''template'' unit, whose actual file name does not contain the {{ic|''string''}} part (e.g. {{ic|name@.service}}). {{ic|''string''}} is called the ''instance identifier'', and is similar to an argument that is passed to the template unit when called with the ''systemctl'' command: in the unit file it will substitute the {{ic|%i}} specifier. <br />
<br />
To be more accurate, ''before'' trying to instantiate the {{ic|name@.suffix}} template unit, ''systemd'' will actually look for a unit with the exact {{ic|name@string.suffix}} file name, although by convention such a "clash" happens rarely, i.e. most unit files containing an {{ic|@}} sign are meant to be templates. Also, if a template unit is called without an instance identifier, it will just fail, since the {{ic|%i}} specifier cannot be substituted.<br />
}}<br />
<br />
{{Tip|<br />
* Most of the following commands also work if multiple units are specified, see {{man|1|systemctl}} for more information.<br />
* The {{ic|--now}} switch can be used in conjunction with {{ic|enable}}, {{ic|disable}}, and {{ic|mask}} to respectively start, stop, or mask immediately the unit rather than after the next boot.<br />
* A package may offer units for different purposes. If you just installed a package, {{ic|pacman -Qql ''package'' <nowiki>|</nowiki> grep -Fe .service -e .socket}} can be used to check and find them.}}<br />
<br />
'''Start''' a unit immediately:<br />
<br />
# systemctl start ''unit''<br />
<br />
'''Stop''' a unit immediately:<br />
<br />
# systemctl stop ''unit''<br />
<br />
'''Restart''' a unit:<br />
<br />
# systemctl restart ''unit''<br />
<br />
Ask a unit to '''reload''' its configuration:<br />
<br />
# systemctl reload ''unit''<br />
<br />
Show the '''status''' of a unit, including whether it is running or not:<br />
<br />
$ systemctl status ''unit''<br />
<br />
'''Check''' whether a unit is already enabled or not:<br />
<br />
$ systemctl is-enabled ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''':<br />
<br />
# systemctl enable ''unit''<br />
<br />
'''Enable''' a unit to be started on '''bootup''' and '''Start''' immediately:<br />
<br />
# systemctl enable --now ''unit''<br />
<br />
'''Disable''' a unit to not start during bootup:<br />
<br />
# systemctl disable ''unit''<br />
<br />
'''Mask''' a unit to make it impossible to start it:<br />
<br />
# systemctl mask ''unit''<br />
<br />
'''Unmask''' a unit:<br />
<br />
# systemctl unmask ''unit''<br />
<br />
Show the '''manual page''' associated with a unit (this has to be supported by the unit file):<br />
<br />
$ systemctl help ''unit''<br />
<br />
Reload ''systemd'', scanning for '''new or changed units''':<br />
<br />
# systemctl daemon-reload<br />
<br />
=== Power management ===<br />
<br />
[[polkit]] is necessary for power management as an unprivileged user. If you are in a local ''systemd-logind'' user session and no other session is active, the following commands will work without root privileges. If not (for example, because another user is logged into a tty), ''systemd'' will automatically ask you for the root password.<br />
<br />
Shut down and reboot the system:<br />
<br />
$ systemctl reboot<br />
<br />
Shut down and power-off the system:<br />
<br />
$ systemctl poweroff<br />
<br />
Suspend the system:<br />
<br />
$ systemctl suspend<br />
<br />
Put the system into hibernation:<br />
<br />
$ systemctl hibernate<br />
<br />
Put the system into hybrid-sleep state (or suspend-to-both):<br />
<br />
$ systemctl hybrid-sleep<br />
<br />
== Writing unit files ==<br />
<br />
The syntax of ''systemd'''s [http://www.freedesktop.org/software/systemd/man/systemd.unit.html unit files] is inspired by XDG Desktop Entry Specification ''.desktop'' files, which are in turn inspired by Microsoft Windows ''.ini'' files. Unit files are loaded from two locations. From lowest to highest precedence they are:<br />
<br />
* {{ic|/usr/lib/systemd/system/}}: units provided by installed packages<br />
* {{ic|/etc/systemd/system/}}: units installed by the system administrator<br />
<br />
{{Note|<br />
* The load paths are completely different when running ''systemd'' in [[systemd/User#How it works|user mode]].<br />
* systemd unit names may only contain ASCII alphanumeric characters, underscores and periods. All other characters must be replaced by C-style "\x2d" escapes, or employ their pre defined semantics ('@', '-'). See {{man|5|systemd.unit}} and {{man|1|systemd-escape}} for more information.}}<br />
<br />
Look at the units installed by your packages for examples, as well as the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Examples annotated example section] of {{man|5|systemd.service}}.<br />
<br />
{{Tip|Comments prepended with {{ic|#}} may be used in unit-files as well, but only in new lines. Do not use end-line comments after ''systemd'' parameters or the unit will fail to activate.}}<br />
<br />
=== Handling dependencies ===<br />
<br />
With ''systemd'', dependencies can be resolved by designing the unit files correctly. The most typical case is that the unit ''A'' requires the unit ''B'' to be running before ''A'' is started. In that case add {{ic|1=Requires=''B''}} and {{ic|1=After=''B''}} to the {{ic|[Unit]}} section of ''A''. If the dependency is optional, add {{ic|1=Wants=''B''}} and {{ic|1=After=''B''}} instead. Note that {{ic|1=Wants=}} and {{ic|1=Requires=}} do not imply {{ic|1=After=}}, meaning that if {{ic|1=After=}} is not specified, the two units will be started in parallel.<br />
<br />
Dependencies are typically placed on services and not on [[#Targets]]. For example, {{ic|network.target}} is pulled in by whatever service configures your network interfaces, therefore ordering your custom unit after it is sufficient since {{ic|network.target}} is started anyway.<br />
<br />
=== Service types ===<br />
<br />
There are several different start-up types to consider when writing a custom service file. This is set with the {{ic|1=Type=}} parameter in the {{ic|[Service]}} section:<br />
<br />
* {{ic|1=Type=simple}} (default): ''systemd'' considers the service to be started up immediately. The process must not fork. Do not use this type if other services need to be ordered on this service, unless it is socket activated.<br />
* {{ic|1=Type=forking}}: ''systemd'' considers the service started up once the process forks and the parent has exited. For classic daemons use this type unless you know that it is not necessary. You should specify {{ic|1=PIDFile=}} as well so ''systemd'' can keep track of the main process.<br />
* {{ic|1=Type=oneshot}}: this is useful for scripts that do a single job and then exit. You may want to set {{ic|1=RemainAfterExit=yes}} as well so that ''systemd'' still considers the service as active after the process has exited.<br />
* {{ic|1=Type=notify}}: identical to {{ic|1=Type=simple}}, but with the stipulation that the daemon will send a signal to ''systemd'' when it is ready. The reference implementation for this notification is provided by ''libsystemd-daemon.so''.<br />
* {{ic|1=Type=dbus}}: the service is considered ready when the specified {{ic|BusName}} appears on DBus's system bus.<br />
* {{ic|1=Type=idle}}: ''systemd'' will delay execution of the service binary until all jobs are dispatched. Other than that behavior is very similar to {{ic|1=Type=simple}}. <br />
<br />
See the [http://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= systemd.service(5)] man page for a more detailed explanation of the {{ic|Type}} values.<br />
<br />
=== Editing provided units ===<br />
<br />
To avoid conflicts with pacman, unit files provided by packages should not be directly edited. There are two safe ways to modify a unit without touching the original file: create a new unit file which overrides the original unit or create drop-in snippets which are applied on top of the original unit. For both methods, you must reload the unit afterwards to apply your changes. This can be done either by editing the unit with {{ic|systemctl edit}} (which reloads the unit automatically) or by reloading all units with:<br />
<br />
# systemctl daemon-reload<br />
<br />
{{Tip|<br />
* You can use ''systemd-delta'' to see which unit files have been overridden or extended and what exactly has been changed.<br />
* Use {{ic|systemctl cat ''unit''}} to view the content of a unit file and all associated drop-in snippets.<br />
* The default syntax highlighting for ''systemd'' unit files within [[Vim]] is the same as for [[Wikipedia:Ini_file|INI files]]. However, if you want something more systemd-specific, install {{Pkg|vim-systemd}}.<br />
}}<br />
<br />
==== Replacement unit files ====<br />
<br />
To replace the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the file {{ic|/etc/systemd/system/''unit''}} and reenable the unit to update the symlinks:<br />
<br />
# systemctl reenable ''unit''<br />
<br />
Alternatively, run:<br />
<br />
# systemctl edit --full ''unit''<br />
<br />
This opens {{ic|/etc/systemd/system/''unit''}} in your editor (copying the installed version if it does not exist yet) and automatically reloads it when you finish editing.<br />
<br />
{{Note|Pacman does not update the replacement unit files when the originals are updated, so this method can make system maintenance more difficult. For this reason the next approach is recommended.}}<br />
<br />
==== Drop-in files ====<br />
<br />
To create drop-in files for the unit file {{ic|/usr/lib/systemd/system/''unit''}}, create the directory {{ic|/etc/systemd/system/''unit''.d/}} and place ''.conf'' files there to override or add new options. ''systemd'' will parse these ''.conf'' files and apply them on top of the original unit.<br />
<br />
The easiest way to do this is to run:<br />
<br />
# systemctl edit ''unit''<br />
<br />
This opens the file {{ic|/etc/systemd/system/''unit''.d/override.conf}} in your text editor (creating it if necessary) and automatically reloads the unit when you are done editing.<br />
<br />
==== Revert to vendor version ====<br />
<br />
To revert any changes to a unit made using {{ic|systemctl edit}} do:<br />
<br />
# systemctl revert ''unit''<br />
<br />
==== Examples ====<br />
<br />
For example, if you simply want to add an additional dependency to a unit, you may create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customdependency.conf|2=<br />
[Unit]<br />
Requires=''new dependency''<br />
After=''new dependency''<br />
}}<br />
<br />
As another example, in order to replace the {{ic|ExecStart}} directive for a unit that is not of type {{ic|oneshot}}, create the following file:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/customexec.conf|2=<br />
[Service]<br />
ExecStart=<br />
ExecStart=''new command''<br />
}}<br />
<br />
Note how {{ic|ExecStart}} must be cleared before being re-assigned [https://bugzilla.redhat.com/show_bug.cgi?id=756787#c9]. The same holds for every item that can be specified multiple times, e.g. {{ic|OnCalendar}} for timers.<br />
<br />
One more example to automatically restart a service:<br />
<br />
{{hc|/etc/systemd/system/''unit''.d/restart.conf|2=<br />
[Service]<br />
Restart=always<br />
RestartSec=30<br />
}}<br />
<br />
== Targets ==<br />
<br />
{{Style|Unclear description, copy-pasted content (explicitly mentions "Fedora").|section=Make section "Targets" more clearly}}<br />
<br />
''systemd'' uses ''targets'' which serve a similar purpose as [[wikipedia:Runlevel|runlevels]] but act a little different. Each ''target'' is named instead of numbered and is intended to serve a specific purpose with the possibility of having multiple ones active at the same time. Some ''target''s are implemented by inheriting all of the services of another ''target'' and adding additional services to it. There are ''systemd'' ''target''s that mimic the common SystemVinit runlevels so you can still switch ''target''s using the familiar {{ic|telinit RUNLEVEL}} command.<br />
<br />
=== Get current targets ===<br />
<br />
The following should be used under ''systemd'' instead of running {{ic|runlevel}}:<br />
<br />
$ systemctl list-units --type=target<br />
<br />
=== Create custom target ===<br />
<br />
The runlevels that held a defined meaning under sysvinit (i.e., 0, 1, 3, 5, and 6); have a 1:1 mapping with a specific ''systemd'' ''target''. Unfortunately, there is no good way to do the same for the user-defined runlevels like 2 and 4. If you make use of those it is suggested that you make a new named ''systemd'' ''target'' as {{ic|/etc/systemd/system/''your target''}} that takes one of the existing runlevels as a base (you can look at {{ic|/usr/lib/systemd/system/graphical.target}} as an example), make a directory {{ic|/etc/systemd/system/''your target''.wants}}, and then symlink the additional services from {{ic|/usr/lib/systemd/system/}} that you wish to enable.<br />
<br />
=== Mapping between SysV runlevels and systemd targets ===<br />
<br />
{| class="wikitable"<br />
! SysV Runlevel !! systemd Target !! Notes<br />
|-<br />
| 0 || runlevel0.target, poweroff.target || Halt the system.<br />
|-<br />
| 1, s, single || runlevel1.target, rescue.target || Single user mode.<br />
|-<br />
| 2, 4 || runlevel2.target, runlevel4.target, multi-user.target || User-defined/Site-specific runlevels. By default, identical to 3.<br />
|-<br />
| 3 || runlevel3.target, multi-user.target || Multi-user, non-graphical. Users can usually login via multiple consoles or via the network.<br />
|-<br />
| 5 || runlevel5.target, graphical.target || Multi-user, graphical. Usually has all the services of runlevel 3 plus a graphical login.<br />
|-<br />
| 6 || runlevel6.target, reboot.target || Reboot<br />
|-<br />
| emergency || emergency.target || Emergency shell<br />
|-<br />
|}<br />
<br />
=== Change current target ===<br />
<br />
In ''systemd'' targets are exposed via ''target units''. You can change them like this:<br />
<br />
# systemctl isolate graphical.target<br />
<br />
This will only change the current target, and has no effect on the next boot. This is equivalent to commands such as {{ic|telinit 3}} or {{ic|telinit 5}} in Sysvinit.<br />
<br />
=== Change default target to boot into ===<br />
<br />
The standard target is {{ic|default.target}}, which is aliased by default to {{ic|graphical.target}} (which roughly corresponds to the old runlevel 5). To change the default target at boot-time, append one of the following [[kernel parameters]] to your bootloader:<br />
<br />
* {{ic|1=systemd.unit=multi-user.target}} (which roughly corresponds to the old runlevel 3),<br />
* {{ic|1=systemd.unit=rescue.target}} (which roughly corresponds to the old runlevel 1).<br />
<br />
Alternatively, you may leave the bootloader alone and change {{ic|default.target}}. This can be done using ''systemctl'':<br />
<br />
# systemctl set-default multi-user.target<br />
<br />
To be able to override the previously set {{ic|default.target}}, use the force option:<br />
<br />
# systemctl set-default -f multi-user.target<br />
<br />
The effect of this command is output by ''systemctl''; a symlink to the new default target is made at {{ic|/etc/systemd/system/default.target}}.<br />
<br />
== Temporary files ==<br />
<br />
"''systemd-tmpfiles'' creates, deletes and cleans up volatile and temporary files and directories." It reads configuration files in {{ic|/etc/tmpfiles.d/}} and {{ic|/usr/lib/tmpfiles.d/}} to discover which actions to perform. Configuration files in the former directory take precedence over those in the latter directory.<br />
<br />
Configuration files are usually provided together with service files, and they are named in the style of {{ic|/usr/lib/tmpfiles.d/''program''.conf}}. For example, the [[Samba]] daemon expects the directory {{ic|/run/samba}} to exist and to have the correct permissions. Therefore, the {{Pkg|samba}} package ships with this configuration:<br />
<br />
{{hc|/usr/lib/tmpfiles.d/samba.conf|<br />
D /run/samba 0755 root root}}<br />
<br />
Configuration files may also be used to write values into certain files on boot. For example, if you used {{ic|/etc/rc.local}} to disable wakeup from USB devices with {{ic|echo USBE > /proc/acpi/wakeup}}, you may use the following tmpfile instead:<br />
<br />
{{hc|/etc/tmpfiles.d/disable-usb-wake.conf|<br />
w /proc/acpi/wakeup - - - - USBE}}<br />
<br />
See the {{man|8|systemd-tmpfiles}} and {{man|5|tmpfiles.d}} man pages for details.<br />
<br />
{{Note|This method may not work to set options in {{ic|/sys}} since the ''systemd-tmpfiles-setup'' service may run before the appropriate device modules is loaded. In this case you could check whether the module has a parameter for the option you want to set with {{ic|modinfo ''module''}} and set this option with a [[Kernel modules#Setting module options|config file in /etc/modprobe.d]]. Otherwise you will have to write a [[Udev#About_udev_rules|udev rule]] to set the appropriate attribute as soon as the device appears.}}<br />
<br />
== Timers ==<br />
<br />
A timer is a unit configuration file whose name ends with ''.timer'' and encodes information about a timer controlled and supervised by ''systemd'', for timer-based activation. See [[systemd/Timers]].<br />
<br />
{{Note|Timers can replace [[cron]] functionality to a great extent. See [[systemd/Timers#As a cron replacement]].}}<br />
<br />
== Mounting ==<br />
<br />
Since systemd is a replacement for System V init, it is in charge of the mounts specified in {{ic|/etc/fstab}}. In fact, it goes beyond the usual {{ic|fstab}} capabilities, implementing special mount options prefixed with {{ic|x-systemd.}}. See [[Fstab#Automount with systemd]] for an example of ''automounting'' (mounting on-demand) using these extensions. See [https://www.freedesktop.org/software/systemd/man/systemd.mount.html#fstab] for the complete documentation of these extensions.<br />
<br />
== Journal ==<br />
<br />
''systemd'' has its own logging system called the journal; therefore, running a {{ic|syslog}} daemon is no longer required. To read the log, use:<br />
<br />
# journalctl<br />
<br />
In Arch Linux, the directory {{ic|/var/log/journal/}} is a part of the {{Pkg|systemd}} package, and the journal (when {{ic|1=Storage=}} is set to {{ic|auto}} in {{ic|/etc/systemd/journald.conf}}) will write to {{ic|/var/log/journal/}}. If you or some program delete that directory, ''systemd'' will '''not''' recreate it automatically and instead will write its logs to {{ic|/run/systemd/journal}} in a nonpersistent way. However, the folder will be recreated when you set {{ic|1=Storage=persistent}} and run {{ic|systemctl restart systemd-journald}} (or reboot).<br />
<br />
Systemd journal classifies messages by [[#Priority level|Priority level]] and [[#Facility|Facility]]. Logging classification corresponds to classic [[wikipedia:Syslog|Syslog]] protocol ([https://tools.ietf.org/html/rfc5424 RFC 5424]).<br />
<br />
===Priority level===<br />
<br />
A syslog severity code (in systemd called priority) is used to mark the importance of a message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
|-<br />
! Value !! Severity !! Keyword !! Description || Examples<br />
|-<br />
| 0 || Emergency || emerg || System is unusable || Severe Kernel BUG, systemd dumped core.<br>This level should not be used by applications.<br />
|-<br />
| 1 || Alert || alert || Should be corrected immediately || Vital subsystem goes out of work. Data loss. <br>{{ic|kernel: BUG: unable to handle kernel paging request at ffffc90403238ffc|}}.<br />
|-<br />
| 2 || Critical || crit || Critical conditions || Crashes, coredumps. Like familiar flash:<br>{{ic|systemd-coredump[25319]: Process 25310 (plugin-containe) of user 1000 dumped core}}<br>Failure in the system primary application, like X11. <br />
|-<br />
| 3 || Error || err || Error conditions || Not severe error reported:<br>{{ic|kernel: usb 1-3: 3:1: cannot get freq at ep 0x84}},<br>{{ic|systemd[1]: Failed unmounting /var.}},<br>{{ic|libvirtd[1720]: internal error: Failed to initialize a valid firewall backend}}).<br />
|-<br />
| 4 || Warning || warning || May indicate that an error will occur if action is not taken. || A non-root file system has only 1GB free.<br>{{ic|org.freedesktop. Notifications[1860]: (process:5999): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale}}.<br />
|-<br />
| 5 || Notice || notice || Events that are unusual, but not error conditions. || {{ic|systemd[1]: var.mount: Directory /var to mount over is not empty, mounting anyway}}. {{ic|gcr-prompter[4997]: Gtk: GtkDialog mapped without a transient parent. This is discouraged}}.<br />
|-<br />
| 6 || Informational || info || Normal operational messages that require no action. || {{ic|lvm[585]: 7 logical volume(s) in volume group "archvg" now active}}.<br />
|-<br />
| 7 || Debug || debug || Information useful to developers for debugging the application. || {{ic|kdeinit5[1900]: powerdevil: Scheduling inhibition from ":1.14" "firefox" with cookie 13 and reason "screen"}}.<br />
|}<br />
<br />
If you cannot find a message on the expected priority level, also search a couple of levels above and below: these rules are recommendations, and the developer of the affected application may have a different perception of the issue's importance from yours.<br />
<br />
===Facility===<br />
<br />
A syslog facility code is used to specify the type of program that is logging the message [https://tools.ietf.org/html/rfc5424#section-6.2.1 RFC 5424 Section 6.2.1].<br />
<br />
{| class="wikitable"<br />
! Facility code !! Keyword !! Description !! Info<br />
|-<br />
| 0 || kern || kernel messages<br />
|-<br />
| 1 || user || user-level messages<br />
|-<br />
| 2 || mail || mail system || Archaic POSIX still supported and sometimes used system, for more {{man|1|mail}})<br />
|-<br />
| 3 || daemon || system daemons || All daemons, including systemd and its subsystems<br />
|-<br />
| 4 || auth || security/authorization messages || Also watch for different facility 10<br />
|-<br />
| 5 || syslog || messages generated internally by syslogd || As it standartized for syslogd, not used by systemd (see facility 3)<br />
|-<br />
| 6 || lpr || line printer subsystem (archaic subsystem)<br />
|-<br />
| 7 || news || network news subsystem (archaic subsystem)<br />
|-<br />
| 8 || uucp || UUCP subsystem (archaic subsystem)<br />
|-<br />
| 9 || || clock daemon || systemd-timesyncd<br />
|-<br />
| 10 || authpriv || security/authorization messages || Also watch for different facility 4<br />
|-<br />
| 11 || ftp || FTP daemon<br />
|-<br />
| 12 || - || NTP subsystem<br />
|-<br />
| 13 || - || log audit<br />
|-<br />
| 14 || - || log alert<br />
|-<br />
| 15 || cron || scheduling daemon<br />
|-<br />
| 16 || local0 || local use 0 (local0)<br />
|-<br />
| 17 || local1 || local use 1 (local1)<br />
|-<br />
| 18 || local2 || local use 2 (local2)<br />
|-<br />
| 19 || local3 || local use 3 (local3)<br />
|-<br />
| 20 || local4 || local use 4 (local4)<br />
|-<br />
| 21 || local5 || local use 5 (local5)<br />
|-<br />
| 22 || local6 || local use 6 (local6)<br />
|-<br />
| 23 || local7 || local use 7 (local7)<br />
|}<br />
<br />
So, useful facilities to watch: 0,1,3,4,9,10,15.<br />
<br />
=== Filtering output ===<br />
<br />
''journalctl'' allows you to filter the output by specific fields. Be aware that if there are many messages to display or filtering of large time span has to be done, the output of this command can be delayed for quite some time.<br />
<br />
{{Tip|While the journal is stored in a binary format, the content of stored messages is not modified. This means it is viewable with ''strings'', for example for recovery in an environment which does not have ''systemd'' installed. Example command:<br />
{{bc|$ strings /mnt/arch/var/log/journal/af4967d77fba44c6b093d0e9862f6ddd/system.journal <nowiki>| grep -i</nowiki> ''message''}}<br />
}}<br />
<br />
Examples:<br />
<br />
* Show all messages from this boot: {{bc|# journalctl -b}} However, often one is interested in messages not from the current, but from the previous boot (e.g. if an unrecoverable system crash happened). This is possible through optional offset parameter of the {{ic|-b}} flag: {{ic|journalctl -b -0}} shows messages from the current boot, {{ic|journalctl -b -1}} from the previous boot, {{ic|journalctl -b -2}} from the second previous and so on. See {{man|1|journalctl}} for full description, the semantics is much more powerful.<br />
* Show all messages from date (and optional time): {{bc|1=# journalctl --since="2012-10-30 18:17:16"}}<br />
* Show all messages since 20 minutes ago: {{bc|1=# journalctl --since "20 min ago"}}<br />
* Follow new messages: {{bc|# journalctl -f}}<br />
* Show all messages by a specific executable: {{bc|# journalctl /usr/lib/systemd/systemd}}<br />
* Show all messages by a specific process: {{bc|1=# journalctl _PID=1}}<br />
* Show all messages by a specific unit: {{bc|# journalctl -u netcfg}}<br />
* Show kernel ring buffer: {{bc|1=# journalctl -k}}<br />
* Show only error, critical, and alert priority messages {{bc|# journalctl -p err..alert}} Numbers also can be used, {{ic|journalctl -p 3..1}}. If single number/keyword used, {{ic|journalctl -p 3}} - all higher priority levels also included.<br />
* Show auth.log equivalent by filtering on syslog facility: {{bc|1=# journalctl SYSLOG_FACILITY=10}}<br />
<br />
See {{man|1|journalctl}}, {{man|7|systemd.journal-fields}}, or Lennart's [http://0pointer.de/blog/projects/journalctl.html blog post] for details.<br />
<br />
{{Tip|1=<br />
By default, ''journalctl'' truncates lines longer than screen width, but in some cases, it may be better to enable wrapping instead of truncating. This can be controlled by the {{ic|SYSTEMD_LESS}} [[environment variable]], which contains options passed to [[Core utilities#less|less]] (the default pager) and defaults to {{ic|FRSXMK}} (see {{man|1|less}} and {{man|1|journalctl}} for details).<br />
<br />
By omitting the {{ic|S}} option, the output will be wrapped instead of truncated. For example, start ''journalctl'' as follows:<br />
<br />
$ SYSTEMD_LESS=FRXMK journalctl<br />
<br />
If you would like to set this behaviour as default, [[Environment variables#Per_user|export]] the variable from {{ic|~/.bashrc}} or {{ic|~/.zshrc}}.<br />
}}<br />
<br />
=== Journal size limit ===<br />
<br />
If the journal is persistent (non-volatile), its size limit is set to a default value of 10% of the size of the underlying file system but capped to 4 GiB. For example, with {{ic|/var/log/journal/}} located on a 20 GiB partition, journal data may take up to 2 GiB. On a 50 GiB partition, it would max at 4 GiB.<br />
<br />
The maximum size of the persistent journal can be controlled by uncommenting and changing the following:<br />
<br />
{{hc|/etc/systemd/journald.conf|2=<br />
SystemMaxUse=50M<br />
}}<br />
<br />
It is also possible to use the drop-in snippets configuration override mechanism rather than editing the global configuration file. In this case do not forget to place the overrides under the {{ic|[Journal]}} header:<br />
<br />
{{hc|/etc/systemd/journald.conf.d/00-journal-size.conf|2=<br />
[Journal]<br />
SystemMaxUse=50M<br />
}}<br />
<br />
See {{man|5|journald.conf}} for more info.<br />
<br />
=== Clean journal files manually ===<br />
<br />
Journal files can be globally removed from {{ic|/var/log/journal/}} using ''e.g.'' {{ic|rm}}, or can be trimmed according to various criteria using {{ic|journalctl}}. Examples:<br />
<br />
* Remove archived journal files until the disk space they use falls below 100M: {{bc|1=# journalctl --vacuum-size=100M}}<br />
* Make all journal files contain no data older than 2 weeks. {{bc|1=# journalctl --vacuum-time=2weeks}}<br />
<br />
See {{man|1|journalctl}} for more info.<br />
<br />
=== Journald in conjunction with syslog ===<br />
<br />
Compatibility with a classic, non-journald aware [[Syslog-ng|syslog]] implementation can be provided by letting ''systemd'' forward all messages via the socket {{ic|/run/systemd/journal/syslog}}. To make the syslog daemon work with the journal, it has to bind to this socket instead of {{ic|/dev/log}} ([http://lwn.net/Articles/474968/ official announcement]). <br />
<br />
The default {{ic|journald.conf}} for forwarding to the socket is {{ic|1=ForwardToSyslog=no}} to avoid system overhead, because [[rsyslog]] or [[syslog-ng]] pull the messages from the journal by [http://lists.freedesktop.org/archives/systemd-devel/2014-August/022295.html#journald itself]. <br />
<br />
See [[Syslog-ng#Overview]] and [[Syslog-ng#syslog-ng and systemd journal]], or [[rsyslog]] respectively, for details on configuration.<br />
<br />
=== Forward journald to /dev/tty12 ===<br />
<br />
Create a [[#Editing provided units|drop-in directory]] {{ic|/etc/systemd/journald.conf.d}} and create a {{ic|fw-tty12.conf}} file in it:<br />
<br />
{{hc|1=/etc/systemd/journald.conf.d/fw-tty12.conf|2=<br />
[Journal]<br />
ForwardToConsole=yes<br />
TTYPath=/dev/tty12<br />
MaxLevelConsole=info<br />
}}<br />
<br />
Then [[restart]] systemd-journald.<br />
<br />
=== Specify a different journal to view ===<br />
There may be a need to check the logs of another system that is dead in the water, like booting from a live system to recover a production system. In such case, one can mount the disk in e.g. {{ic|/mnt}}, and specify the journal path via {{ic|-D}}/{{ic|--directory}}, like so:<br />
<br />
$ journalctl -D ''/mnt''/var/log/journal -xe<br />
<br />
== Tips and tricks ==<br />
<br />
=== Enable installed units by default ===<br />
<br />
{{Expansion|How does it work with instantiated units?}}<br />
<br />
Arch Linux ships with {{ic|/usr/lib/systemd/system-preset/99-default.preset}} containing {{ic|disable *}}. This causes ''systemctl preset'' to disable all units by default, such that when a new package is installed, the user must manually enable the unit.<br />
<br />
If this behavior is not desired, simply create a symlink from {{ic|/etc/systemd/system-preset/99-default.preset}} to {{ic|/dev/null}} in order to override the configuration file. This will cause ''systemctl preset'' to enable all units that get installed—regardless of unit type—unless specified in another file in one ''systemctl preset'''s configuration directories. User units are not affected. See the manpage for {{ic|systemd.preset}} for more information.<br />
<br />
{{Note|Enabling all units by default may cause problems with packages that contain two or more mutually exclusive units. ''systemctl preset'' is designed to be used by distributions and spins or system administrators. In the case where two conflicting units would be enabled, you should explicitly specify which one is to be disabled in a preset configuration file as specified in the manpage for {{ic|systemd.preset}}.}}<br />
<br />
=== Sandboxing application environments ===<br />
A unit file can be created as a sandbox to isolate applications and their processes within a hardened virtual environment. systemd leverages [[wikipedia:Linux_namespaces|namespaces]], white-/blacklisting of [[Capabilities]], and [[control groups]] to container processes through an extensive [https://www.freedesktop.org/software/systemd/man/systemd.exec.html execution environment configuration].<br />
<br />
The enhancement of an existing systemd unit file with application sandboxing typically requires trial-and-error tests accompanied by the generous use of {{Pkg|strace}}, [[wikipedia:Standard_streams#Standard_error_.28stderr.29|stderr]] and [https://www.freedesktop.org/software/systemd/man/journalctl.html journalctl] error logging and output facilities. You may want to first search upstream documentation for already done tests to base trials on.<br />
<br />
Some examples on how sandboxing with systemd can be deployed:<br />
* {{Ic|CapabilityBoundingSet}} defines a whitelisted set of allowed capabilities, but may also be used to blacklist a specific capability for a unit.<br />
** The {{Ic|CAP_SYS_ADM}} capability, for example, which should be one of the [https://lwn.net/Articles/486306/ goals of a secure sandbox]: {{ic|1=CapabilityBoundingSet=~ CAP_SYS_ADM}}<br />
* [[Unbound#Sandboxing]]{{Broken section link}} shows a full-scale example of systemd features for sandboxing.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Investigating systemd errors ===<br />
<br />
As an example, we will investigate an error with {{ic|systemd-modules-load}} service:<br />
<br />
'''1.''' Lets find the ''systemd'' services which fail to start at boot time:<br />
<br />
{{hc|1=$ systemctl --state=failed|2=<br />
systemd-modules-load.service loaded '''failed failed''' Load Kernel Modules}}<br />
<br />
Another way is to live log ''systemd'' messages:<br />
<br />
$ journalctl -fp err<br />
<br />
'''2.''' Ok, we found a problem with {{ic|systemd-modules-load}} service. We want to know more:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''failed''' (Result: exit-code) since So 2013-08-25 11:48:13 CEST; 32s ago<br />
Docs: man:systemd-modules-load.service(8).<br />
man:modules-load.d(5)<br />
Process: '''15630''' ExecStart=/usr/lib/systemd/systemd-modules-load ('''code=exited, status=1/FAILURE''')<br />
}}<br />
If the {{ic|Process ID}} is not listed, just restart the failed service with {{ic|systemctl restart systemd-modules-load}}<br />
<br />
'''3.''' Now we have the process id (PID) to investigate this error in depth. Enter the following command with the current {{ic|Process ID}} (here: 15630):<br />
{{hc|1=$ journalctl _PID=15630|2=<br />
-- Logs begin at Sa 2013-05-25 10:31:12 CEST, end at So 2013-08-25 11:51:17 CEST. --<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'blacklist usblp''''<br />
Aug 25 11:48:13 mypc systemd-modules-load[15630]: '''Failed to find module 'install usblp /bin/false'''' <br />
}}<br />
<br />
'''4.''' We see that some of the kernel module configs have wrong settings. Therefore we have a look at these settings in {{ic|/etc/modules-load.d/}}:<br />
{{hc|$ ls -Al /etc/modules-load.d/|<br />
...<br />
-rw-r--r-- 1 root root 79 1. Dez 2012 blacklist.conf<br />
-rw-r--r-- 1 root root 1 2. Mär 14:30 encrypt.conf<br />
-rw-r--r-- 1 root root 3 5. Dez 2012 printing.conf<br />
-rw-r--r-- 1 root root 6 14. Jul 11:01 realtek.conf<br />
-rw-r--r-- 1 root root 65 2. Jun 23:01 virtualbox.conf<br />
...<br />
}}<br />
<br />
'''5.''' The {{ic|Failed to find module 'blacklist usblp'}} error message might be related to a wrong setting inside of {{ic|blacklist.conf}}. Lets deactivate it with inserting a trailing '''#''' before each option we found via step 3:<br />
{{hc|/etc/modules-load.d/blacklist.conf|<br />
'''#''' blacklist usblp<br />
'''#''' install usblp /bin/false<br />
}}<br />
<br />
'''6.''' Now, try to start {{ic|systemd-modules-load}}:<br />
$ systemctl start systemd-modules-load<br />
If it was successful, this should not prompt anything. If you see any error, go back to step 3 and use the new PID for solving the errors left.<br />
<br />
If everything is ok, you can verify that the service was started successfully with:<br />
{{hc|$ systemctl status systemd-modules-load|2=<br />
systemd-modules-load.service - Load Kernel Modules<br />
Loaded: '''loaded''' (/usr/lib/systemd/system/systemd-modules-load.service; static)<br />
Active: '''active (exited)''' since So 2013-08-25 12:22:31 CEST; 34s ago<br />
Docs: man:systemd-modules-load.service(8)<br />
man:modules-load.d(5)<br />
Process: 19005 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)<br />
Aug 25 12:22:31 mypc systemd[1]: '''Started Load Kernel Modules'''.<br />
}}<br />
<br />
=== Diagnosing boot problems ===<br />
<br />
''systemd'' has several options for diagnosing problems with the boot process. See [[boot debugging]] for more general instructions and options to capture boot messages before ''systemd'' takes over the [[boot process]]. Also see the [http://freedesktop.org/wiki/Software/systemd/Debugging/ systemd debugging documentation].<br />
<br />
=== Diagnosing problems with a specific service ===<br />
<br />
{{Accuracy|This may not catch all errors such as missing libraries.|User talk:Alucryd#Plex}}<br />
<br />
If some ''systemd'' service misbehaves and you want to get more information about what is going on, set the {{ic|SYSTEMD_LOG_LEVEL}} [[environment variable]] to {{ic|debug}}. For example, to run the ''systemd-networkd'' daemon in debug mode:<br />
<br />
# systemctl stop systemd-networkd<br />
# SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd<br />
<br />
Or, equivalently, modify the service file temporarily for gathering enough output. For example: <br />
<br />
{{hc|/usr/lib/systemd/system/systemd-networkd.service|2=<br />
[Service]<br />
...<br />
Environment=SYSTEMD_LOG_LEVEL=debug<br />
....<br />
}}<br />
<br />
If debug information is required long-term, add the variable the [[#Editing provided units|regular]] way.<br />
<br />
=== Shutdown/reboot takes terribly long ===<br />
<br />
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. ''systemd'' waits some time for each service to exit before trying to kill it. To find out if you are affected, see [http://freedesktop.org/wiki/Software/systemd/Debugging/#shutdowncompleteseventually this article].<br />
<br />
=== Short lived processes do not seem to log any output ===<br />
<br />
If {{ic|journalctl -u foounit}} does not show any output for a short lived service, look at the PID instead. For example, if {{ic|systemd-modules-load.service}} fails, and {{ic|systemctl status systemd-modules-load}} shows that it ran as PID 123, then you might be able to see output in the journal for that PID, i.e. {{ic|journalctl -b _PID&#61;123}}. Metadata fields for the journal such as {{ic|_SYSTEMD_UNIT}} and {{ic|_COMM}} are collected asynchronously and rely on the {{ic|/proc}} directory for the process existing. Fixing this requires fixing the kernel to provide this data via a socket connection, similar to {{ic|SCM_CREDENTIALS}}.<br />
<br />
=== Boot time increasing over time ===<br />
<br />
After using {{ic|systemd-analyze}} a number of users have noticed that their boot time has increased significantly in comparison with what it used to be. After using {{ic|systemd-analyze blame}} [[NetworkManager]] is being reported as taking an unusually large amount of time to start. <br />
<br />
The problem for some users has been due to {{ic|/var/log/journal}} becoming too large. This may have other impacts on performance, such as for {{ic|systemctl status}} or {{ic|journalctl}}. As such the solution is to remove every file within the folder (ideally making a backup of it somewhere, at least temporarily) and then setting a journal file size limit as described in [[#Journal size limit]].<br />
<br />
=== systemd-tmpfiles-setup.service fails to start at boot ===<br />
<br />
Starting with systemd 219, {{ic|/usr/lib/tmpfiles.d/systemd.conf}} specifies ACL attributes for directories under {{ic|/var/log/journal}} and, therefore, requires ACL support to be enabled for the filesystem the journal resides on.<br />
<br />
See [[Access Control Lists#Enabling ACL]] for instructions on how to enable ACL on the filesystem that houses {{ic|/var/log/journal}}.<br />
<br />
=== systemctl enable fails for symlinks in /etc/systemd/system ===<br />
<br />
If {{ic|/etc/systemd/system/''foo''.service}} is a symlink and {{ic|systemctl enable ''foo''.service}} is run, it will fail with this error:<br />
<br />
Failed to issue method call: No such file or directory<br />
<br />
This is a [https://bugzilla.redhat.com/show_bug.cgi?id=955379#c14 design choice] of systemd. As a workaround, enabling by absolute path works:<br />
<br />
# systemctl enable ''/absolute/path/foo''.service<br />
<br />
=== systemd version printed on boot is not the same as installed package version ===<br />
<br />
You need to [[Mkinitcpio#Image_creation_and_activation|regenerate your initramfs]] and the versions should match. <br />
<br />
{{Tip|1=A pacman hook can be used to automatically regenerate the initramfs every time {{pkg|systemd}} is upgraded. See [https://bbs.archlinux.org/viewtopic.php?id=215411 this forum thread] and [[Pacman#Hooks]].}}<br />
<br />
=== Disable emergency mode on remote machine ===<br />
<br />
You may want to disable emergency mode on a remote machine, for example, a virtual machine hosted at Azure or Google Cloud. It is because if emergency mode is triggered, the machine will be blocked from connecting to network.<br />
<br />
# systemctl mask emergency.service<br />
# systemctl mask emergency.target<br />
<br />
== See also ==<br />
<br />
*[[Wikipedia:systemd|Wikipedia article]]<br />
*[http://www.freedesktop.org/wiki/Software/systemd systemd Official web site]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/Optimizations systemd optimizations]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions systemd FAQ]<br />
*[http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks systemd Tips and tricks]<br />
*[http://wiki.gentoo.org/wiki/Systemd Gentoo Wiki systemd page]<br />
*[http://fedoraproject.org/wiki/Systemd Fedora Project - About systemd]<br />
*[http://fedoraproject.org/wiki/How_to_debug_Systemd_problems Fedora Project - How to debug systemd problems]<br />
*[http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet Fedora Project - SysVinit to systemd cheatsheet]<br />
*[[gentoo:Systemd|Gentoo Wiki systemd page]]<br />
*[[debian:systemd|Debian Wiki systemd page]]<br />
*[http://0pointer.de/public/systemd-man/ Manual pages]<br />
*[http://0pointer.de/blog/projects/systemd.html Lennart's blog story], [http://0pointer.de/blog/projects/systemd-update.html update 1], [http://0pointer.de/blog/projects/systemd-update-2.html update 2], [http://0pointer.de/blog/projects/systemd-update-3.html update 3], [http://0pointer.de/blog/projects/why.html summary]<br />
*[http://0pointer.de/public/systemd-ebook-psankar.pdf systemd for Administrators (PDF)]<br />
*[https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units How To Use Systemctl to Manage Systemd Services and Units ]<br />
*[https://dvdhrm.wordpress.com/2013/08/24/session-management-on-linux/ Session management with systemd-logind]<br />
*[[Emacs#Syntax highlighting for systemd Files|Emacs Syntax highlighting for Systemd files]]<br />
*[http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html Two] [http://www.h-online.com/open/features/Booting-up-Tools-and-tips-for-systemd-1570630.html part] introductory article in ''The H Open'' magazine.</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=CPU_frequency_scaling&diff=501686CPU frequency scaling2017-12-11T17:55:16Z<p>GenkiSky: /* Scaling governors */ Remove unnecessary tee</p>
<hr />
<div>[[Category:Power management]]<br />
[[Category:CPU]]<br />
[[ar:CPU frequency scaling]]<br />
[[cs:CPU frequency scaling]]<br />
[[de:Cpufrequtils]]<br />
[[el:CPU frequency scaling]]<br />
[[es:CPU frequency scaling]]<br />
[[fr:Cpufreq]]<br />
[[it:CPU frequency scaling]]<br />
[[ja:CPU 周波数スケーリング]]<br />
[[pt:CPU frequency scaling]]<br />
[[ru:CPU frequency scaling]]<br />
[[sk:CPU frequency scaling]]<br />
[[tr:Işlemci frekansını ölçekleme]]<br />
[[zh-hans:CPU frequency scaling]]<br />
{{Related articles start}}<br />
{{Related|Power saving}}<br />
{{Related|Laptop Mode Tools}}<br />
{{Related|pm-utils}}<br />
{{Related|PHC}}<br />
{{Related articles end}}<br />
<br />
CPU frequency scaling enables the operating system to scale the CPU frequency up or down in order to save power. CPU frequencies can be scaled automatically depending on the system load, in response to ACPI events, or manually by userspace programs.<br />
<br />
CPU frequency scaling is implemented in the Linux kernel, the infrastructure is called ''cpufreq''. Since kernel 3.4 the necessary modules are loaded automatically and the recommended [[#Scaling governors|ondemand governor]] is enabled by default. However, userspace tools like [[#cpupower|cpupower]], [[acpid]], [[Laptop Mode Tools]], or GUI tools provided for your desktop environment, may still be used for advanced configuration.<br />
<br />
== Userspace tools ==<br />
<br />
=== thermald ===<br />
<br />
{{Pkg|thermald}} is a Linux daemon used to prevent the overheating of platforms. This daemon monitors temperature and applies compensation using available cooling methods.<br />
<br />
By default, it monitors CPU temperature using available CPU digital temperature sensors and maintains CPU temperature under control, before HW takes aggressive correction action. If there is a skin temperature sensor in thermal sysfs, then it tries to keep skin temperature under 45C.<br />
<br />
=== i7z ===<br />
{{Pkg|i7z}} is an i7 (and now i3, i5) CPU reporting tool for Linux. It can be launched from a Terminal with the command {{ic|i7z}} or as GUI with {{ic|i7z-gui}}.<br />
<br />
=== cpupower ===<br />
<br />
{{Pkg|cpupower}} is a set of userspace utilities designed to assist with CPU frequency scaling. The package is not required to use scaling, but is highly recommended because it provides useful command-line utilities and a [[systemd]] service to change the governor at boot.<br />
<br />
The configuration file for ''cpupower'' is located in {{ic|/etc/default/cpupower}}. This configuration file is read by a bash script in {{ic|/usr/lib/systemd/scripts/cpupower}} which is activated by ''systemd'' with {{ic|cpupower.service}}. You may want to enable {{ic|cpupower.service}} to start at boot.<br />
<br />
== CPU frequency driver ==<br />
<br />
{{Note|<br />
* The native CPU module is loaded automatically.<br />
* The {{ic|pstate}} power scaling driver is used automatically for modern Intel CPUs instead of the other drivers below. This driver takes priority over other drivers and is built-in as opposed to being a module. This driver is currently automatically used for Sandy Bridge and newer CPUs. If you encounter a problem while using this driver, add {{ic|intel_pstate&#61;disable}} to your kernel line. You can use the same user space utilities with this driver, '''but cannot control it'''.<br />
* Even P State behavior mentioned above can be influenced with {{ic|/sys/devices/system/cpu/intel_pstate}}, e.g. Intel Turbo Boost can be deactivated with {{ic|# echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo}} for keeping CPU-Temperatures low.<br />
* Additional control for modern Intel CPUs is available with the [https://01.org/linux-thermal-daemon Linux Thermal Daemon] (available as {{Pkg|thermald}}), which proactively controls thermal using P-states, T-states, and the Intel power clamp driver. thermald can also be used for older Intel CPUs. If the latest drivers are not available, then the daemon will revert to x86 model specific registers and the Linux ‘cpufreq subsystem’ to control system cooling.<br />
}}<br />
<br />
''cpupower'' requires modules to know the limits of the native CPU:<br />
<br />
{| class="wikitable sortable"<br />
!Module!!Description<br />
|-<br />
| intel_pstate || This driver implements a scaling driver with an internal governor for Intel Core (Sandy Bridge and newer) processors.<br />
|-<br />
| acpi-cpufreq || CPUFreq driver which utilizes the ACPI Processor Performance States. This driver also supports the Intel Enhanced SpeedStep (previously supported by the deprecated speedstep-centrino module).<br />
|-<br />
| speedstep-lib || CPUFreq driver for Intel SpeedStep-enabled processors (mostly Atoms and older Pentiums (< 3)) <br />
|-<br />
| powernow-k8 || CPUFreq driver for K8/K10 Athlon 64/Opteron/Phenom processors. Since Linux 3.7 'acpi-cpufreq' will automatically be used for more modern CPUs from this family.<br />
|-<br />
| pcc-cpufreq || This driver supports Processor Clocking Control interface by Hewlett-Packard and Microsoft Corporation which is useful on some ProLiant servers.<br />
|-<br />
| p4-clockmod || CPUFreq driver for Intel Pentium 4/Xeon/Celeron processors which lowers the CPU temperature by skipping clocks. (You probably want to use a SpeedStep driver instead.)<br />
|}<br />
<br />
To see a full list of available modules, run:<br />
<br />
$ ls /usr/lib/modules/$(uname -r)/kernel/drivers/cpufreq/<br />
<br />
Load the appropriate module (see [[Kernel modules]] for details). Once the appropriate cpufreq driver is loaded, detailed information about the CPU(s) can be displayed by running<br />
<br />
$ cpupower frequency-info<br />
<br />
=== Setting maximum and minimum frequencies ===<br />
<br />
In rare cases, it may be necessary to manually set maximum and minimum frequencies.<br />
<br />
To set the maximum clock frequency (''clock_freq'' is a clock frequency with units: GHz, MHz):<br />
<br />
# cpupower frequency-set -u ''clock_freq''<br />
<br />
To set the minimum clock frequency:<br />
<br />
# cpupower frequency-set -d ''clock_freq''<br />
<br />
To set the CPU to run at a specified frequency:<br />
<br />
# cpupower frequency-set -f ''clock_freq''<br />
<br />
{{Note|<br />
* To adjust for only a single CPU core, append {{ic|-c ''core_number''}}.<br />
* The governor, maximum and minimum frequencies can be set in {{ic|/etc/default/cpupower}}.<br />
}}<br />
<br />
== Scaling governors ==<br />
<br />
Governors (see table below) are power schemes for the CPU. Only one may be active at a time. For details, see the [https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt kernel documentation] in the kernel source.<br />
<br />
{| class="wikitable"<br />
! Governor !! Description<br />
|-<br />
| performance || Run the CPU at the maximum frequency.<br />
|-<br />
| powersave || Run the CPU at the minimum frequency.<br />
|-<br />
| userspace || Run the CPU at user specified frequencies.<br />
|-<br />
| ondemand || Scales the frequency dynamically according to current load. Jumps to the highest frequency and then possibly back off as the idle time increases.<br />
|-<br />
| conservative || Scales the frequency dynamically according to current load. Scales the frequency more gradually than ondemand.<br />
|-<br />
| schedutil || Scheduler-driven CPU frequency selection [http://lwn.net/Articles/682391/], [https://lkml.org/lkml/2016/3/17/420].<br />
|}<br />
<br />
Depending on the scaling driver, one of these governors will be loaded by default:<br />
* {{ic|ondemand}} for AMD and older Intel CPU.<br />
* {{ic|powersave}} for Intel CPUs using the {{ic|intel_pstate}} driver (Sandy Bridge and newer).<br />
<br />
{{Note|The {{ic|intel_pstate}} driver supports only the performance and powersave governors, but they both provide dynamic scaling. The performance governor [http://www.phoronix.com/scan.php?page&#61;news_item&px&#61;MTM3NDQ should give better power saving functionality than the old ondemand governor].}}<br />
<br />
{{Warning|Use CPU monitoring tools (for temperatures, voltage, etc.) when changing the default governor.}} <br />
<br />
To activate a particular governor, run:<br />
<br />
# cpupower frequency-set -g ''governor''<br />
<br />
{{Note|<br />
* To adjust for only a single CPU core, append {{ic|-c ''core_number''}} to the command above.<br />
* Activating a governor requires that specific [[kernel module]] (named {{ic|cpufreq_''governor''}}) is loaded. As of kernel 3.4, these modules are loaded automatically.<br />
}}<br />
<br />
Alternatively, you can activate a governor on every available CPU manually:<br />
# echo ''governor'' > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor<br />
<br />
{{Tip|To monitor cpu speed in real time, run:<br />
$ watch grep \"cpu MHz\" /proc/cpuinfo<br />
}}<br />
<br />
=== Tuning the ondemand governor ===<br />
<br />
See the [https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt kernel documentation] for details.<br />
<br />
==== Switching threshold ====<br />
<br />
To set the threshold for stepping up to another frequency:<br />
<br />
# echo -n ''percent'' > /sys/devices/system/cpu/cpufreq/<governor>/up_threshold<br />
<br />
To set the threshold for stepping down to another frequency:<br />
<br />
# echo -n ''percent'' > /sys/devices/system/cpu/cpufreq/<governor>/down_threshold<br />
<br />
==== Sampling rate ====<br />
<br />
The sampling rate determines how frequently the governor checks to tune the CPU. {{ic|sampling_down_factor}} is a tunable that multiplies the sampling rate when the CPU is at its highest clock frequency thereby delaying load evaluation and improving performance. Allowed values for {{ic|sampling_down_factor}} are 1 to 100000. This tunable has no effect on behavior at lower CPU frequencies/loads.<br />
<br />
To read the value (default = 1), run:<br />
<br />
$ cat /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
<br />
To set the value, run:<br />
<br />
# echo -n ''value'' > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor<br />
<br />
==== Make changes permanent ====<br />
<br />
To have the desired scaling enabled at boot, [[Kernel_modules#Using_files_in_.2Fetc.2Fmodprobe.d.2F|kernel module options]] and [[systemd#Temporary files]] are regular methods. However, in some cases there might be race conditions, as noted in [[systemd#Temporary files]]. [[udev]] is doing better.<br />
<br />
For example, to set the scaling governor of the CPU core {{ic|0}} to performance while the scaling driver is {{ic|acpi_cpufreq}}, create the following udev rule:<br />
<br />
{{hc|/etc/udev/rules.d/50-scaling-governor.rules|<nowiki><br />
SUBSYSTEM=="module", ACTION=="add", KERNEL=="acpi_cpufreq", RUN+=" /bin/sh -c ' echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor ' "<br />
</nowiki>}}<br />
<br />
To have the rule already applied in the ''initramfs'', follow the example at [[udev#Debug output]].<br />
<br />
== Interaction with ACPI events ==<br />
<br />
Users may configure scaling governors to switch automatically based on different ACPI events such as connecting the AC adapter or closing a laptop lid. A quick example is given below, however it may be worth reading full article on [[acpid]].<br />
<br />
Events are defined in {{ic|/etc/acpi/handler.sh}}. If the {{Pkg|acpid}} package is installed, the file should already exist and be executable. For example, to change the scaling governor from {{ic|performance}} to {{ic|conservative}} when the AC adapter is disconnected and change it back if reconnected:<br />
<br />
{{hc|/etc/acpi/handler.sh|<nowiki><br />
[...]<br />
<br />
ac_adapter)<br />
case "$2" in<br />
AC*)<br />
case "$4" in<br />
00000000)<br />
echo "conservative" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor <br />
echo -n $minspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode start<br />
;;<br />
00000001)<br />
echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br />
echo -n $maxspeed >$setspeed<br />
#/etc/laptop-mode/laptop-mode stop<br />
;;<br />
esac<br />
;;<br />
*) logger "ACPI action undefined: $2" ;;<br />
esac<br />
;;<br />
<br />
[...]<br />
</nowiki>}}<br />
<br />
== Privilege granting under GNOME ==<br />
<br />
{{Out of date|See the note below.}}<br />
<br />
{{Note|systemd introduced logind which handles consolekit and policykit actions. The following code below does not work. With logind, simply edit in the file {{ic|/usr/share/polkit-1/actions/org.gnome.cpufreqselector.policy}} the <defaults> elements according to your needs and the polkit manual [http://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html].}}<br />
<br />
[[GNOME]] has a nice applet to change the governor on the fly. To use it without the need to enter the root password, simply create following file:<br />
<br />
{{hc|/var/lib/polkit-1/localauthority/50-local.d/org.gnome.cpufreqselector.pkla|2=<br />
[org.gnome.cpufreqselector]<br />
Identity=unix-user:''user''<br />
Action=org.gnome.cpufreqselector<br />
ResultAny=no<br />
ResultInactive=no<br />
ResultActive=yes<br />
}}<br />
<br />
Where the word ''user'' is replaced with the username of interest.<br />
<br />
The {{AUR|desktop-privileges}} package in the [[AUR]] contains a similar {{ic|.pkla}} file for authorizing all users of the {{ic|power}} [[group]] to change the governor.<br />
<br />
== Troubleshooting ==<br />
<br />
{{Accuracy|Unverifiable and vague statements, lots of "some"s and "maybe"s. Troubleshooting items need to address concrete problems.}}<br />
<br />
* Some applications, like [[ntop]], do not respond well to automatic frequency scaling. In the case of ntop it can result in segmentation faults and lots of lost information as even the {{ic|on-demand}} governor cannot change the frequency quickly enough when a lot of packets suddenly arrive at the monitored network interface that cannot be handled by the current processor speed.<br />
<br />
* Some CPU's may suffer from poor performance with the default settings of the {{ic|on-demand}} governor (e.g. flash videos not playing smoothly or stuttering window animations). Instead of completely disabling frequency scaling to resolve these issues, the aggressiveness of frequency scaling can be increased by lowering the ''up_threshold'' [[sysctl]] variable for each CPU. See [[#Switching_threshold|how to change the on-demand governor's threshold]].<br />
<br />
* Sometimes the on-demand governor may not throttle to the maximum frequency but one step below. This can be solved by setting max_freq value slightly higher than the real maximum. For example, if frequency range of the CPU is from 2.00 GHz to 3.00 GHz, setting max_freq to 3.01 GHz can be a good idea.<br />
<br />
* Some combinations of [[ALSA]] drivers and sound chips may cause audio skipping as the governor changes between frequencies, switching back to a non-changing governor seems to stop the audio skipping.<br />
<br />
=== BIOS frequency limitation ===<br />
<br />
Some CPU/BIOS configurations may have difficulties to scale to the maximum frequency or scale to higher frequencies at all. This is most likely caused by BIOS events telling the OS to limit the frequency resulting in {{ic|/sys/devices/system/cpu/cpu0/cpufreq/bios_limit}} set to a lower value.<br />
<br />
Either you just made a specific Setting in the BIOS Setup Utility, (Frequency, Thermal Management, etc.) you can blame a buggy/outdated BIOS or the BIOS might have a serious reason for throttling the CPU on it's own.<br />
<br />
Reasons like that can be (assuming your machine's a notebook) that the battery is removed (or near death) so you're on AC-power only. In this case a weak AC-source might not supply enough electricity to fulfill extreme peak demands by the overall system and as there is no battery to assist this could lead to data loss, data corruption or in worst case even hardware damage!<br />
<br />
Not all BIOS'es limit the CPU-Frequency in this case, but for example most IBM/Lenovo Thinkpads do. Refer to thinkwiki for more [http://www.thinkwiki.org/wiki/Problem_with_CPU_frequency_scaling thinkpad related info on this topic].<br />
<br />
If you checked there's not just an odd BIOS setting and you know what you're doing you can make the Kernel ignore these BIOS-limitations.<br />
<br />
{{Warning|Make sure you read and understood the section above. CPU frequency limitation is a safety feature of your BIOS and you should not need to work around it.}}<br />
<br />
A special parameter has to be passed to the processor module.<br />
<br />
For trying this temporarily change the value in {{ic|/sys/module/processor/parameters/ignore_ppc}} from {{ic|0}} to {{ic|1}}.<br />
<br />
For setting it permanently [[Kernel modules#Setting module options]] describes alternatives. For example, you can add {{ic|1=processor.ignore_ppc=1}} to your kernel boot line, or create<br />
{{hc|/etc/modprobe.d/ignore_ppc.conf|2=# If the frequency of your machine gets wrongly limited by BIOS, this should help<br />
options processor ignore_ppc=1}}<br />
<br />
== See also ==<br />
<br />
* [https://www.kernel.org/doc/Documentation/cpu-freq/index.txt Linux CPUFreq - kernel documentation]<br />
* [http://www.reddit.com/r/linux/comments/1hdogn/acpi_cpufreq_or_intel_pstates/ Comprehensive explanation of pstate]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=XDG_Base_Directory&diff=501344XDG Base Directory2017-12-08T00:22:14Z<p>GenkiSky: /* Hardcoded */ Add note on --init-file for bash</p>
<hr />
<div>[[Category:Dotfiles]]<br />
[[ja:XDG Base Directory サポート]]<br />
{{Related articles start}}<br />
{{Related|dotfiles}}<br />
{{Related|XDG user directories}}<br />
{{Related articles end}}<br />
This article exists to catalog the growing set of software using the [http://standards.freedesktop.org/basedir-spec/latest/ XDG Base Directory Specification] introduced in 2003. This is here to demonstrate the viability of this specification by listing commonly found dotfiles and their support status. For those not currently supporting the Base Directory Specification, workarounds will be demonstrated to emulate it instead.<br />
<br />
The workarounds will be limited to anything not involving patching the source, executing code stored in [[environment variables]] or compile-time options. The rationale for this is that configurations should be portable across systems and having compile-time options prevent that.<br />
<br />
Hopefully this will provide a source of information about exactly what certain kinds of dotfiles are and where they come from.<br />
<br />
==XDG Base Directory specification==<br />
<br />
Please read the [http://standards.freedesktop.org/basedir-spec/latest/ full specification]. This section will attempt to break down the essence of what it tries to achieve.<br />
<br />
Only {{ic|XDG_RUNTIME_DIR}} is set by default through [http://www.freedesktop.org/software/systemd/man/pam_systemd.html pam_systemd]. It is up to the user to explicitly [[define]] the other variables, using absolute paths that point to existing directories.<br />
<br />
===User directories===<br />
<br />
* {{ic|XDG_CONFIG_HOME}}<br />
** Where user-specific configurations should be written (analogous to {{ic|/etc}}).<br />
** Should default to {{ic|$HOME/.config}}.<br />
<br />
* {{ic|XDG_CACHE_HOME}}<br />
** Where user-specific non-essential (cached) data should be written (analogous to {{ic|/var/cache}}).<br />
** Should default to {{ic|$HOME/.cache}}.<br />
<br />
* {{ic|XDG_DATA_HOME}}<br />
** Where user-specific data files should be written (analogous to {{ic|/usr/share}}).<br />
** Should default to {{ic|$HOME/.local/share}}.<br />
<br />
* {{ic|XDG_RUNTIME_DIR}}<br />
** Used for non-essential, user-specific data files such as sockets, named pipes, etc.<br />
** Not required to have a default value; warnings should be issued if not set or equivalents provided.<br />
** Must be owned by the user with an access mode of {{ic|0700}}.<br />
** Filesystem fully featured by standards of OS.<br />
** Must be on the local filesystem.<br />
** May be subject to periodic cleanup.<br />
** Modified every 6 hours or set sticky bit if persistence is desired.<br />
** Can only exist for the duration of the user's login.<br />
** Should not store large files as it may be mounted as a tmpfs.<br />
<br />
===System directories===<br />
<br />
* {{ic|XDG_DATA_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/usr/local/share:/usr/share}}.<br />
<br />
* {{ic|XDG_CONFIG_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/etc/xdg}}.<br />
<br />
==Contributing==<br />
<br />
When contributing make sure to use the correct section.<br />
<br />
Nothing should require code evaluation (such as [[vim]] and {{ic|VIMINIT}}), patches or compile-time options to gain support and anything which does must be deemed hardcoded. Additionally if the process is too error prone or difficult, such as [https://www.haskell.org/cabal/ Haskell's cabal] or eclipse, they should also be considered as hardcoded.<br />
<br />
* The first column should be the project name, ideally the command name if it is not ambigious, linked to their website or an appropriate internal wiki article.<br />
<br />
* The second column is for any legacy files and directories the project had (one per line), this is done so people can find them even if they are no longer read.<br />
<br />
* In the third, try to find the commit or version a project switched to XDG Base Directory or any open discussions and include them in the next two columns (two per line).<br />
<br />
* The last column should include any appropriate workarounds or solutions. Please verify that your solution is correct and functional.<br />
<br />
==Supported==<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| [https://github.com/SirCmpwn/aerc aerc]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [https://github.com/Antimicro/antimicro/ antimicro]<br />
| {{ic|~/.antimicro}}<br />
| [https://github.com/Antimicro/antimicro/commit/edba864 edba864]<br />
| [https://github.com/Antimicro/antimicro/issues/5]<br />
|<br />
|-<br />
| [[aria2]]<br />
| {{ic|~/.aria2}}<br />
| [https://github.com/tatsuhiro-t/aria2/commit/8bc1d37 8bc1d37]<br />
| [https://github.com/tatsuhiro-t/aria2/issues/27]<br />
|<br />
|-<br />
| [[blender]]<br />
| {{ic|~/.blender}}<br />
| [http://git.blender.org/gitweb/gitweb.cgi/blender.git/commit/4293f473 4293f473]<br />
| [https://developer.blender.org/T28943]<br />
|<br />
|-<br />
| [https://github.com/falconindy/burp burp]<br />
|<br />
| [https://github.com/falconindy/burp/commit/f2388e9 f2388e9]<br />
|<br />
|<br />
|-<br />
| [[chromium]]<br />
| {{ic|~/.chromium}}<br />
| [https://src.chromium.org/viewvc/chrome?revision=23057&view=revision 23057]<br />
| [https://groups.google.com/forum/#!topic/chromium-dev/QekVQxF3nho] [https://code.google.com/p/chromium/issues/detail?id=16976]<br />
|<br />
|-<br />
| [http://citra-emu.org/ citra]<br />
| {{ic|~/.citra-emu}}<br />
| [https://github.com/citra-emu/citra/commit/f7c3193fec f7c3193fec]<br />
| [https://github.com/citra-emu/citra/pull/575]<br />
|<br />
|-<br />
| [[PHP#Composer|composer]]<br />
| {{ic|~/.composer}}<br />
| [https://github.com/composer/composer/releases/tag/1.0.0-beta1 1.0.0-beta1]<br />
| [https://github.com/composer/composer/pull/1407]<br />
|<br />
|-<br />
| [https://github.com/falconindy/cower cower]<br />
|<br />
| [https://github.com/falconindy/cower/commit/8b70805 8b70805]<br />
|<br />
|<br />
|-<br />
| [https://wiki.gnome.org/Apps/DFeet d-feet]<br />
| {{ic|~/.d-feet}}<br />
| [https://git.gnome.org/browse/d-feet/commit/?id==7f6104b 7f6104b]<br />
|<br />
|<br />
|-<br />
| [https://wiki.gnome.org/dconf dconf]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[Dolphin emulator|dolphin-emu]]<br />
| {{ic|~/.dolphin-emu}}<br />
| [https://github.com/dolphin-emu/dolphin/commit/a498c68 a498c68]<br />
| [https://github.com/dolphin-emu/dolphin/pull/2304]<br />
|<br />
|-<br />
| [http://dr14tmeter.sourceforge.net dr14-meter]<br />
| <br />
| [https://github.com/simon-r/dr14_t.meter/commit/7e777ca645298ec898b3c76e3ec472ed6ed43e8a 7e777ca64]<br />
| [https://github.com/simon-r/dr14_t.meter/pull/30]<br />
| Hardcoded {{ic|$HOME/.config/dr14meter}}<br />
|-<br />
| [http://www.knopwob.org/dunst/index.html dunst]<br />
|<br />
| [https://github.com/knopwob/dunst/commit/78b6e2b1 78b6e2b1]<br />
| [https://github.com/knopwob/dunst/issues/22]<br />
|<br />
|-<br />
| [[dwb]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[fish]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[fontconfig]]<br />
| {{ic|~/.fontconfig}}<br />
<br />
{{ic|~/.fonts}}<br />
| [http://cgit.freedesktop.org/fontconfig/commit/?id=8c255fb1 8c255fb1]<br />
|<br />
| Use {{ic|"$XDG_DATA_HOME"/fonts}} to store fonts instead.<br />
|-<br />
| [http://fontforge.github.io/ fontforge]<br />
| {{ic|~/.FontForge}}<br />
<br />
{{ic|~/.PfaEdit}}<br />
| [https://github.com/fontforge/fontforge/commit/e4c2cc7432 e4c2cc7432]<br />
| [https://github.com/fontforge/fontforge/issues/847] [https://github.com/fontforge/fontforge/issues/991]<br />
|<br />
|-<br />
| [http://www.freerdp.com/ freerdp]<br />
| {{ic|~/.freerdp}}<br />
| [https://github.com/FreeRDP/FreeRDP/commit/edf6e7258d edf6e7258d]<br />
|<br />
|<br />
|-<br />
| [https://projects.gnome.org/gconf gconf]<br />
| {{ic|~/.gconf}}<br />
| [https://git.gnome.org/browse/gconf/commit/?id=fc28caa7 fc28caa7]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=674803]<br />
|<br />
|-<br />
| [[GIMP]]<br />
| {{ic|~/.gimp-x.y}}<br />
{{ic|~/.thumbnails}}<br />
| [https://git.gnome.org/browse/gimp/commit/?id=60e0cfe 60e0cfe] [https://git.gnome.org/browse/gimp/commit/?id=483505f 483505f]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=166643] [https://bugzilla.gnome.org/show_bug.cgi?id=646644]<br />
|<br />
|-<br />
| [[git]]<br />
| {{ic|~/.gitconfig}}<br />
| [https://github.com/git/git/commit/0d94427e 0d94427e]<br />
|<br />
|<br />
|-<br />
| [http://gstreamer.freedesktop.org/ gstreamer]<br />
| {{ic|~/.gstreamer-0.10}}<br />
| [http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=4e36f93924cf 4e36f93924cf]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=518597]<br />
|<br />
|-<br />
| [[gtk|gtk3]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [http://hisham.hm/htop/ htop]<br />
| {{ic|~/.htoprc}}<br />
| [https://github.com/hishamhm/htop/commit/93233a67 93233a67]<br />
|<br />
|<br />
|-<br />
| [[i3]]<br />
| {{ic|~/.i3}}<br />
| [http://code.stapelberg.de/git/i3/commit/?id=7c130fb54 7c130fb54]<br />
|<br />
|<br />
|-<br />
| [http://i3wm.org/i3status/ i3status]<br />
| {{ic|~/.i3status.conf}}<br />
| [http://code.stapelberg.de/git/i3status/commit/?id=c3f7fc4994 c3f7fc4994]<br />
|<br />
|<br />
|-<br />
| [http://www.imagemagick.org/script/index.php imagemagick]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[inkscape]]<br />
| {{ic|~/.inkscape}}<br />
| [http://wiki.inkscape.org/wiki/index.php/Release_notes/0.47#Preferences 0.47]<br />
| [https://bugs.launchpad.net/inkscape/+bug/199720]<br />
|<br />
|-<br />
| [https://www.ctan.org/pkg/latexmk?lang=en latexmk]<br />
| {{ic|~/.latexmkrc}}<br />
|<br />
|<br />
|<br />
|-<br />
| [http://lftp.yar.ru/ lftp]<br />
| {{ic|~/.lftp}}<br />
| [https://github.com/lavv17/lftp/commit/21dc400 21dc400]<br />
| [https://www.mail-archive.com/lftp@uniyar.ac.ru/msg04301.html]<br />
|<br />
|-<br />
| [https://github.com/Sude-/lgogdownloader/ lgogdownloader]<br />
| {{ic|~/.gogdownloader}}<br />
| [https://github.com/Sude-/lgogdownloader/commit/d430af63d000 d430af63d000]<br />
| [https://github.com/Sude-/lgogdownloader/issues/4]<br />
|<br />
|-<br />
| [[LibreOffice]]<br />
|<br />
| [https://cgit.freedesktop.org/libreoffice/ure/commit/?id=a6f56f70a4930d3f71bd9c9b90fdd0ba20e4da5f a6f56f70] [https://cgit.freedesktop.org/libreoffice/bootstrap/commit/?id=25bd2eec77ed774a37d1cddd0d72312e23d5e9fd 25bd2eec]<br />
| [https://bugs.documentfoundation.org/show_bug.cgi?id=32263]<br />
|<br />
|-<br />
| [[livestreamer]]<br />
| {{ic|~/.livestreamerrc}}<br />
| [https://github.com/chrippa/livestreamer/commit/ea805917 ea805917]<br />
| [https://github.com/chrippa/livestreamer/pull/106]<br />
|<br />
|-<br />
| [[llpp]]<br />
|<br />
| [http://repo.or.cz/w/llpp.git/commit/3ab86f0cb 3ab86f0cb]<br />
|<br />
| Currently llpp places the configuration directly under {{ic|XDG_CONFIG_HOME}} instead of creating a directory.<br />
|-<br />
| [[mc]]<br />
| {{ic|~/.mc}}<br />
| [https://www.midnight-commander.org/changeset/1b9957058 1b9957058] [https://www.midnight-commander.org/changeset/0b7115647 0b7115647]<br />
<br />
[https://www.midnight-commander.org/changeset/ce401d797 ce401d797]<br />
| [https://www.midnight-commander.org/ticket/1851]<br />
|<br />
|-<br />
| [[Mercurial]]<br />
| {{ic|~/.hgrc}}<br />
| [https://www.mercurial-scm.org/repo/hg/rev/354020079723 354020079723] [https://www.mercurial-scm.org/wiki/Release4.2 4.2]<br />
|<br />
| {{ic|XDG_CONFIG_HOME/hg/hgrc}}.<br />
|-<br />
| [https://www.mesa3d.org/ mesa]<br />
|<br />
| [https://cgit.freedesktop.org/mesa/mesa/commit/?id=87ab26b2ab35a29d446ae66f1795d40c184c0739 87ab26b2ab]<br />
|<br />
| {{ic|XDG_CACHE_HOME/mesa}}<br />
|-<br />
| [http://milkytracker.org/ milkytracker]<br />
| {{ic|~/.milkytracker_config}}<br />
| [https://github.com/Deltafire/MilkyTracker/commit/eb487c55 eb487c55]<br />
| [https://github.com/Deltafire/MilkyTracker/issues/12]<br />
|<br />
|-<br />
| [https://github.com/mintty/mintty mintty]<br />
| {{ic|~/.minttyrc}}<br />
| [https://github.com/mintty/mintty/commit/cff1bd8f cff1bd8f] v2.3.7.<br />
| [https://github.com/mintty/mintty/issues/525]<br />
|-<br />
| [[mpd]]<br />
| {{ic|~/.mpdconf}}<br />
| [http://git.musicpd.org/cgit/master/mpd.git/commit/?id=87b73284 87b73284]<br />
|<br />
|<br />
|-<br />
| [[mpv]]<br />
| {{ic|~/.mpv}}<br />
| [https://github.com/mpv-player/mpv/commit/cb250d490 cb250d490]<br />
| [https://github.com/mpv-player/mpv/pull/864]<br />
|<br />
|-<br />
| [[mutt]]<br />
| {{ic|~/.mutt}}<br />
| [https://dev.mutt.org/trac/changeset/42fee7585f 42fee7585f]<br />
| [http://dev.mutt.org/trac/ticket/3207]<br />
|<br />
|-<br />
| [http://mypaint.intilinux.com/ mypaint]<br />
| {{ic|~/.mypaint}}<br />
| [https://github.com/mypaint/mypaint/commit/cf723b74cd cf723b74cd]<br />
|<br />
|<br />
|-<br />
| [[nano]]<br />
| {{ic|~/.nano/}} {{ic|~/.nanorc}}<br />
| [http://git.savannah.gnu.org/cgit/nano.git/commit/?id=c16e79b612eb8e061a4bd0b5f187c37a036fc403 036fc403]<br />
| [https://savannah.gnu.org/patch/?8523]<br />
|<br />
|-<br />
| [[ncmpcpp]]<br />
| {{ic|~/.ncmpcpp}}<br />
| [https://github.com/arybczak/ncmpcpp/commit/38d9f811de888e512b0115f551a9679eab4607f9 38d9f811] [https://github.com/arybczak/ncmpcpp/commit/27cd86e0638bba3a7a78e44ac40dc98a58d1d90d 27cd86e0]<br />
| [https://github.com/arybczak/ncmpcpp/issues/79] [https://github.com/arybczak/ncmpcpp/issues/110]<br />
| {{ic|ncmpcpp_directory}} should be set to avoid an {{ic|error.log}} file in {{ic|~/.ncmpcpp}}.<br />
|-<br />
| [[neovim]]<br />
| {{ic|~/.nvim}}<br />
<br />
{{ic|~/.nvimlog}}<br />
<br />
{{ic|~/.nviminfo}}<br />
| [https://github.com/neovim/neovim/commit/1ca5646bb 1ca5646bb]<br />
| [https://github.com/neovim/neovim/issues/78] [https://github.com/neovim/neovim/pull/3198]<br />
|<br />
|-<br />
| [[newsbeuter]]<br />
| {{ic|~/.newsbeuter}}<br />
| [https://github.com/akrennmair/newsbeuter/commit/3c57824c5 3c57824c5]<br />
| [https://github.com/akrennmair/newsbeuter/pull/39]<br />
| It is required to create both directories [http://newsbeuter.org/doc/newsbeuter.html#_xdg_base_directory_support]:<br />
<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/newsbeuter "$XDG_CONFIG_HOME"/newsbeuter}}<br />
|-<br />
| [[OfflineIMAP]]<br />
| {{ic|~/.offlineimaprc}}<br />
| [https://github.com/OfflineIMAP/offlineimap/commit/5150de5 5150de5]<br />
| [https://github.com/OfflineIMAP/offlineimap/issues/32]<br />
|<br />
|-<br />
| [https://bitbucket.org/opentyrian/opentyrian/wiki/Home opentyrian]<br />
| {{ic|~/.opentyrian}}<br />
| [https://bitbucket.org/opentyrian/opentyrian/commits/8d45ff2 8d45ff2]<br />
| [https://web.archive.org/web/20140815181350/http://code.google.com/p/opentyrian/issues/detail?id=125]<br />
|<br />
|-<br />
| [http://pcsx2.net/ pcsx2]<br />
| {{ic|~/.pcsx2}}<br />
| [https://github.com/PCSX2/pcsx2/commit/87f1e8f77 87f1e8f77] [https://github.com/PCSX2/pcsx2/commit/a9020c606 a9020c606]<br />
<br />
[https://github.com/PCSX2/pcsx2/commit/3b22f0fb0 3b22f0fb0] [https://github.com/PCSX2/pcsx2/commit/0a012aec2 0a012aec2]<br />
| [https://github.com/PCSX2/pcsx2/issues/352] [https://github.com/PCSX2/pcsx2/issues/381]<br />
|<br />
|-<br />
| [https://pip.pypa.io/ pip]<br />
| {{ic|~/.pip}}<br />
| [https://github.com/pypa/pip/blob/548a9136525815dff41acd845c558a0b36eb1c5f/NEWS.rst#60-2014-12-22 6.0]<br />
| [https://github.com/pypa/pip/issues/1733]<br />
|<br />
|-<br />
| [http://www.ppsspp.org/ ppsspp]<br />
| {{ic|~/.ppsspp}}<br />
| [https://github.com/hrydgard/ppsspp/commit/132fe47c7d 132fe47c7d]<br />
| [https://github.com/hrydgard/ppsspp/issues/4623]<br />
|<br />
|-<br />
| {{pkg|procps-ng}}<br />
| {{ic|~/.toprc}}<br />
| [https://gitlab.com/procps-ng/procps/commit/af53e170b9 af53e170b9]<br />
| [https://gitlab.com/procps-ng/procps/merge_requests/38] [https://bugzilla.redhat.com/show_bug.cgi?id=1155265]<br />
|<br />
|-<br />
| [https://github.com/Cloudef/orbment/ orbment]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[pacman]]<br />
| {{ic|~/.makepkg.conf}}<br />
| [https://projects.archlinux.org/pacman.git/commit/?id=80eca94c8 80eca94c8]<br />
| [https://mailman.archlinux.org/pipermail/pacman-dev/2014-July/019178.html]<br />
|<br />
|-<br />
| [https://github.com/panda3d/panda3d Panda3D]<br />
| {{ic|~/.panda3d}}<br />
| [https://github.com/panda3d/panda3d/commit/2b537d2 2b537d2]<br />
|<br />
|<br />
|-<br />
| [[PulseAudio]]<br />
| {{ic|~/.pulse}}<br />
<br />
{{ic|~/.pulse-cookie}}<br />
| [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=59a8618dcd9 59a8618dcd9] [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=87ae8307057 87ae8307057]<br />
<br />
[http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=9ab510a6921 9ab510a6921] [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=4c195bcc9d5 4c195bcc9d5]<br />
| [https://bugzilla.redhat.com/show_bug.cgi?id=845607]<br />
|<br />
|-<br />
| [http://pyroom.org/index.html pyroom]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[qutebrowser]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[qtile]]<br />
|<br />
| [https://github.com/qtile/qtile/commit/fd8686e5b4e4fa20bb82039ed8a83768434585ec fd8686e] [https://github.com/qtile/qtile/commit/66d704bce83f631b3326f10a1bc9fc22f8e6a6fd 66d704b]<br />
<br />
[https://github.com/qtile/qtile/commit/51cff019917b87bda696b381493f969ceb6cc350 51cff01]<br />
| [https://github.com/qtile/qtile/pull/835]<br />
| Some optional bar widgets can create files and directories in non-compliant paths, but most often these are still configurable.<br />
|-<br />
| {{Pkg|rclone}}<br />
| {{ic|~/.rclone.conf}}<br />
| [https://github.com/ncw/rclone/commit/9d362589 9d362589]<br />
| [https://github.com/ncw/rclone/issues/868]<br />
|<br />
|-<br />
| [http://www.libretro.com/ retroarch]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [http://rr-project.org/ rr]<br />
| {{ic|~/.rr}}<br />
| [https://github.com/mozilla/rr/commit/02e7d41e 02e7d41e]<br />
| [https://github.com/mozilla/rr/issues/1455]<br />
|<br />
|-<br />
| [http://www.snes9x.com/ Snes9x]<br />
| {{ic|~/.snes9x}}<br />
| [https://github.com/snes9xgit/snes9x/commit/93b5f11641fa22d4518f251d6e3db99219864677 19864677]<br />
| [https://github.com/snes9xgit/snes9x/issues/194]<br />
| By default configuration is blank, is intended that the user fill it at they will (throw the gui or manually) before launch a rom<br />
|-<br />
| {{AUR|sublime-text-dev}}<br />
|<br />
|<br />
|<br />
| Cache is placed in {{ic|$XDG_CONFIG_HOME/sublime-text-3/Cache}} instead of expected {{ic|$XDG_CACHE_HOME/sublime-text-3}}.<br />
|-<br />
| [[surfraw]]<br />
| {{ic|~/.surfraw.conf}}<br />
<br />
{{ic|~/.surfraw.bookmarks}}<br />
| [http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=3e4591d8 3e4591d8] [http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=bd8c427d bd8c427d]<br />
<br />
[http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=f57fc718 f57fc718]<br />
|<br />
|<br />
|-<br />
| [[sway]]<br />
| {{ic|~/.sway/config}}<br />
| [https://github.com/SirCmpwn/sway/commit/614393c09 614393c09]<br />
| [https://github.com/SirCmpwn/sway/issues/5]<br />
|<br />
|-<br />
| [[systemd]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[termite]]<br />
|<br />
|-<br />
| [https://github.com/tmuxinator/tmuxinator tmuxinator]<br />
| {{ic|~/.tmuxinator}}<br />
| [https://github.com/tmuxinator/tmuxinator/pull/511/commits/263692349f1142c0edcacfbefae541cbc0e7b44e 2636923]<br />
| [https://github.com/tmuxinator/tmuxinator/pull/511]<br />
<br />
|<br />
|-<br />
| [[transmission]]<br />
| {{ic|~/.transmission}}<br />
| [https://trac.transmissionbt.com/changeset/5517 5517]<br />
| [https://trac.transmissionbt.com/ticket/684]<br />
|<br />
|-<br />
| [https://www.kernel.org/pub/linux/utils/util-linux/ util-linux]<br />
|<br />
| [http://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=570b32100 570b32100]<br />
|<br />
|<br />
|-<br />
| [[uzbl]]<br />
|<br />
| [https://github.com/uzbl/uzbl/commit/c6fd63a c6fd63a]<br />
| [https://github.com/uzbl/uzbl/pull/150]<br />
|<br />
|-<br />
| [http://fanglingsu.github.io/vimb/ vimb]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[VirtualBox]]<br />
| {{ic|~/.VirtualBox}}<br />
| [https://www.virtualbox.org/ticket/5099?action=diff&version=7 4.3]<br />
| [https://www.virtualbox.org/ticket/5099]<br />
|<br />
|-<br />
| [http://martanne.github.io/vis/ vis]<br />
| {{ic|~/.vis}}<br />
| [https://github.com/martanne/vis/pull/303]<br />
| [https://github.com/martanne/vis/commit/68a25c751c0219ef5df589a19513e46a08965d5a 68a25c75]<br />
[https://github.com/martanne/vis/commit/d138908cf8149eb10120957271cd6979272b4730 d138908c]<br />
|<br />
|-<br />
| [[VLC media player]]<br />
| {{ic|~/.vlcrc}}<br />
| [http://git.videolan.org/?p=vlc.git;a=commit;h=16f32e1500887c0dcd33cb06ad71759a81a52878 16f32e15]<br />
| [https://trac.videolan.org/vlc/ticket/1267]<br />
|<br />
|-<br />
| [https://www.warsow.gg/ warsow]<br />
| {{ic|~/.warsow-2.x}}<br />
| [https://github.com/Qfusion/qfusion/commit/98ece3f 98ece3f]<br />
| [https://github.com/Qfusion/qfusion/issues/298]<br />
|<br />
|-<br />
| [[wireshark]]<br />
| {{ic|~/.wireshark}}<br />
| [https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b0b53fa5937aa7ba258427ca0f3581dba725230d b0b53fa5]<br />
|<br />
|<br />
|-<br />
| [https://github.com/derat/xsettingsd xsettingsd]<br />
| {{ic|~/.xsettingsd}}<br />
| [https://github.com/derat/xsettingsd/commit/b4999f5e9e99224caf97d09f25ee731774ecd7be 4ecd7be]<br />
|<br />
|<br />
|-<br />
| [[xmonad]]<br />
| {{ic|~/.xmonad}}<br />
| [https://github.com/xmonad/xmonad/commit/40fc10b6a5682ce1d6ba7f0679962926ef6cfade 40fc10b6]<br />
| [https://github.com/xmonad/xmonad/issues/61] [https://code.google.com/p/xmonad/issues/detail?id=484]<br />
| Alternatively the environments {{ic|XMONAD_CONFIG_HOME}}, {{ic|XMONAD_DATA_HOME}}, and {{ic|XMONAD_CACHE_HOME}} are also available.<br />
|-<br />
| [http://www.vergenet.net/~conrad/software/xsel/ xsel]<br />
| {{ic|~/.xsel.log}}<br />
| [https://github.com/kfish/xsel/commit/ee7b48111be2e2117b201962e9d1c0e1f9804ed4 ee7b4811]<br />
| [https://github.com/kfish/xsel/issues/10]<br />
|<br />
|}<br />
<br />
==Partial==<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| [http://abook.sourceforge.net/ abook]<br />
| {{ic|~/.abook}}<br />
|<br />
|<br />
| {{ic|1=$ abook --config "$XDG_CONFIG_HOME"/abook/abookrc \<br />
--datafile "$XDG_CACHE_HOME"/abook/addressbook}}<br />
|-<br />
| [[Anki]]<br />
| {{ic|~/Anki}}<br />
<br />
{{ic|~/Documents/Anki}}<br />
|<br />
| [https://github.com/dae/anki/pull/49] [https://github.com/dae/anki/pull/58]<br />
| {{ic|1=$ anki -b "$XDG_DATA_HOME"/Anki}}<br />
|-<br />
| [[aspell]]<br />
| {{ic|~/.aspell.conf}}<br />
|<br />
|<br />
|<br />
|-<br />
| [[Atom]]<br />
| {{ic|~/.atom}}<br />
|<br />
| [https://github.com/atom/atom/issues/8281]<br />
| {{ic|1=$ export ATOM_HOME="$XDG_DATA_HOME"/atom}}<br />
|-<br />
| [http://crates.io/ cargo]<br />
| {{ic|~/.cargo}}<br />
|<br />
| [https://github.com/rust-lang/cargo/pull/148] [https://github.com/rust-lang/cargo/issues/1734] [https://github.com/rust-lang/rfcs/pull/1615]<br />
| {{ic|1=$ export CARGO_HOME="$XDG_DATA_HOME"/cargo}}<br />
|-<br />
| [[ccache]]<br />
| {{ic|~/.ccache}}<br />
|<br />
|<br />
| {{ic|1=$ export CCACHE_DIR="$XDG_CACHE_HOME"/ccache}}<br />
|-<br />
| [https://github.com/cisco/ChezScheme ChezScheme]<br />
| {{ic|~/.chezscheme_history}}<br />
|<br />
|<br />
| {{ic|1=$ petite --eehistory "$XDG_DATA_HOME"/chezscheme/history}}<br />
|-<br />
| [[conky]]<br />
| {{ic|~/.conkyrc}}<br />
| [https://github.com/brndnmtthws/conky/commit/00481ee9a97025e8e2acd7303d080af1948f7980 00481ee]<br />
| [https://github.com/brndnmtthws/conky/issues/144]<br />
| {{ic|1=$ conky --config="$XDG_CONFIG_HOME"/conky/conkyrc}}<br />
|-<br />
| [[coreutils]]<br />
| {{ic|~/.dircolors}}<br />
|<br />
|<br />
| {{ic|1=$ source "$(dircolors "$XDG_CONFIG_HOME"/dircolors)"}}<br />
|-<br />
| [http://www.dungeoncrawl.org/ crawl]<br />
| {{ic|~/.crawl}}<br />
|<br />
|<br />
| The trailing slash is required:<br />
<br />
{{ic|1=$ export CRAWL_DIR="$XDG_DATA_HOME"/crawl/}}<br />
|-<br />
| [[dict]]<br />
| {{ic|~/.dictrc}}<br />
|<br />
|<br />
| {{ic|1=$ dict -c "$XDG_CONFIG_HOME"/dict/dictrc}}<br />
|-<br />
| [[ELinks]]<br />
| {{ic|~/.elinks}}<br />
|<br />
|<br />
| {{ic|1=$ export ELINKS_CONFDIR="$XDG_CONFIG_HOME"/elinks}}<br />
|-<br />
| [http://kripken.github.io/emscripten-site/ emscripten]<br />
| {{ic|~/.emscripten}}<br />
<br />
{{ic|~/.emscripten_sanity}}<br />
<br />
{{ic|~/.emscripten_ports}}<br />
<br />
{{ic|~/.emscripten_cache__last_clear}}<br />
|<br />
| [https://github.com/kripken/emscripten/issues/3624 3624]<br />
| {{ic|1=$ export EM_CONFIG="$XDG_CONFIG_HOME"/emscripten/config}}<br />
<br />
{{ic|1=$ export EM_CACHE="$XDG_CACHE_HOME"/emscripten/cache}}<br />
<br />
{{ic|1=$ export EM_PORTS="$XDG_DATA_HOME"/emscripten/cache}}<br />
<br />
{{ic|1=$ emcc --em-config "$XDG_CONFIG_HOME"/emscripten/config \<br />
--em-cache "$XDG_CACHE_HOME"/emscripten/cache}}<br />
|-<br />
| [http://www.gnu.org/software/gdb/ gdb]<br />
| {{ic|~/.gdbinit}}<br />
|<br />
|<br />
| {{ic|1=$ gdb -nh -x "$XDG_CONFIG_HOME"/gdb/init}}<br />
|-<br />
| [https://github.com/get-iplayer/get_iplayer get_iplayer]<br />
| {{ic|~/.get_iplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export GETIPLAYERUSERPREFS="$XDG_DATA_HOME"/get_iplayer}}<br />
|-<br />
| [http://guichaz.free.fr/gliv/ gliv]<br />
| {{ic|~/.glivrc}}<br />
|<br />
|<br />
| {{ic|1=$ gliv --glivrc="$XDG_CONFIG_HOME"/gliv/glivrc}}<br />
|-<br />
| [[GnuPG]]<br />
| {{ic|~/.gnupg}}<br />
|<br />
| [https://bugs.gnupg.org/gnupg/issue1456] [https://bugs.gnupg.org/gnupg/issue1018]<br />
| {{ic|1=$ export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg}}<br />
<br />
{{ic|1=$ gpg2 --homedir "$XDG_CONFIG_HOME"/gnupg}}<br />
|-<br />
| [[Google Earth]]<br />
| {{ic|~/.googleearth}}<br />
|<br />
|<br />
| Some paths can be changed with the {{ic|KMLPath}} and {{ic|CachePath}} options in {{ic|~/.config/Google/GoogleEarthPlus.conf}}<br />
|-<br />
| [https://sourceforge.net/projects/gqclient GQ LDAP client]<br />
| {{ic|~/.gq}}<br />
{{ic|~/.gq-state}}<br />
| [https://sourceforge.net/p/gqclient/mailman/message/2053978 1.51]<br />
|<br />
| {{ic|1=$ export GQRC="$XDG_CONFIG_HOME"/gqrc}}<br />
<br />
{{ic|1=$ export GQSTATE="$XDG_DATA_HOME"/gq/gq-state}}<br />
<br />
{{ic|1=$ mkdir -p "$(dirname "$GQSTATE")"}}<br />
|-<br />
| [https://gradle.org/ gradle]<br />
| {{ic|~/.gradle}}<br />
|<br />
| [https://discuss.gradle.org/t/be-a-nice-freedesktop-citizen-move-the-gradle-to-the-appropriate-location-in-linux/2199]<br />
| {{ic|1=$ export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle}}<br />
|-<br />
| [[gtk]]<br />
| {{ic|~/.gtkrc}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK_RC_FILES="$XDG_CONFIG_HOME"/gtk-1.0/gtkrc}}<br />
|-<br />
| [[gtk|gtk2]]<br />
| {{ic|~/.gtkrc-2.0}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc}}<br />
|-<br />
| [http://httpie.org httpie]<br />
| {{ic|~/.httpie}}<br />
|<br />
| [https://github.com/jakubroztocil/httpie/issues/145]<br />
| {{ic|1=$ export HTTPIE_CONFIG_DIR="$XDG_CONFIG_HOME"/httpie}}<br />
|-<br />
| [http://ipython.org ipython]/[[jupyter]]<br />
| {{ic|~/.ipython}}<br />
|<br />
|<br />
| {{ic|1=$ export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter}}<br />
<br />
{{ic|1=$ export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter}}<br />
|-<br />
| [[irssi]]<br />
| {{ic|~/.irssi}}<br />
|<br />
| [https://github.com/irssi/irssi/pull/511]<br />
| {{ic|1=$ irssi --config="$XDG_CONFIG_HOME"/irssi/config \<br />
--home="$XDG_DATA_HOME"/irssi}}<br />
|-<br />
| [[isync]]<br />
| {{ic|~/.mbsyncrc}}<br />
|<br />
|<br />
| {{ic|1=$ mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc}}<br />
|-<br />
| [[core utilities#less|less]]<br />
| {{ic|~/.lesshst}}<br />
|<br />
|<br />
| {{ic|1=$ mkdir -p "$XDG_CACHE_HOME"/less}}<br />
<br />
{{ic|1=$ export LESSHISTFILE="$XDG_CACHE_HOME"/less/history}}<br />
<br />
{{ic|1=$ export LESSHISTFILE=-}} can be used to disable this feature.<br />
<br />
{{ic|1=$ export LESSKEY="$XDG_CONFIG_HOME"/less/lesskey}}<br />
|-<br />
| [http://www.videolan.org/developers/libdvdcss.html libdvdcss]<br />
| {{ic|~/.dvdcss}}<br />
|<br />
| [https://mailman.videolan.org/pipermail/libdvdcss-devel/2014-August/001022.html]<br />
| {{ic|1=$ export DVDCSS_CACHE="$XDG_DATA_HOME"/dvdcss}}<br />
|-<br />
| [https://www.x.org/releases/current/doc/libICE/ice.html libice]<br />
| {{ic|~/.ICEauthority}}<br />
|<br />
| [https://bugs.freedesktop.org/show_bug.cgi?id=49173]<br />
| {{ic|1=$ export ICEAUTHORITY="$XDG_RUNTIME_DIR"/ICEauthority}}<br />
Be wary setting this too restrictively, e.g. {{pkg|gdm}} needs access to a user's {{ic|ICEauthority}} file.<br />
|-<br />
| [[Xorg|libx11]]<br />
| {{ic|~/.XCompose}}<br />
|<br />
|<br />
| {{ic|1=$ export XCOMPOSEFILE="$XDG_CONFIG_HOME"/X11/xcompose}}<br />
|-<br />
| [http://ltrace.org/ ltrace]<br />
| {{ic|~/.ltrace.conf}}<br />
|<br />
|<br />
| {{ic|1=$ ltrace -F "$XDG_CONFIG_HOME"/ltrace/ltrace.conf}}<br />
|-<br />
| {{pkg|maven}}<br />
| {{ic|~/.m2}}<br />
|<br />
|<br />
| {{ic|1=$ mvn -gs "$XDG_CONFIG_HOME"/maven/settings.xml}}<br />
{{hc|[http://maven.apache.org/settings.html settings.xml]|<nowiki><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"<br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0<br />
https://maven.apache.org/xsd/settings-1.0.0.xsd"><br />
...<br />
<localRepository>${env.XDG_CACHE_HOME}/maven/repository</localRepository><br />
...<br />
</settings></nowiki>}}<br />
|-<br />
| [[Mathematica]]<br />
| {{ic|~/.Mathematica}}<br />
|<br />
|<br />
| {{ic|1=$ export MATHEMATICA_USERBASE="$XDG_CONFIG_HOME"/mathematica}}<br />
|-<br />
| [http://mednafen.sourceforge.net/ mednafen]<br />
| {{ic|~/.mednafen}}<br />
|<br />
|<br />
| {{ic|1=$ export MEDNAFEN_HOME="$XDG_CONFIG_HOME"/mednafen}}<br />
|-<br />
| [[moc]]<br />
| {{ic|~/.moc}}<br />
|<br />
|<br />
| {{ic|1=$ mocp -M "$XDG_CONFIG_HOME"/moc}}<br />
<br />
{{ic|1=$ mocp -O MOCDir="$XDG_CONFIG_HOME"/moc}}<br />
|-<br />
| [[MPlayer]]<br />
| {{ic|~/.mplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer}}<br />
|-<br />
| [[msmtp]]<br />
| {{ic|~/.msmtprc}}<br />
|<br />
|<br />
| {{ic|1=$ msmtp -C "$XDG_CONFIG_HOME"/msmtp/msmtprc}}<br />
|-<br />
| {{pkg|ncurses}}<br />
| {{ic|~/.terminfo}}<br />
|<br />
|<br />
| Precludes system path searching:<br />
<br />
{{ic|1=$ export TERMINFO="$XDG_DATA_HOME"/terminfo}}<br />
<br />
{{ic|1=$ export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo}}<br />
|-<br />
| [http://www.musicpd.org/clients/ncmpc/ ncmpc]<br />
| {{ic|~/.ncmpc}}<br />
|<br />
|<br />
| {{ic|ncmpc -f "$XDG_CONFIG_HOME"/ncmpc/config}}<br />
|-<br />
| [[Netbeans]]<br />
| {{ic|~/.netbeans}}<br />
|<br />
| [https://netbeans.org/bugzilla/show_bug.cgi?id=215961]<br />
| {{ic|1=$ netbeans --userdir "${XDG_CONFIG_HOME}"/netbeans}}<br />
|-<br />
| [[Node.js]]<br />
| {{ic|~/.node_repl_history}}<br />
|<br />
|<br />
| {{ic|1=$ export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history}} [https://nodejs.org/api/repl.html#repl_environment_variable_options]<br />
|-<br />
| [[notmuch]]<br />
| {{ic|~/.notmuch-config}}<br />
|<br />
| [http://notmuchmail.org/pipermail/notmuch/2011/007007.html]<br />
| {{ic|1=$ export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/notmuchrc}}<br />
<br />
{{ic|1=$ export NMBGIT="$XDG_DATA_HOME"/notmuch/nmbug}}<br />
|-<br />
| {{pkg|npm}}<br />
| {{ic|~/.npm}}<br />
<br />
{{ic|~/.npmrc}}<br />
|<br />
| [https://github.com/npm/npm/issues/6675]<br />
| {{ic|1=$ export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc}}<br />
{{hc|npmrc|<nowiki><br />
prefix=${XDG_DATA_HOME}/npm<br />
cache=${XDG_CACHE_HOME}/npm<br />
tmp=${XDG_RUNTIME_DIR}/npm<br />
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js<br />
</nowiki>}}<br />
{{ic|prefix}} is unnecessary (and unsupported) if Node.js is installed by {{AUR|nvm}}.<br />
|-<br />
| [[NVIDIA]], [[CUDA]]<br />
| {{ic|~/.nv}}<br />
|<br />
|<br />
| {{ic|1=$ export __GL_SHADER_DISK_CACHE_PATH="$XDG_CACHE_HOME"/nv}}<br />
<br />
{{ic|1=$ export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv}}<br />
|-<br />
| [https://github.com/NVIDIA/nvidia-settings nvidia-settings]<br />
| {{ic|~/.nvidia-settings-rc}}<br />
|<br />
|<br />
| {{ic|1=$ nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings}}<br />
|-<br />
| {{AUR|nvm}}<br />
| {{ic|~/.nvm}}<br />
|<br />
|<br />
| {{ic|1=$ export NVM_DIR="$XDG_DATA_HOME"/nvm}}<br />
|-<br />
| [http://www.openscad.org/ openscad]<br />
| {{ic|~/.OpenSCAD}}<br />
| [https://github.com/openscad/openscad/commit/7c3077b0f 7c3077b0f]<br />
| [https://github.com/openscad/openscad/issues/125]<br />
| Does not fully honour XDG Base Directory Specification, see [https://github.com/openscad/openscad/issues/373]<br />
<br />
Currently it [https://github.com/openscad/openscad/blob/master/src/PlatformUtils-posix.cc#L20 hard-codes] {{ic|~/.local/share}}.<br />
|-<br />
| [[OpenSSL]]<br />
| {{ic|~/.rnd}}<br />
|<br />
|<br />
| Seeding file .rnd's location can be set with RANDFILE environment variable per [https://www.openssl.org/docs/faq.html FAQ].<br />
|-<br />
| {{pkg|pass}}<br />
| {{ic|~/.password-store}}<br />
|<br />
|<br />
| {{ic|1=$ export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass}}<br />
|-<br />
| {{pkg|pidgin}}<br />
| {{ic|~/.purple}}<br />
|<br />
|<br />
| {{ic|1=$ pidgin --config="$XDG_DATA_HOME"/purple}}<br />
|-<br />
| [https://www.postgresql.org/ postgresql]<br />
| {{ic|~/.psqlrc}}<br />
{{ic|~/.psql_history}}<br />
<br />
{{ic|~/.pgpass}}<br />
<br />
{{ic|~/.pg_service.conf}}<br />
| 9.2<br />
| [https://www.postgresql.org/docs/current/static/app-psql.html]<br />
<br />
[https://www.postgresql.org/docs/current/static/libpq-envars.html]<br />
| {{ic|1=$ export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc"}}<br />
{{ic|1=$ export PSQL_HISTORY="$XDG_CACHE_HOME/pg/psql_history"}}<br />
<br />
{{ic|1=$ export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass"}}<br />
<br />
{{ic|1=$ export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf"}}<br />
<br />
It is required to create both directories {{ic|1=$ mkdir "$XDG_CONFIG_HOME/pg" && mkdir "$XDG_CACHE_HOME/pg"}}<br />
|-<br />
| [[PulseAudio]]<br />
| {{ic|~/.esd_auth}}<br />
|<br />
|<br />
| Very likely generated by the {{ic|module-esound-protocol-unix.so}} module. It can be configured to use a different location but it makes much more sense to just comment out this module in {{ic|/etc/pulse/default.pa}} or {{ic|"$XDG_CONFIG_HOME"/pulse/default.pa}}.<br />
|-<br />
| [https://pypi.python.org/pypi/setuptools python-setuptools]<br />
| {{ic|~/.python-eggs}}<br />
|<br />
|<br />
| {{ic|1=$ export PYTHON_EGG_CACHE="$XDG_CACHE_HOME"/python-eggs}}<br />
|-<br />
| [[readline]]<br />
| {{ic|~/.inputrc}}<br />
|<br />
|<br />
| {{ic|1=$ export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc}}<br />
|-<br />
| [http://utopia.knoware.nl/~hlub/uck/rlwrap/ rlwrap]<br />
| {{ic|~/.*_history}}<br />
|<br />
| [https://github.com/hanslub42/rlwrap/issues/25]<br />
| {{ic|1=$ export RLWRAP_HOME="$XDG_DATA_HOME"/rlwrap}}<br />
|-<br />
| [https://rubygems.org/ RubyGems]<br />
| {{ic|~/.gem}}<br />
|<br />
|<br />
| {{ic|1=$ export GEM_HOME="$XDG_DATA_HOME"/gem}}<br />
{{ic|1=$ export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem}}<br />
|-<br />
| [http://www.scala-sbt.org/ sbt]<br />
| {{ic|~/.sbt}}<br />
{{ic|~/.ivy2}}<br />
|<br />
|<br />
| {{ic|1=$ sbt -ivy "$XDG_DATA_HOME"/ivy2 -sbt-dir "$XDG_DATA_HOME"/sbt}}<br />
|-<br />
| [[screen]]<br />
| {{ic|~/.screenrc}}<br />
|<br />
|<br />
| {{ic|1=$ export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc}}<br />
|-<br />
| [https://www.stackage.org/ stack]<br />
| {{ic|~/.stack}}<br />
|<br />
| [https://github.com/commercialhaskell/stack/issues/342]<br />
| {{ic|1=$ export STACK_ROOT="$XDG_DATA_HOME"/stack}}<br />
|-<br />
| [[subversion]]<br />
| {{ic|~/.subversion}}<br />
|<br />
| [https://issues.apache.org/jira/browse/SVN-4599] [https://mail-archives.apache.org/mod_mbox/subversion-users/201204.mbox/%3c4F8FBCC6.4080205@ritsuka.org%3e][http://mail-archives.apache.org/mod_mbox/subversion-dev/201509.mbox/%3c20150917222954.GA20331@teapot%3e]<br />
| {{ic|1=$ svn --config-dir "$XDG_CONFIG_HOME"/subversion}}<br />
|-<br />
| {{pkg|task}}<br />
| {{ic|~/.task}}<br />
<br />
{{ic|~/.taskrc}}<br />
|<br />
|<br />
| {{ic|1=$ export TASKDATA="$XDG_DATA_HOME"/task}}<br />
<br />
{{ic|1=$ export TASKRC="$XDG_CONFIG_HOME"/task/taskrc}}<br />
|-<br />
| [http://jonas.nitro.dk/tig/ tig]<br />
| {{ic|~/.tigrc}}<br />
|<br />
|<br />
| {{ic|1=$ export TIGRC_USER="$XDG_CONFIG_HOME"/tig/tigrc}}<br />
|-<br />
| [http://tiptop.gforge.inria.fr/ tiptop]<br />
| {{ic|~/.tiptoprc}}<br />
|<br />
|<br />
| This will still expect the {{ic|.tiptoprc}} file.<br />
{{ic|$ tiptop -W "$XDG_CONFIG_HOME"/tiptop}}<br />
|-<br />
| [[tmux]]<br />
| {{ic|~/.tmux.conf}}<br />
|<br />
| [http://comments.gmane.org/gmane.comp.terminal-emulators.tmux.user/6013] [http://sourceforge.net/p/tmux/mailman/message/30619546/]<br />
| {{ic|1=$ tmux -f "$XDG_CONFIG_HOME"/tmux/tmux.conf}}<br />
<br />
{{ic|1=$ export TMUX_TMPDIR="$XDG_RUNTIME_DIR"}}<br />
|-<br />
| [https://github.com/bengardner/uncrustify uncrustify]<br />
| {{ic|~/.uncrustify.cfg}}<br />
|<br />
|<br />
| {{ic|1=$ export UNCRUSTIFY_CONFIG="$XDG_CONFIG_HOME"/uncrustify/uncrustify.cfg}}<br />
|-<br />
| [[Unison]]<br />
| {{ic|~/.unison}}<br />
|<br />
|<br />
| {{ic|1=$ export UNISON="$XDG_DATA_HOME"/unison}}<br />
|-<br />
| [[Rxvt-unicode/Tips_and_tricks#Daemon-client|urxvtd]]<br />
| {{ic|~/.urxvt/urxvtd-hostname}}<br />
|<br />
|<br />
| {{ic|1=$ export RXVT_SOCKET="$XDG_RUNTIME_DIR"/urxvtd}}<br />
|-<br />
| [[WeeChat]]<br />
| {{ic|~/.weechat}}<br />
|<br />
| [http://savannah.nongnu.org/task/?10934]<br />
| {{ic|1=$ export WEECHAT_HOME="$XDG_CONFIG_HOME"/weechat}}<br />
<br />
{{ic|1=$ weechat -d "$XDG_CONFIG_HOME"/weechat}}<br />
|-<br />
| [[wget]]<br />
| {{ic|~/.wgetrc}}<br />
|<br />
|<br />
| {{ic|1=$ export WGETRC="$XDG_CONFIG_HOME/wgetrc"}}<br />
|-<br />
| [[wine]]<br />
| {{ic|~/.wine}}<br />
|<br />
| [https://bugs.winehq.org/show_bug.cgi?id=20888]<br />
| [[Wine#Winetricks|Winetricks]] uses XDG-alike location below for [[Wine#WINEPREFIX|WINEPREFIX]] management:<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/wineprefixes}}<br />
<br />
{{ic|1=$ export WINEPREFIX="$XDG_DATA_HOME"/wineprefixes/default}}<br />
|-<br />
| {{pkg|xorg-xauth}}<br />
| {{ic|~/.Xauthority}}<br />
|<br />
|<br />
| {{ic|1=$ export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority}}<br />
|-<br />
| {{pkg|xorg-xinit}}<br />
| {{ic|~/.xinitrc}}<br />
<br />
{{ic|~/.xserverrc}}<br />
|<br />
|<br />
| {{ic|1=$ export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc}}<br />
{{ic|1=$ export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc}}<br />
<br />
Note that these variables are respected by ''xinit'', but not by ''startx''.<br />
|-<br />
| {{pkg|xorg-xrdb}}<br />
| {{ic|~/.Xresources}}<br />
<br />
{{ic|~/.Xdefaults}}<br />
|<br />
|<br />
| Ultimately you [http://superuser.com/questions/243914/xresources-or-xdefaults should be] using {{ic|Xresources}} and since these resources are loaded via {{ic|xrdb}} you can specify a path such as {{ic|1=$ xrdb -load ~/.config/X11/xresources}}.<br />
|}<br />
<br />
==Hardcoded==<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Discussion<br />
! Notes<br />
|-<br />
| [[adb]]<br />
| {{ic|~/.android}}<br />
| [https://developer.android.com/studio/command-line/variables.html#android_sdk_root]<br />
| {{ic|1=$ export ANDROID_SDK_HOME="$XDG_CONFIG_HOME"/android}}<br />
|-<br />
| [[AMule]]<br />
| {{ic|~/.aMule}}<br />
|<br />
|<br />
|-<br />
| [https://developer.android.com/studio/index.html Android Studio]<br />
| {{ic|~/.AndroidStudio2.3}}<br />
<br />
{{ic|~/.android}}<br />
<br />
{{ic|~/.java}}<br />
|<br />
|<br />
|-<br />
| [https://osdn.net/projects/anthy/ anthy]<br />
| {{ic|~/.anthy}}<br />
| [https://osdn.net/ticket/browse.php?group_id=14&tid=28397]<br />
|<br />
|-<br />
| [https://directory.apache.org/studio/ Apache Directory Studio]<br />
| {{ic|~/.ApacheDirectoryStudio}}<br />
|<br />
|-<br />
| [https://www.audacityteam.org/ Audacity]<br />
| {{ic|~/.audacity-data}}<br />
|<br />
|<br />
|-<br />
| [http://fixounet.free.fr/avidemux/ Avidemux]<br />
| {{ic|~/.avidemux6}}<br />
|<br />
|<br />
|-<br />
| [[bash]]<br />
| {{ic|~/.bashrc}}<br />
<br />
{{ic|~/.bash_history}}<br />
<br />
{{ic|~/.bash_profile}}<br />
<br />
{{ic|~/.bash_login}}<br />
<br />
{{ic|~/.bash_logout}}<br />
| [http://savannah.gnu.org/support/?108134]<sup>won't<br />
| {{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/bash/history}}<br />
A specified {{ic|bashrc}} can be sourced from {{ic|/etc/bashrc}}.<br />
<br />
Specify {{ic|--init-file <file>}} as an alternative to {{ic|~/.bashrc}} for interactive shells.<br />
|-<br />
| [[bazaar]]<br />
| {{ic|~/.bazaar}}<br />
<br />
{{ic|~/.bzr.log}}<br />
|<br />
|<br />
|-<br />
| [https://www.haskell.org/cabal/ cabal]<br />
| {{ic|~/.cabal}}<br />
| [https://github.com/haskell/cabal/issues/680]<br />
| See discussion for potential workarounds. It is not very easy or straightforward but may be possible to emulate Base Directory compliance.<br />
|-<br />
| [https://calibre-ebook.com/ calibre]<br />
| {{ic|~/Calibre Library}}<br />
|<br />
|<br />
|-<br />
| [[CUPS]]<br />
| {{ic|~/.cups}}<br />
| [http://www.cups.org/str.php?L4243]<sup>won't<br />
|<br />
|-<br />
| [[darcs]]<br />
| {{ic|~/.darcs}}<br />
| [http://bugs.darcs.net/issue2453]<br />
|<br />
|-<br />
| [[dbus]]<br />
| {{ic|~/.dbus}}<br />
| [https://bugs.freedesktop.org/show_bug.cgi?id=35887]<br />
| This should be avoidable with kdbus [citation needed].<br />
|-<br />
| [https://wiki.gnome.org/Apps/Dia Dia]<br />
| {{ic|~/.dia}}<br />
|<br />
|-<br />
| [[eclipse]]<br />
| {{ic|~/.eclipse}}<br />
| [https://bugs.eclipse.org/bugs/show_bug.cgi?id=200809]<br />
| Option {{ic|1=-Dosgi.configuration.area=@user.home/.config/..}} overrides but must be added to {{ic|"$ECLIPSE_HOME"/eclipse.ini"}} rather than command line which means you must have write access to {{ic|$ECLIPSE_HOME}}. (Arch Linux hard-codes {{ic|$ECLIPSE_HOME}} in {{ic|/usr/bin/eclipse}})<br />
|-<br />
| [https://www.gnu.org/software/emacs/ emacs]<br />
| {{ic|~/.emacs}}<br />
<br />
{{ic|~/.emacs.d}}<br />
| [http://debbugs.gnu.org/cgi/bugreport.cgi?bug=583]<br />
| It's possible to set {{ic|HOME}}, but it has unexpected side effects. So far the most promising approach is modifying another Emacs environment variable to alter the load path and author your own site file which can manually load up your init file, but it changes the load process significantly.<br />
|-<br />
| [http://www.fetchmail.info/ Fetchmail]<br />
| {{ic|~/.fetchmailrc}}<br />
|<br />
|<br />
|-<br />
| [[Firefox]]<br />
| {{ic|~/.mozilla}}<br />
| [https://bugzil.la/259356]<br />
|<br />
|-<br />
| [[Flatpak]]<br />
| {{ic|~/.var/}}<br />
| [https://github.com/flatpak/flatpak/issues/46] [https://github.com/flatpak/flatpak.github.io/issues/191]<br />
|<br />
|-<br />
| [https://www.haskell.org/ghc/ GHC]<br />
| {{ic|~/.ghc}}<br />
| [https://ghc.haskell.org/trac/ghc/ticket/6077]<br />
|<br />
|-<br />
| [http://www.gnu.org/software/parallel/ GNU parallel]<br />
| {{ic|~/.parallel}}<br />
|<br />
|<br />
|-<br />
| [http://recordmydesktop.sourceforge.net/about.php gtk-recordMyDesktop]<br />
| {{ic|~/.gtk-recordmydesktop}}<br />
|<br />
|<br />
|-<br />
| [http://www.idris-lang.org/ idris]<br />
| {{ic|~/.idris}}<br />
| [https://github.com/idris-lang/Idris-dev/pull/3456]<br />
|<br />
|-<br />
| [http://julialang.org/ julia]<br />
| {{ic|~/.juliarc.jl}}<br />
<br />
{{ic|~/.julia_history}}<br />
| [https://github.com/JuliaLang/julia/issues/4630] [https://github.com/JuliaLang/julia/issues/10016]<br />
|<br />
|-<br />
| [http://www.linux-pam.org/ Linux PAM]<br />
| {{ic|~/.pam_environment}}<br />
| [https://github.com/linux-pam/linux-pam/issues/7]<br />
| Hardcoded in [https://github.com/linux-pam/linux-pam/blob/master/modules/pam_env/pam_env.c modules/pam_env/pam_env.c]<br />
|-<br />
| [http://lldb.llvm.org/ lldb]<br />
| {{ic|~/.lldb}}<br />
<br />
{{ic|~/.lldbinit}}<br />
|<br />
|<br />
|-<br />
| [http://www.mathomatic.org/ mathomatic]<br />
| {{ic|~/.mathomaticrc}}<br />
<br />
{{ic|~/.matho_history}}<br />
|<br />
| History can be moved by using {{ic|rlwrap mathomatic -r}} with the {{ic|RLWRAP_HOME}} environment set appropriately.<br />
|-<br />
| [http://www.milkytracker.org/ milkytracker]<br />
| {{ic|~/.milkytracker_config}}<br />
| [https://github.com/Deltafire/MilkyTracker/issues/12]<br />
|<br />
|-<br />
| [https://minecraft.net/ Minecraft]<br />
| {{ic|~/.minecraft}}<br />
| [https://bugs.mojang.com/browse/MCL-2563]<br />
|<br />
|-<br />
| [https://www.mongodb.org/ mongodb]<br />
| {{ic|~/.mongorc.js}}<br />
<br />
{{ic|~/.dbshell}}<br />
| [https://jira.mongodb.org/browse/DOCS-5652?jql=text%20~%20%22.mongorc.js%22]<br />
| [http://stackoverflow.com/a/22349050/4200039 This Stack Overflow thread] suggests a partial workaround using command-line switch {{ic|--norc}}.<br />
|-<br />
|<br />
| {{ic|~/.netrc}}<br />
|<br />
| Like {{ic|~/.ssh}}, many programs expect this file to be here. These include projects like curl ({{ic|CURLOPT_NETRC_FILE}}), ftp ({{ic|NETRC}}), s-nail ({{ic|NETRC}}), etc. While some of them offer alternative configurable locations, many do not such as w3m, wget and lftp.<br />
|-<br />
| [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS NSS]<br />
| {{ic|~/.pki}}<br />
| [https://bugzilla.mozilla.org/show_bug.cgi?id=818686]<br />
|<br />
|-<br />
| [https://www.openssh.com/ OpenSSH]<br />
| {{ic|~/.ssh}}<br />
| [https://bugzilla.mindrot.org/show_bug.cgi?id=2050]<br />
| Assumed to be present by many ssh daemons and clients such as DropBear and OpenSSH.<br />
|-<br />
| [https://www.palemoon.org/ palemoon]<br />
| {{ic|~/.moonchild productions}}<br />
| [https://forum.palemoon.org/viewtopic.php?f=5&t=9639]<br />
|<br />
|-<br />
| [https://perf.wiki.kernel.org/index.php/Main_Page perf]<br />
| {{ic|~/.debug}}<br />
|<br />
| Hardcoded in [https://github.com/torvalds/linux/blob/master/tools/perf/util/config.c#L18 tools/perf/util/config.c:18].<br />
|-<br />
| various [[shell]]s and [[display manager]]s<br />
| {{ic|~/.profile}}<br />
|<br />
|<br />
|-<br />
| [[python]]<br />
| {{ic|~/.python_history}}<br />
|<br />
| All history from interactive sessions is saved to {{ic|~/.python_history}} by default since [https://bugs.python.org/issue5845 version 3.4], custom path can still be set the same way as in older versions (see [https://docs.python.org/3/library/readline.html?highlight=readline#example this example]).<br />
|-<br />
| [https://doc.qt.io/qt-5/qtdesigner-manual.html Qt Designer]<br />
| {{ic|~/.designer}}<br />
|<br />
|<br />
|-<br />
| [https://quodlibet.readthedocs.io/en/latest/ Quod Libet]<br />
| {{ic|~/.quodlibet}}<br />
| [https://github.com/quodlibet/quodlibet/issues/138]<br />
|<br />
|-<br />
| [https://racket-lang.org/ racket]<br />
| {{ic|~/.racketrc}}<br />
|<br />
|<br />
|-<br />
| [http://rednotebook.sourceforge.net/ RedNotebook]<br />
| {{ic|~/.rednotebook}}<br />
|<br />
|<br />
|-<br />
| [https://remarkableapp.github.io/linux.html Remarkable]<br />
| {{ic|~/.remarkable}}<br />
|<br />
|<br />
|-<br />
| [https://www.scribus.net/ Scribus]<br />
| {{ic|~/.scribus}}<br />
|<br />
|-<br />
| [http://www.seamonkey-project.org/ SeaMonkey]<br />
| {{ic|~/.mozilla}}<br />
| [https://bugzil.la/726939]<br />
|<br />
|-<br />
| [[Skype]] < 5.0<br />
| {{ic|~/.Skype}}<br />
| [https://community.skype.com/t5/Linux-archive/Skype-violates-XDG-basedir-spec-on-linux/td-p/4175884]<br />
|<br />
|-<br />
| [https://www.gnu.org/software/solfege/solfege.html Solfege]<br />
| {{ic|~/.solfege}}<br />
<br />
{{ic|~/.solfegerc}}<br />
<br />
{{ic|~/lessonfiles}}<br />
| [https://savannah.gnu.org/bugs/index.php?50251]<br />
|<br />
|-<br />
| [https://spamassassin.apache.org/ SpamAssassin]<br />
| {{ic|~/.spamassassin}}<br />
|<br />
|<br />
|-<br />
| [[spectrwm]]<br />
| {{ic|~/.spectrwm}}<br />
|<br />
|<br />
|-<br />
| [[SQLite]]<br />
| {{ic|~/.sqlite_history}}<br />
<br />
{{ic|~/.sqliterc}}<br />
| [https://unix.stackexchange.com/questions/306890/change-location-of-sqlite-history-file][http://sqlite.1065341.n5.nabble.com/Customizing-the-location-of-the-sqlite-history-td87055.html]<br />
| {{ic|$ sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc}}<br />
|-<br />
| [[Steam]]<br />
| {{ic|~/.steam}}<br />
{{ic|~/.steampath}}<br />
{{ic|~/.steampid}}<br />
| [https://github.com/ValveSoftware/steam-for-linux/issues/1890]<br />
|<br />
|-<br />
| [[TeamSpeak]]<br />
| {{ic|~/.ts3client}}<br />
|<br />
|-<br />
| [http://www.texmacs.org/ TeXmacs]<br />
| {{ic|~/.TeXmacs}}<br />
|<br />
|<br />
|-<br />
| [[Thunderbird]]<br />
| {{ic|~/.thunderbird}}<br />
| [https://bugzil.la/735285]<br />
|<br />
|-<br />
| [https://git.archlinux.org/users/remy/texlive-localmanager.git/ tllocalmgr]<br />
| {{ic|~/.texlive}}<br />
|<br />
|-<br />
| [[vim]]<br />
| {{ic|~/.vim}}<br />
<br />
{{ic|~/.vimrc}}<br />
<br />
{{ic|~/.viminfo}}<br />
|<br />
| Since [https://github.com/vim/vim/commit/6a459902592e2a4ba68 7.3.1178] vim will search for {{ic|~/.vim/vimrc}} if {{ic|~/.vimrc}} is not found.<br />
<br />
{{ic|1=<nowiki>$ mkdir -p "$XDG_CACHE_HOME"/vim/{undo,swap,backup}</nowiki>}}<br />
<br />
{{hc|"$XDG_CONFIG_HOME"/vim/vimrc|<br />
set undodir&#61;$XDG_CACHE_HOME/vim/undo<br />
set directory&#61;$XDG_CACHE_HOME/vim/swap<br />
set backupdir&#61;$XDG_CACHE_HOME/vim/backup<br />
set viminfo+&#61;'1000,n$XDG_CACHE_HOME/vim/viminfo<br />
set runtimepath&#61;$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIMRUNTIME<br />
}}<br />
<br />
{{hc|~/.profile|<br />
export VIMINIT&#61;":source $XDG_CONFIG_HOME"/vim/vimrc<br />
}}<br />
<br />
* https://tlvince.com/vim-respect-xdg<br />
|-<br />
| [http://www.vimperator.org/ vimperator]<br />
| {{ic|~/.vimperatorrc}}<br />
| [http://www.mozdev.org/pipermail/vimperator/2009-October/004848.html]<br />
| {{ic|1=$ export VIMPERATOR_INIT=":source $XDG_CONFIG_HOME/vimperator/vimperatorrc"}}<br />
<br />
{{ic|1=$ export VIMPERATOR_RUNTIME="$XDG_CONFIG_HOME"/vimperator}}<br />
|-<br />
| [https://w1.fi/ wpa_cli]<br />
| {{ic|~/.wpa_cli_history}}<br />
|<br />
|<br />
|-<br />
| {{pkg|xdg-utils}}<br />
| {{ic|~/.gnome}}<br />
|<br />
| For some reason the script {{ic|xdg-desktop-menu}} hard-codes {{ic|gnome_user_dir&#61;"$HOME/.gnome/apps"}}. This is used by [[chromium]] amoung others.<br />
|-<br />
| [https://opensource.conformal.com/wiki/xombrero xombrero]<br />
| {{ic|~/.xombrero}}<br />
| [https://github.com/conformal/xombrero/issues/74]<br />
|<br />
|-<br />
| {{pkg|yarn}}<br />
| {{ic|~/.yarnrc}}<br />
<br />
{{ic|~/.yarn/}}<br />
<br />
{{ic|~/.yarncache/}}<br />
<br />
{{ic|~/.yarn-config/}}<br />
| [https://github.com/yarnpkg/yarn/issues/2334]<br />
|<br />
|-<br />
| [[zsh]]<br />
| {{ic|~/.zshrc}}<br />
<br />
{{ic|~/.zprofile}} {{ic|~/.zshenv}}<br />
<br />
{{ic|~/.zlogin}} {{ic|~/.zlogout}}<br />
<br />
{{ic|~/.histfile}}<br />
| [http://www.zsh.org/mla/workers/2013/msg00692.html]<br />
| Consider exporting {{ic|1=ZDOTDIR=$HOME/.config/zsh}} in {{ic|~/.zshenv}} (this is hardcoded due to the bootstrap problem). You could also add this to {{ic|/etc/zsh/zshenv}} and avoid the need for any dotfiles in your {{ic|HOME}}. Doing this however requires root privilege which may not be viable and is system-wide.<br />
<br />
{{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/zsh/history}}<br />
|}<br />
<br />
==Library and language support==<br />
<br />
; C<br />
: [https://github.com/Cloudef/chck/tree/master/chck/xdg C99: Cloudef's simple implementation].<br />
<br />
; JVM: Java, Kotlin, Clojure, Scala, ...<br />
: [https://github.com/soc/directories directories]<br />
<br />
; Haskell<br />
: Officially in [https://hackage.haskell.org/package/directory directory] since 1.2.3.0 [https://github.com/haskell/directory/commit/ab9d0810ce ab9d0810ce].<br />
: [https://hackage.haskell.org/package/xdg-basedir xdg-basedir]<br />
<br />
; Perl<br />
: [http://search.cpan.org/dist/File-BaseDir/lib/File/BaseDir.pm File-BaseDir]<br />
: [https://github.com/Aerdan/perl-file-xdg perl-file-xdg]<br />
<br />
; Ruby<br />
: [https://github.com/rubyworks/xdg rubyworks/xdg]<br />
<br />
; Python<br />
: [http://freedesktop.org/wiki/Software/pyxdg/ pyxdg]<br />
<br />
; Vala<br />
: Builtin support via [http://valadoc.org/#!api=glib-2.0/GLib.Environment GLib.Environment].<br />
: See {{ic|get_user_cache_dir}}, {{ic|get_user_data_dir}}, {{ic|get_user_config_dir}}, etc.<br />
<br />
==See also==<br />
<br />
* [https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders GNOME Goal: XDG Base Directory Specification Usage]<br />
* [https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp Rob Pike: "Dotfiles" being hidden is a UNIXv2 mistake].<br />
* [http://www.freedesktop.org/software/systemd/man/systemd-path.html systemd-path(1)]<br />
* [http://www.freedesktop.org/software/systemd/man/file-hierarchy.html file-hierarchy(7)]<br />
* [https://github.com/grawity/dotfiles/blob/master/.dotfiles.notes Grawity's notes on dotfiles].<br />
* [https://github.com/grawity/dotfiles/blob/master/.environ.notes Grawity's notes on environment variables].<br />
* [https://ploum.net/207-modify-your-application-to-use-xdg-folders/ ploum.net: Modify Your Application to use XDG Folders].</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Debugging/Getting_traces&diff=496541Debugging/Getting traces2017-11-14T23:11:15Z<p>GenkiSky: /* Getting the trace */ Add link to Core Dump wiki page</p>
<hr />
<div>[[Category:Package development]]<br />
[[ja:デバッグ - トレースを取得]]<br />
[[pt:Debug - Getting Traces]]<br />
[[ru:Debug - Getting Traces]]<br />
[[zh-hans:Debug - Getting Traces]]<br />
{{Related articles start}}<br />
{{Related|General troubleshooting}}<br />
{{Related|Reporting bug guidelines}}<br />
{{Related|Step-by-step debugging guide}}<br />
{{Related articles end}}<br />
This article aims to help in creating a debugging Arch package and using it to provide trace and debug information for reporting software bugs to developers.<br />
<br />
== Package names ==<br />
<br />
{{Poor writing|"call the function", "stack trace", gdb is only mentioned later in the article -> unclear introduction}}<br />
<br />
When looking at debug messages, such as:<br />
<br />
[...]<br />
Backtrace was generated from '/usr/bin/epiphany'<br />
<br />
'''(no debugging symbols found)'''<br />
Using host libthread_db library "/lib/libthread_db.so.1".<br />
'''(no debugging symbols found)'''<br />
[Thread debugging using libthread_db enabled]<br />
[New Thread -1241265952 (LWP 12630)]<br />
(no debugging symbols found)<br />
0xb7f25410 in __kernel_vsyscall ()<br />
#0 0xb7f25410 in __kernel_vsyscall ()<br />
#1 0xb741b45b in '''??''' () from /lib/libpthread.so.0<br />
[...]<br />
<br />
{{ic|??}} shows where debugging info is missing, as well as the name of library or executable which called the function. Similarly, when {{ic|(no debugging symbols found)}} appears, you should look for the stated file names. For example, with [[pacman]]:<br />
<br />
$ pacman -Qo /lib/libthread_db.so.1<br />
/lib/libthread_db.so.1 is owned by ''glibc'' 2.5-8<br />
<br />
The package is called {{Pkg|glibc}} in version 2.5-8. Repeat this step for every package that needs debugging.<br />
<br />
== PKGBUILD ==<br />
<br />
In order to build a package from source, the PKGBUILD file is required. See [[ABS]] for packages in the [[official repositories]], and [[AUR#Acquire build files]] for packages in the [[AUR]].<br />
<br />
== Compilation settings ==<br />
<br />
At this stage, you can modify the global configuration file of {{ic|makepkg}} if you will be using it only for debug purposes. In other cases, you should modify package's PKGBUILD file only for each package you would like to rebuild.<br />
<br />
=== General ===<br />
<br />
As of pacman 4.1, {{ic|/etc/makepkg.conf}} has debug compilation flags in {{ic|DEBUG_CFLAGS}} and {{ic|DEBUG_CXXFLAGS}}. To use them, enable the {{ic|debug}} makepkg option, and disable {{ic|strip}}.<br />
<br />
OPTIONS+=(debug !strip)<br />
<br />
These settings will force compilation with debugging information and will disable the stripping of debug symbols from executables. To apply this setting to a single package, modify the PKGBUILD:<br />
<br />
options=(debug !strip)<br />
<br />
Alternatively you can put the debug information in a separate package by enabling both {{ic|debug}} and {{ic|strip}}, debugging information will then be stripped from the main package and placed in a separate {{ic|''foo''-debug}} package.<br />
<br />
{{Note|It is insufficient to simply install the newly compiled debug package, because the debugger will check that the file containing the debug symbols is from the same build as the associated library and executable. You must install both of the recompiled packages. In Arch, the debug symbols files are installed under {{ic|/usr/lib/debug}}. See the [https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html GDB documentation] <br />
for more information about debug packages.}}<br />
<br />
Note that certain packages such as ''glibc'' are stripped regardless. Check the PKGBUILD for sections such as:<br />
<br />
{{bc|<nowiki><br />
strip $STRIP_BINARIES usr/bin/{gencat,getconf,getent,iconv,iconvconfig} \<br />
usr/bin/{ldconfig,locale,localedef,nscd,makedb} \<br />
usr/bin/{pcprofiledump,pldd,rpcgen,sln,sprof} \<br />
usr/lib/getconf/*<br />
<br />
strip $STRIP_STATIC usr/lib/*.a<br />
<br />
strip $STRIP_SHARED usr/lib/{libanl,libBrokenLocale,libcidn,libcrypt}-*.so \<br />
usr/lib/libnss_{compat,db,dns,files,hesiod,nis,nisplus}-*.so \<br />
usr/lib/{libdl,libm,libnsl,libresolv,librt,libutil}-*.so \<br />
usr/lib/{libmemusage,libpcprofile,libSegFault}.so \<br />
usr/lib/{audit,gconv}/*.so<br />
</nowiki>}}<br />
<br />
And remove them where appropriate.<br />
<br />
=== Qt4 ===<br />
<br />
In addition to the previous general settings, pass {{ic|-developer-build}} option to the {{ic|configure}} script in the {{ic|PKGBUILD}}. By default, {{ic|-developer-build}} passes {{ic|-Werror}} to the compiler, which may cause the compilation to fail. To avoid compilation errors, you may need pass {{ic|-no-warnings-are-errors}}, too.<br />
<br />
=== Qt5 ===<br />
<br />
The [[Unofficial_user_repositories#qt-debug|qt-debug]] repository contains pre-built Qt/PyQt packages with debug symbols. See also [http://doc.qt.io/qt-5/debug.html upstream] instructions.<br />
<br />
=== CMAKE (KDE) applications ===<br />
<br />
[[KDE]] and related programs typically use {{Pkg|cmake}}. To enable debug information and disable optimisations, change {{ic|-DCMAKE_BUILD_TYPE}} to {{ic|Debug}}.<br />
To enable debug information while keeping optimisations enabled, change {{ic|-DCMAKE_BUILD_TYPE}} to {{ic|RelWithDebInfo}}.<br />
<br />
== Building and installing the package ==<br />
<br />
Build the package from source using {{ic|makepkg}} while in the PKGBUILD's directory. This could take some time:<br />
<br />
$ makepkg<br />
<br />
Then install the built package:<br />
<br />
# pacman -U glibc-2.26-1-x86_64.pkg.tar.gz<br />
<br />
== Getting the trace ==<br />
<br />
The actual backtrace (or stack trace) can now be obtained via e.g. {{Pkg|gdb}}, the GNU Debugger. Run it either via:<br />
<br />
# gdb /path/to/file<br />
<br />
or:<br />
<br />
# gdb<br />
(gdb) exec /path/to/file<br />
<br />
The path is optional, if already set in the {{Ic|$PATH}} variable.<br />
<br />
Then, within {{Ic|gdb}}, type {{Ic|run}} followed by any arguments you wish the program to start with, e.g.:<br />
<br />
(gdb) run --no-daemon --verbose<br />
<br />
to start execution of the file. Do whatever necessary to evoke the bug. For the actual log, type the lines:<br />
<br />
(gdb) set logging file trace.log<br />
(gdb) set logging on<br />
<br />
and then:<br />
<br />
(gdb) thread apply all bt full<br />
<br />
to output the trace to {{Ic|trace.log}} into the directory {{Ic|gdb}} was started in. To exit, enter:<br />
<br />
(gdb) set logging off<br />
(gdb) quit<br />
<br />
{{Tip| To debug an application written in python:<br />
# gdb /usr/bin/python<br />
(gdb) run <python application><br />
}}<br />
<br />
You can also debug an already running application, e.g.:<br />
<br />
# gdb --pid=$(pidof firefox)<br />
(gdb) continue<br />
<br />
To debug an application that has already crashed, you will want to invoke gdb on its [[Core_dump#Examining_a_core_dump|core dump]].<br />
<br />
== Conclusion ==<br />
<br />
Use the complete stack trace to inform developers of a bug you have discovered before. This will be highly appreciated by them and will help to improve your favorite program.<br />
<br />
== See also ==<br />
<br />
* [https://wiki.debian.org/HowToGetABacktrace Debian - How To Get a Backtrace]<br />
* [https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces Gentoo Wiki - Backtraces with Gentoo]<br />
* [http://fedoraproject.org/wiki/StackTraces Fedora - StackTraces]<br />
* [https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces/Details#obtain-a-stacktrace GNOME - Getting Stack Traces]<br />
* [http://linux.bytesex.org/gdb.html gdb mini intro]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=XDG_Base_Directory&diff=489852XDG Base Directory2017-09-10T05:58:32Z<p>GenkiSky: /* Partial */ Add msmtp</p>
<hr />
<div>[[Category:Dotfiles]]<br />
[[ja:XDG Base Directory サポート]]<br />
{{Related articles start}}<br />
{{Related|dotfiles}}<br />
{{Related|Xdg user directories}}<br />
{{Related articles end}}<br />
This article exists to catalog the growing set of software using the [http://standards.freedesktop.org/basedir-spec/latest/ XDG Base Directory Specification] introduced in 2003. This is here to demonstrate the viability of this specification by listing commonly found dotfiles and their support status. For those not currently supporting the Base Directory Specification, workarounds will be demonstrated to emulate it instead.<br />
<br />
The workarounds will be limited to anything not involving patching the source, executing code stored in [[environment variable]]s or compile-time options. The rationale for this is that configurations should be portable across systems and having compile-time options prevent that.<br />
<br />
Hopefully this will provide a source of information about exactly what certain kinds of dotfiles are and where they come from.<br />
<br />
==XDG Base Directory specification==<br />
<br />
Please read the [http://standards.freedesktop.org/basedir-spec/latest/ full specification]. This section will attempt to break down the essence of what it tries to achieve.<br />
<br />
Only {{ic|XDG_RUNTIME_DIR}} is set by default through [http://www.freedesktop.org/software/systemd/man/pam_systemd.html pam_systemd]. It is up to the user to explicitly [[define]] the other variables, using absolute paths that point to existing directories.<br />
<br />
===User directories===<br />
<br />
* {{ic|XDG_CONFIG_HOME}}<br />
** Where user-specific configurations should be written (analogous to {{ic|/etc}}).<br />
** Should default to {{ic|$HOME/.config}}.<br />
<br />
* {{ic|XDG_CACHE_HOME}}<br />
** Where user-specific non-essential (cached) data should be written (analogous to {{ic|/var/cache}}).<br />
** Should default to {{ic|$HOME/.cache}}.<br />
<br />
* {{ic|XDG_DATA_HOME}}<br />
** Where user-specific data files should be written (analogous to {{ic|/usr/share}}).<br />
** Should default to {{ic|$HOME/.local/share}}.<br />
<br />
* {{ic|XDG_RUNTIME_DIR}}<br />
** Used for non-essential, user-specific data files such as sockets, named pipes, etc.<br />
** Not required to have a default value; warnings should be issued if not set or equivalents provided.<br />
** Must be owned by the user with an access mode of {{ic|0700}}.<br />
** Filesystem fully featured by standards of OS.<br />
** Must be on the local filesystem.<br />
** May be subject to periodic cleanup.<br />
** Modified every 6 hours or set sticky bit if persistence is desired.<br />
** Can only exist for the duration of the user's login.<br />
** Should not store large files as it may be mounted as a tmpfs.<br />
<br />
===System directories===<br />
<br />
* {{ic|XDG_DATA_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/usr/local/share:/usr/share}}.<br />
<br />
* {{ic|XDG_CONFIG_DIRS}}<br />
** List of directories seperated by {{ic|:}} (analogous to {{ic|PATH}}).<br />
** Should default to {{ic|/etc/xdg}}.<br />
<br />
==Contributing==<br />
<br />
When contributing make sure to use the correct section.<br />
<br />
Nothing should require code evaluation (such as [[vim]] and {{ic|VIMINIT}}), patches or compile-time options to gain support and anything which does must be deemed hardcoded. Additionally if the process is too error prone or difficult, such as [https://www.haskell.org/cabal/ Haskell's cabal] or eclipse, they should also be considered as hardcoded.<br />
<br />
* The first column should be the project name, ideally the command name if it is not ambigious, linked to their website or an appropriate internal wiki article.<br />
<br />
* The second column is for any legacy files and directories the project had (one per line), this is done so people can find them even if they are no longer read.<br />
<br />
* In the third, try to find the commit or version a project switched to XDG Base Directory or any open discussions and include them in the next two columns (two per line).<br />
<br />
* The last column should include any appropriate workarounds or solutions. Please verify that your solution is correct and functional.<br />
<br />
==Supported==<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| [https://github.com/SirCmpwn/aerc aerc]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [https://github.com/Antimicro/antimicro/ antimicro]<br />
| {{ic|~/.antimicro}}<br />
| [https://github.com/Antimicro/antimicro/commit/edba864 edba864]<br />
| [https://github.com/Antimicro/antimicro/issues/5]<br />
|<br />
|-<br />
| [[aria2]]<br />
| {{ic|~/.aria2}}<br />
| [https://github.com/tatsuhiro-t/aria2/commit/8bc1d37 8bc1d37]<br />
| [https://github.com/tatsuhiro-t/aria2/issues/27]<br />
|<br />
|-<br />
| [[blender]]<br />
| {{ic|~/.blender}}<br />
| [http://git.blender.org/gitweb/gitweb.cgi/blender.git/commit/4293f473 4293f473]<br />
| [https://developer.blender.org/T28943]<br />
|<br />
|-<br />
| [https://github.com/falconindy/burp burp]<br />
|<br />
| [https://github.com/falconindy/burp/commit/f2388e9 f2388e9]<br />
|<br />
|<br />
|-<br />
| [[chromium]]<br />
| {{ic|~/.chromium}}<br />
| [https://src.chromium.org/viewvc/chrome?revision=23057&view=revision 23057]<br />
| [https://groups.google.com/forum/#!topic/chromium-dev/QekVQxF3nho] [https://code.google.com/p/chromium/issues/detail?id=16976]<br />
|<br />
|-<br />
| [http://citra-emu.org/ citra]<br />
| {{ic|~/.citra-emu}}<br />
| [https://github.com/citra-emu/citra/commit/f7c3193fec f7c3193fec]<br />
| [https://github.com/citra-emu/citra/pull/575]<br />
|<br />
|-<br />
| [[PHP#Composer|composer]]<br />
| {{ic|~/.composer}}<br />
| [https://github.com/composer/composer/releases/tag/1.0.0-beta1 1.0.0-beta1]<br />
| [https://github.com/composer/composer/pull/1407]<br />
|<br />
|-<br />
| [https://github.com/falconindy/cower cower]<br />
|<br />
| [https://github.com/falconindy/cower/commit/8b70805 8b70805]<br />
|<br />
|<br />
|-<br />
| [https://wiki.gnome.org/Apps/DFeet d-feet]<br />
| {{ic|~/.d-feet}}<br />
| [https://git.gnome.org/browse/d-feet/commit/?id==7f6104b 7f6104b]<br />
|<br />
|<br />
|-<br />
| [https://wiki.gnome.org/dconf dconf]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[Dolphin emulator|dolphin-emu]]<br />
| {{ic|~/.dolphin-emu}}<br />
| [https://github.com/dolphin-emu/dolphin/commit/a498c68 a498c68]<br />
| [https://github.com/dolphin-emu/dolphin/pull/2304]<br />
|<br />
|-<br />
| [http://dr14tmeter.sourceforge.net dr14-meter]<br />
| <br />
| [https://github.com/simon-r/dr14_t.meter/commit/7e777ca645298ec898b3c76e3ec472ed6ed43e8a 7e777ca64]<br />
| [https://github.com/simon-r/dr14_t.meter/pull/30]<br />
| Hardcoded {{ic|$HOME/.config/dr14meter}}<br />
|-<br />
| [http://www.knopwob.org/dunst/index.html dunst]<br />
|<br />
| [https://github.com/knopwob/dunst/commit/78b6e2b1 78b6e2b1]<br />
| [https://github.com/knopwob/dunst/issues/22]<br />
|<br />
|-<br />
| [[dwb]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[fish]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[fontconfig]]<br />
| {{ic|~/.fontconfig}}<br />
<br />
{{ic|~/.fonts}}<br />
| [http://cgit.freedesktop.org/fontconfig/commit/?id=8c255fb1 8c255fb1]<br />
|<br />
| Use {{ic|"$XDG_DATA_HOME"/fonts}} to store fonts instead.<br />
|-<br />
| [http://fontforge.github.io/ fontforge]<br />
| {{ic|~/.FontForge}}<br />
<br />
{{ic|~/.PfaEdit}}<br />
| [https://github.com/fontforge/fontforge/commit/e4c2cc7432 e4c2cc7432]<br />
| [https://github.com/fontforge/fontforge/issues/847] [https://github.com/fontforge/fontforge/issues/991]<br />
|<br />
|-<br />
| [http://www.freerdp.com/ freerdp]<br />
| {{ic|~/.freerdp}}<br />
| [https://github.com/FreeRDP/FreeRDP/commit/edf6e7258d edf6e7258d]<br />
|<br />
|<br />
|-<br />
| [https://projects.gnome.org/gconf gconf]<br />
| {{ic|~/.gconf}}<br />
| [https://git.gnome.org/browse/gconf/commit/?id=fc28caa7 fc28caa7]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=674803]<br />
|<br />
|-<br />
| [[git]]<br />
| {{ic|~/.gitconfig}}<br />
| [https://github.com/git/git/commit/0d94427e 0d94427e]<br />
|<br />
|<br />
|-<br />
| [http://gstreamer.freedesktop.org/ gstreamer]<br />
| {{ic|~/.gstreamer-0.10}}<br />
| [http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=4e36f93924cf 4e36f93924cf]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=518597]<br />
|<br />
|-<br />
| [[gtk|gtk3]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [http://hisham.hm/htop/ htop]<br />
| {{ic|~/.htoprc}}<br />
| [https://github.com/hishamhm/htop/commit/93233a67 93233a67]<br />
|<br />
|<br />
|-<br />
| [[i3]]<br />
| {{ic|~/.i3}}<br />
| [http://code.stapelberg.de/git/i3/commit/?id=7c130fb54 7c130fb54]<br />
|<br />
|<br />
|-<br />
| [http://i3wm.org/i3status/ i3status]<br />
| {{ic|~/.i3status.conf}}<br />
| [http://code.stapelberg.de/git/i3status/commit/?id=c3f7fc4994 c3f7fc4994]<br />
|<br />
|<br />
|-<br />
| [http://www.imagemagick.org/script/index.php imagemagick]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[inkscape]]<br />
| {{ic|~/.inkscape}}<br />
| [http://wiki.inkscape.org/wiki/index.php/Release_notes/0.47#Preferences 0.47]<br />
| [https://bugs.launchpad.net/inkscape/+bug/199720]<br />
|<br />
|-<br />
| [https://www.ctan.org/pkg/latexmk?lang=en latexmk]<br />
| {{ic|~/.latexmkrc}}<br />
|<br />
|<br />
|<br />
|-<br />
| [http://lftp.yar.ru/ lftp]<br />
| {{ic|~/.lftp}}<br />
| [https://github.com/lavv17/lftp/commit/21dc400 21dc400]<br />
| [https://www.mail-archive.com/lftp@uniyar.ac.ru/msg04301.html]<br />
|<br />
|-<br />
| [https://github.com/Sude-/lgogdownloader/ lgogdownloader]<br />
| {{ic|~/.gogdownloader}}<br />
| [https://github.com/Sude-/lgogdownloader/commit/d430af63d000 d430af63d000]<br />
| [https://github.com/Sude-/lgogdownloader/issues/4]<br />
|<br />
|-<br />
| [[LibreOffice]]<br />
|<br />
| [https://cgit.freedesktop.org/libreoffice/ure/commit/?id=a6f56f70a4930d3f71bd9c9b90fdd0ba20e4da5f a6f56f70] [https://cgit.freedesktop.org/libreoffice/bootstrap/commit/?id=25bd2eec77ed774a37d1cddd0d72312e23d5e9fd 25bd2eec]<br />
| [https://bugs.documentfoundation.org/show_bug.cgi?id=32263]<br />
|<br />
|-<br />
| [[livestreamer]]<br />
| {{ic|~/.livestreamerrc}}<br />
| [https://github.com/chrippa/livestreamer/commit/ea805917 ea805917]<br />
| [https://github.com/chrippa/livestreamer/pull/106]<br />
|<br />
|-<br />
| [[llpp]]<br />
|<br />
| [http://repo.or.cz/w/llpp.git/commit/3ab86f0cb 3ab86f0cb]<br />
|<br />
| Currently llpp places the configuration directly under {{ic|XDG_CONFIG_HOME}} instead of creating a directory.<br />
|-<br />
| [[mc]]<br />
| {{ic|~/.mc}}<br />
| [https://www.midnight-commander.org/changeset/1b9957058 1b9957058] [https://www.midnight-commander.org/changeset/0b7115647 0b7115647]<br />
<br />
[https://www.midnight-commander.org/changeset/ce401d797 ce401d797]<br />
| [https://www.midnight-commander.org/ticket/1851]<br />
|<br />
|-<br />
| [[Mercurial]]<br />
| {{ic|~/.hgrc}}<br />
| [https://www.mercurial-scm.org/repo/hg/rev/354020079723 354020079723] [https://www.mercurial-scm.org/wiki/Release4.2 4.2]<br />
|<br />
| {{ic|XDG_CONFIG_HOME/hg/hgrc}}.<br />
|-<br />
| [https://www.mesa3d.org/ mesa]<br />
|<br />
| [https://cgit.freedesktop.org/mesa/mesa/commit/?id=87ab26b2ab35a29d446ae66f1795d40c184c0739 87ab26b2ab]<br />
|<br />
| {{ic|XDG_CACHE_HOME/mesa}}<br />
|-<br />
| [http://milkytracker.org/ milkytracker]<br />
| {{ic|~/.milkytracker_config}}<br />
| [https://github.com/Deltafire/MilkyTracker/commit/eb487c55 eb487c55]<br />
| [https://github.com/Deltafire/MilkyTracker/issues/12]<br />
|<br />
|-<br />
| [https://github.com/mintty/mintty mintty]<br />
| {{ic|~/.minttyrc}}<br />
| [https://github.com/mintty/mintty/commit/cff1bd8f cff1bd8f] v2.3.7.<br />
| [https://github.com/mintty/mintty/issues/525]<br />
|-<br />
| [[mpd]]<br />
| {{ic|~/.mpdconf}}<br />
| [http://git.musicpd.org/cgit/master/mpd.git/commit/?id=87b73284 87b73284]<br />
|<br />
|<br />
|-<br />
| [[mpv]]<br />
| {{ic|~/.mpv}}<br />
| [https://github.com/mpv-player/mpv/commit/cb250d490 cb250d490]<br />
| [https://github.com/mpv-player/mpv/pull/864]<br />
|<br />
|-<br />
| [[mutt]]<br />
| {{ic|~/.mutt}}<br />
| [https://dev.mutt.org/trac/changeset/42fee7585f 42fee7585f]<br />
| [http://dev.mutt.org/trac/ticket/3207]<br />
|<br />
|-<br />
| [http://mypaint.intilinux.com/ mypaint]<br />
| {{ic|~/.mypaint}}<br />
| [https://github.com/mypaint/mypaint/commit/cf723b74cd cf723b74cd]<br />
|<br />
|<br />
|-<br />
| [[ncmpcpp]]<br />
| {{ic|~/.ncmpcpp}}<br />
| [https://github.com/arybczak/ncmpcpp/commit/38d9f811de888e512b0115f551a9679eab4607f9 38d9f811] [https://github.com/arybczak/ncmpcpp/commit/27cd86e0638bba3a7a78e44ac40dc98a58d1d90d 27cd86e0]<br />
| [https://github.com/arybczak/ncmpcpp/issues/79] [https://github.com/arybczak/ncmpcpp/issues/110]<br />
| {{ic|ncmpcpp_directory}} should be set to avoid an {{ic|error.log}} file in {{ic|~/.ncmpcpp}}.<br />
|-<br />
| [[neovim]]<br />
| {{ic|~/.nvim}}<br />
<br />
{{ic|~/.nvimlog}}<br />
<br />
{{ic|~/.nviminfo}}<br />
| [https://github.com/neovim/neovim/commit/1ca5646bb 1ca5646bb]<br />
| [https://github.com/neovim/neovim/issues/78] [https://github.com/neovim/neovim/pull/3198]<br />
|<br />
|-<br />
| [[newsbeuter]]<br />
| {{ic|~/.newsbeuter}}<br />
| [https://github.com/akrennmair/newsbeuter/commit/3c57824c5 3c57824c5]<br />
| [https://github.com/akrennmair/newsbeuter/pull/39]<br />
| It is required to create both directories [http://newsbeuter.org/doc/newsbeuter.html#_xdg_base_directory_support]:<br />
<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/newsbeuter "$XDG_CONFIG_HOME"/newsbeuter}}<br />
|-<br />
| [[OfflineIMAP]]<br />
| {{ic|~/.offlineimaprc}}<br />
| [https://github.com/OfflineIMAP/offlineimap/commit/5150de5 5150de5]<br />
| [https://github.com/OfflineIMAP/offlineimap/issues/32]<br />
|<br />
|-<br />
| [https://bitbucket.org/opentyrian/opentyrian/wiki/Home opentyrian]<br />
| {{ic|~/.opentyrian}}<br />
| [https://bitbucket.org/opentyrian/opentyrian/commits/8d45ff2 8d45ff2]<br />
| [https://web.archive.org/web/20140815181350/http://code.google.com/p/opentyrian/issues/detail?id=125]<br />
|<br />
|-<br />
| [http://pcsx2.net/ pcsx2]<br />
| {{ic|~/.pcsx2}}<br />
| [https://github.com/PCSX2/pcsx2/commit/87f1e8f77 87f1e8f77] [https://github.com/PCSX2/pcsx2/commit/a9020c606 a9020c606]<br />
<br />
[https://github.com/PCSX2/pcsx2/commit/3b22f0fb0 3b22f0fb0] [https://github.com/PCSX2/pcsx2/commit/0a012aec2 0a012aec2]<br />
| [https://github.com/PCSX2/pcsx2/issues/352] [https://github.com/PCSX2/pcsx2/issues/381]<br />
|<br />
|-<br />
| [https://pip.pypa.io/ pip]<br />
| {{ic|~/.pip}}<br />
| [https://github.com/pypa/pip/blob/548a9136525815dff41acd845c558a0b36eb1c5f/NEWS.rst#60-2014-12-22 6.0]<br />
| [https://github.com/pypa/pip/issues/1733]<br />
|<br />
|-<br />
| [http://www.ppsspp.org/ ppsspp]<br />
| {{ic|~/.ppsspp}}<br />
| [https://github.com/hrydgard/ppsspp/commit/132fe47c7d 132fe47c7d]<br />
| [https://github.com/hrydgard/ppsspp/issues/4623]<br />
|<br />
|-<br />
| {{pkg|procps-ng}}<br />
| {{ic|~/.toprc}}<br />
| [https://gitlab.com/procps-ng/procps/commit/af53e170b9 af53e170b9]<br />
| [https://gitlab.com/procps-ng/procps/merge_requests/38] [https://bugzilla.redhat.com/show_bug.cgi?id=1155265]<br />
|<br />
|-<br />
| [https://github.com/Cloudef/orbment/ orbment]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[pacman]]<br />
| {{ic|~/.makepkg.conf}}<br />
| [https://projects.archlinux.org/pacman.git/commit/?id=80eca94c8 80eca94c8]<br />
| [https://mailman.archlinux.org/pipermail/pacman-dev/2014-July/019178.html]<br />
|<br />
|-<br />
| [https://github.com/panda3d/panda3d Panda3D]<br />
| {{ic|~/.panda3d}}<br />
| [https://github.com/panda3d/panda3d/commit/2b537d2 2b537d2]<br />
|<br />
|<br />
|-<br />
| [[PulseAudio]]<br />
| {{ic|~/.pulse}}<br />
<br />
{{ic|~/.pulse-cookie}}<br />
| [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=59a8618dcd9 59a8618dcd9] [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=87ae8307057 87ae8307057]<br />
<br />
[http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=9ab510a6921 9ab510a6921] [http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=4c195bcc9d5 4c195bcc9d5]<br />
| [https://bugzilla.redhat.com/show_bug.cgi?id=845607]<br />
|<br />
|-<br />
| [http://pyroom.org/index.html pyroom]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[qutebrowser]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[qtile]]<br />
|<br />
| [https://github.com/qtile/qtile/commit/fd8686e5b4e4fa20bb82039ed8a83768434585ec fd8686e] [https://github.com/qtile/qtile/commit/66d704bce83f631b3326f10a1bc9fc22f8e6a6fd 66d704b]<br />
<br />
[https://github.com/qtile/qtile/commit/51cff019917b87bda696b381493f969ceb6cc350 51cff01]<br />
| [https://github.com/qtile/qtile/pull/835]<br />
| Some optional bar widgets can create files and directories in non-compliant paths, but most often these are still configurable.<br />
|-<br />
| {{Pkg|rclone}}<br />
| {{ic|~/.rclone.conf}}<br />
| [https://github.com/ncw/rclone/commit/9d362589 9d362589]<br />
| [https://github.com/ncw/rclone/issues/868]<br />
|<br />
|-<br />
| [http://www.libretro.com/ retroarch]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [http://rr-project.org/ rr]<br />
| {{ic|~/.rr}}<br />
| [https://github.com/mozilla/rr/commit/02e7d41e 02e7d41e]<br />
| [https://github.com/mozilla/rr/issues/1455]<br />
|<br />
|-<br />
| [http://www.snes9x.com/ Snes9x]<br />
| {{ic|~/.snes9x}}<br />
| [https://github.com/snes9xgit/snes9x/commit/93b5f11641fa22d4518f251d6e3db99219864677 19864677]<br />
| [https://github.com/snes9xgit/snes9x/issues/194]<br />
| By default configuration is blank, is intended that the user fill it at they will (throw the gui or manually) before launch a rom<br />
|-<br />
| {{AUR|sublime-text-dev}}<br />
|<br />
|<br />
|<br />
| Cache is placed in {{ic|$XDG_CONFIG_HOME/sublime-text-3/Cache}} instead of expected {{ic|$XDG_CACHE_HOME/sublime-text-3}}.<br />
|-<br />
| [[surfraw]]<br />
| {{ic|~/.surfraw.conf}}<br />
<br />
{{ic|~/.surfraw.bookmarks}}<br />
| [http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=3e4591d8 3e4591d8] [http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=bd8c427d bd8c427d]<br />
<br />
[http://anonscm.debian.org/cgit/surfraw/surfraw.git/commit/?id=f57fc718 f57fc718]<br />
|<br />
|<br />
|-<br />
| [[sway]]<br />
| {{ic|~/.sway/config}}<br />
| [https://github.com/SirCmpwn/sway/commit/614393c09 614393c09]<br />
| [https://github.com/SirCmpwn/sway/issues/5]<br />
|<br />
|-<br />
| [[systemd]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[termite]]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[transmission]]<br />
| {{ic|~/.transmission}}<br />
| [https://trac.transmissionbt.com/changeset/5517 5517]<br />
| [https://trac.transmissionbt.com/ticket/684]<br />
|<br />
|-<br />
| [https://www.kernel.org/pub/linux/utils/util-linux/ util-linux]<br />
|<br />
| [http://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=570b32100 570b32100]<br />
|<br />
|<br />
|-<br />
| [[uzbl]]<br />
|<br />
| [https://github.com/uzbl/uzbl/commit/c6fd63a c6fd63a]<br />
| [https://github.com/uzbl/uzbl/pull/150]<br />
|<br />
|-<br />
| [http://fanglingsu.github.io/vimb/ vimb]<br />
|<br />
|<br />
|<br />
|<br />
|-<br />
| [[VirtualBox]]<br />
| {{ic|~/.VirtualBox}}<br />
| [https://www.virtualbox.org/ticket/5099?action=diff&version=7 4.3]<br />
| [https://www.virtualbox.org/ticket/5099]<br />
|<br />
|-<br />
| [http://martanne.github.io/vis/ vis]<br />
| {{ic|~/.vis}}<br />
| [https://github.com/martanne/vis/pull/303]<br />
| [https://github.com/martanne/vis/commit/68a25c751c0219ef5df589a19513e46a08965d5a 68a25c75]<br />
[https://github.com/martanne/vis/commit/d138908cf8149eb10120957271cd6979272b4730 d138908c]<br />
|<br />
|-<br />
| [[VLC media player]]<br />
| {{ic|~/.vlcrc}}<br />
| [http://git.videolan.org/?p=vlc.git;a=commit;h=16f32e1500887c0dcd33cb06ad71759a81a52878 16f32e15]<br />
| [https://trac.videolan.org/vlc/ticket/1267]<br />
|<br />
|-<br />
| [https://www.warsow.gg/ warsow]<br />
| {{ic|~/.warsow-2.x}}<br />
| [https://github.com/Qfusion/qfusion/commit/98ece3f 98ece3f]<br />
| [https://github.com/Qfusion/qfusion/issues/298]<br />
|<br />
|-<br />
| [[wireshark]]<br />
| {{ic|~/.wireshark}}<br />
| [https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b0b53fa5937aa7ba258427ca0f3581dba725230d b0b53fa5]<br />
|<br />
|<br />
|-<br />
| [https://github.com/derat/xsettingsd xsettingsd]<br />
| {{ic|~/.xsettingsd}}<br />
| [https://github.com/derat/xsettingsd/commit/b4999f5e9e99224caf97d09f25ee731774ecd7be 4ecd7be]<br />
|<br />
|<br />
|-<br />
| [[xmonad]]<br />
| {{ic|~/.xmonad}}<br />
| [https://github.com/xmonad/xmonad/commit/40fc10b6a5682ce1d6ba7f0679962926ef6cfade 40fc10b6]<br />
| [https://github.com/xmonad/xmonad/issues/61] [https://code.google.com/p/xmonad/issues/detail?id=484]<br />
| Alternatively the environments {{ic|XMONAD_CONFIG_HOME}}, {{ic|XMONAD_DATA_HOME}}, and {{ic|XMONAD_CACHE_HOME}} are also available.<br />
|-<br />
| [http://www.vergenet.net/~conrad/software/xsel/ xsel]<br />
| {{ic|~/.xsel.log}}<br />
| [https://github.com/kfish/xsel/commit/ee7b48111be2e2117b201962e9d1c0e1f9804ed4 ee7b4811]<br />
| [https://github.com/kfish/xsel/issues/10]<br />
|<br />
|}<br />
<br />
==Partial==<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Supported Since<br />
! Discussion<br />
! Notes<br />
|-<br />
| [http://abook.sourceforge.net/ abook]<br />
| {{ic|~/.abook}}<br />
|<br />
|<br />
| {{ic|1=$ abook --config "$XDG_CONFIG_HOME"/abook/abookrc \<br />
--datafile "$XDG_CACHE_HOME"/abook/addressbook}}<br />
|-<br />
| [[Anki]]<br />
| {{ic|~/Anki}}<br />
<br />
{{ic|~/Documents/Anki}}<br />
|<br />
| [https://github.com/dae/anki/pull/49] [https://github.com/dae/anki/pull/58]<br />
| {{ic|1=$ anki -b "$XDG_DATA_HOME"/Anki}}<br />
|-<br />
| [[aspell]]<br />
| {{ic|~/.aspell.conf}}<br />
|<br />
|<br />
|<br />
|-<br />
| [[Atom]]<br />
| {{ic|~/.atom}}<br />
|<br />
| [https://github.com/atom/atom/issues/8281]<br />
| {{ic|1=$ export ATOM_HOME="$XDG_DATA_HOME"/atom}}<br />
|-<br />
| [http://crates.io/ cargo]<br />
| {{ic|~/.cargo}}<br />
|<br />
| [https://github.com/rust-lang/cargo/pull/148] [https://github.com/rust-lang/cargo/issues/1734] [https://github.com/rust-lang/rfcs/pull/1615]<br />
| {{ic|1=$ export CARGO_HOME="$XDG_DATA_HOME"/cargo}}<br />
|-<br />
| [[ccache]]<br />
| {{ic|~/.ccache}}<br />
|<br />
|<br />
| {{ic|1=$ export CCACHE_DIR="$XDG_CACHE_HOME"/ccache}}<br />
|-<br />
| [https://github.com/cisco/ChezScheme ChezScheme]<br />
| {{ic|~/.chezscheme_history}}<br />
|<br />
|<br />
| {{ic|1=$ petite --eehistory "$XDG_DATA_HOME"/chezscheme/history}}<br />
|-<br />
| [[conky]]<br />
| {{ic|~/.conkyrc}}<br />
| [https://github.com/brndnmtthws/conky/commit/00481ee9a97025e8e2acd7303d080af1948f7980 00481ee]<br />
| [https://github.com/brndnmtthws/conky/issues/144]<br />
| {{ic|1=$ conky --config="$XDG_CONFIG_HOME"/conky/conkyrc}}<br />
|-<br />
| [[coreutils]]<br />
| {{ic|~/.dircolors}}<br />
|<br />
|<br />
| {{ic|1=$ source "$(dircolors "$XDG_CONFIG_HOME"/dircolors)"}}<br />
|-<br />
| [http://www.dungeoncrawl.org/ crawl]<br />
| {{ic|~/.crawl}}<br />
|<br />
|<br />
| The trailing slash is required:<br />
<br />
{{ic|1=$ export CRAWL_DIR="$XDG_DATA_HOME"/crawl/}}<br />
|-<br />
| [[dict]]<br />
| {{ic|~/.dictrc}}<br />
|<br />
|<br />
| {{ic|1=$ dict -c "$XDG_CONFIG_HOME"/dict/dictrc}}<br />
|-<br />
| [[ELinks]]<br />
| {{ic|~/.elinks}}<br />
|<br />
|<br />
| {{ic|1=$ export ELINKS_CONFDIR="$XDG_CONFIG_HOME"/elinks}}<br />
|-<br />
| [http://kripken.github.io/emscripten-site/ emscripten]<br />
| {{ic|~/.emscripten}}<br />
<br />
{{ic|~/.emscripten_sanity}}<br />
<br />
{{ic|~/.emscripten_ports}}<br />
<br />
{{ic|~/.emscripten_cache__last_clear}}<br />
|<br />
| [https://github.com/kripken/emscripten/issues/3624 3624]<br />
| {{ic|1=$ export EM_CONFIG="$XDG_CONFIG_HOME"/emscripten/config}}<br />
<br />
{{ic|1=$ export EM_CACHE="$XDG_CACHE_HOME"/emscripten/cache}}<br />
<br />
{{ic|1=$ export EM_PORTS="$XDG_DATA_HOME"/emscripten/cache}}<br />
<br />
{{ic|1=$ emcc --em-config "$XDG_CONFIG_HOME"/emscripten/config \<br />
--em-cache "$XDG_CACHE_HOME"/emscripten/cache}}<br />
|-<br />
| [http://www.gnu.org/software/gdb/ gdb]<br />
| {{ic|~/.gdbinit}}<br />
|<br />
|<br />
| {{ic|1=$ gdb -nh -x "$XDG_CONFIG_HOME"/gdb/init}}<br />
|-<br />
| [https://github.com/get-iplayer/get_iplayer get_iplayer]<br />
| {{ic|~/.get_iplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export GETIPLAYERUSERPREFS="$XDG_DATA_HOME"/get_iplayer}}<br />
|-<br />
| [[GIMP]]<br />
| {{ic|~/.gimp-2.8}}<br />
{{ic|~/.thumbnails}}<br />
| [https://git.gnome.org/browse/gimp/commit/?id=60e0cfe 60e0cfe]<br />
| [https://bugzilla.gnome.org/show_bug.cgi?id=166643] [https://mail.gnome.org/archives/gimp-developer-list/2012-October/msg00028.html]<br />
| {{ic|1=$ export GIMP2_DIRECTORY="$XDG_CONFIG_HOME"/gimp}}<br />
|-<br />
| [http://guichaz.free.fr/gliv/ gliv]<br />
| {{ic|~/.glivrc}}<br />
|<br />
|<br />
| {{ic|1=$ gliv --glivrc="$XDG_CONFIG_HOME"/gliv/glivrc}}<br />
|-<br />
| [[GnuPG]]<br />
| {{ic|~/.gnupg}}<br />
|<br />
| [https://bugs.gnupg.org/gnupg/issue1456] [https://bugs.gnupg.org/gnupg/issue1018]<br />
| {{ic|1=$ export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg}}<br />
<br />
{{ic|1=$ gpg2 --homedir "$XDG_CONFIG_HOME"/gnupg}}<br />
|-<br />
| [[Google Earth]]<br />
| {{ic|~/.googleearth}}<br />
|<br />
|<br />
| Some paths can be changed with the {{ic|KMLPath}} and {{ic|CachePath}} options in {{ic|~/.config/Google/GoogleEarthPlus.conf}}<br />
|-<br />
| [https://sourceforge.net/projects/gqclient GQ LDAP client]<br />
| {{ic|~/.gq}}<br />
{{ic|~/.gq-state}}<br />
| [https://sourceforge.net/p/gqclient/mailman/message/2053978 1.51]<br />
|<br />
| {{ic|1=$ export GQRC="$XDG_CONFIG_HOME"/gqrc}}<br />
<br />
{{ic|1=$ export GQSTATE="$XDG_DATA_HOME"/gq/gq-state}}<br />
<br />
{{ic|1=$ mkdir -p "$(dirname "$GQSTATE")"}}<br />
|-<br />
| [https://gradle.org/ gradle]<br />
| {{ic|~/.gradle}}<br />
|<br />
| [https://discuss.gradle.org/t/be-a-nice-freedesktop-citizen-move-the-gradle-to-the-appropriate-location-in-linux/2199]<br />
| {{ic|1=$ export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle}}<br />
|-<br />
| [[gtk]]<br />
| {{ic|~/.gtkrc}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK_RC_FILES="$XDG_CONFIG_HOME"/gtk-1.0/gtkrc}}<br />
|-<br />
| [[gtk|gtk2]]<br />
| {{ic|~/.gtkrc-2.0}}<br />
|<br />
|<br />
| {{ic|1=$ export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc}}<br />
|-<br />
| [http://httpie.org httpie]<br />
| {{ic|~/.httpie}}<br />
|<br />
| [https://github.com/jakubroztocil/httpie/issues/145]<br />
| {{ic|1=$ export HTTPIE_CONFIG_DIR="$XDG_CONFIG_HOME"/httpie}}<br />
|-<br />
| [http://ipython.org ipython]/[[jupyter]]<br />
| {{ic|~/.ipython}}<br />
|<br />
|<br />
| {{ic|1=$ export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter}}<br />
<br />
{{ic|1=$ export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter}}<br />
|-<br />
| [[irssi]]<br />
| {{ic|~/.irssi}}<br />
|<br />
| [https://github.com/irssi/irssi/pull/511]<br />
| {{ic|1=$ irssi --config="$XDG_CONFIG_HOME"/irssi/config \<br />
--home="$XDG_DATA_HOME"/irssi}}<br />
|-<br />
| [[isync]]<br />
| {{ic|~/.mbsyncrc}}<br />
|<br />
|<br />
| {{ic|1=$ mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc}}<br />
|-<br />
| [[core utilities#less|less]]<br />
| {{ic|~/.lesshst}}<br />
|<br />
|<br />
| {{ic|1=$ mkdir -p "$XDG_CACHE_HOME"/less}}<br />
<br />
{{ic|1=$ export LESSHISTFILE="$XDG_CACHE_HOME"/less/history}}<br />
<br />
{{ic|1=$ export LESSHISTFILE=-}} can be used to disable this feature.<br />
<br />
{{ic|1=$ export LESSKEY="$XDG_CONFIG_HOME"/less/lesskey}}<br />
|-<br />
| [http://www.videolan.org/developers/libdvdcss.html libdvdcss]<br />
| {{ic|~/.dvdcss}}<br />
|<br />
| [https://mailman.videolan.org/pipermail/libdvdcss-devel/2014-August/001022.html]<br />
| {{ic|1=$ export DVDCSS_CACHE="$XDG_DATA_HOME"/dvdcss}}<br />
|-<br />
| [https://www.x.org/releases/current/doc/libICE/ice.html libice]<br />
| {{ic|~/.ICEauthority}}<br />
|<br />
| [https://bugs.freedesktop.org/show_bug.cgi?id=49173]<br />
| {{ic|1=$ export ICEAUTHORITY="$XDG_RUNTIME_DIR"/ICEauthority}}<br />
|-<br />
| [[Xorg|libx11]]<br />
| {{ic|~/.XCompose}}<br />
|<br />
|<br />
| {{ic|1=$ export XCOMPOSEFILE="$XDG_CONFIG_HOME"/X11/xcompose}}<br />
|-<br />
| [http://ltrace.org/ ltrace]<br />
| {{ic|~/.ltrace.conf}}<br />
|<br />
|<br />
| {{ic|1=$ ltrace -F "$XDG_CONFIG_HOME"/ltrace/ltrace.conf}}<br />
|-<br />
| {{pkg|maven}}<br />
| {{ic|~/.m2}}<br />
|<br />
|<br />
| {{ic|1=$ mvn -gs "$XDG_CONFIG_HOME"/maven/settings.xml}}<br />
{{hc|[http://maven.apache.org/settings.html settings.xml]|<nowiki><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"<br />
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br />
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0<br />
https://maven.apache.org/xsd/settings-1.0.0.xsd"><br />
...<br />
<localRepository>${env.XDG_CACHE_HOME}/maven/repository</localRepository><br />
...<br />
</settings></nowiki>}}<br />
|-<br />
| [[Mathematica]]<br />
| {{ic|~/.Mathematica}}<br />
|<br />
|<br />
| {{ic|1=$ export MATHEMATICA_USERBASE="$XDG_CONFIG_HOME"/mathematica}}<br />
|-<br />
| [http://mednafen.sourceforge.net/ mednafen]<br />
| {{ic|~/.mednafen}}<br />
|<br />
|<br />
| {{ic|1=$ export MEDNAFEN_HOME="$XDG_CONFIG_HOME"/mednafen}}<br />
|-<br />
| [[moc]]<br />
| {{ic|~/.moc}}<br />
|<br />
|<br />
| {{ic|1=$ mocp -M "$XDG_CONFIG_HOME"/moc}}<br />
<br />
{{ic|1=$ mocp -O MOCDir="$XDG_CONFIG_HOME"/moc}}<br />
|-<br />
| [[MPlayer]]<br />
| {{ic|~/.mplayer}}<br />
|<br />
|<br />
| {{ic|1=$ export MPLAYER_HOME="$XDG_CONFIG_HOME"/mplayer}}<br />
|-<br />
| [[msmtp]]<br />
| {{ic|~/.msmtprc}}<br />
|<br />
|<br />
| {{ic|1=$ msmtp -C "$XDG_CONFIG_HOME"/msmtp/msmtprc}}<br />
|-<br />
| {{pkg|ncurses}}<br />
| {{ic|~/.terminfo}}<br />
|<br />
|<br />
| Precludes system path searching:<br />
<br />
{{ic|1=$ export TERMINFO="$XDG_DATA_HOME"/terminfo}}<br />
<br />
{{ic|1=$ export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo}}<br />
|-<br />
| [http://www.musicpd.org/clients/ncmpc/ ncmpc]<br />
| {{ic|~/.ncmpc}}<br />
|<br />
|<br />
| {{ic|ncmpc -f "$XDG_CONFIG_HOME"/ncmpc/config}}<br />
|-<br />
| [[Netbeans]]<br />
| {{ic|~/.netbeans}}<br />
|<br />
| [https://netbeans.org/bugzilla/show_bug.cgi?id=215961]<br />
| {{ic|1=$ netbeans --userdir "${XDG_CONFIG_HOME}"/netbeans}}<br />
|-<br />
| [[notmuch]]<br />
| {{ic|~/.notmuch-config}}<br />
|<br />
| [http://notmuchmail.org/pipermail/notmuch/2011/007007.html]<br />
| {{ic|1=$ export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/notmuchrc}}<br />
<br />
{{ic|1=$ export NMBGIT="$XDG_DATA_HOME"/notmuch/nmbug}}<br />
|-<br />
| {{pkg|npm}}<br />
| {{ic|~/.npm}}<br />
<br />
{{ic|~/.npmrc}}<br />
|<br />
| [https://github.com/npm/npm/issues/6675]<br />
| {{ic|1=$ export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc}}<br />
{{hc|npmrc|<nowiki>cache=$XDG_CACHE_HOME/npm<br />
prefix=$XDG_DATA_HOME/npm</nowiki>}}<br />
{{ic|prefix}} is unnecessary (and unsupported) if Node.js is installed by {{AUR|nvm}}.<br />
|-<br />
| [[NVIDIA]], [[CUDA]]<br />
| {{ic|~/.nv}}<br />
|<br />
|<br />
| {{ic|1=$ export __GL_SHADER_DISK_CACHE_PATH="$XDG_CACHE_HOME"/nv}}<br />
<br />
{{ic|1=$ export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv}}<br />
|-<br />
| [https://github.com/NVIDIA/nvidia-settings nvidia-settings]<br />
| {{ic|~/.nvidia-settings-rc}}<br />
|<br />
|<br />
| {{ic|1=$ nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings}}<br />
|-<br />
| {{AUR|nvm}}<br />
| {{ic|~/.nvm}}<br />
|<br />
|<br />
| {{ic|1=$ export NVM_DIR="$XDG_DATA_HOME"/nvm}}<br />
|-<br />
| [http://www.openscad.org/ openscad]<br />
| {{ic|~/.OpenSCAD}}<br />
| [https://github.com/openscad/openscad/commit/7c3077b0f 7c3077b0f]<br />
| [https://github.com/openscad/openscad/issues/125]<br />
| Does not fully honour XDG Base Directory Specification, see [https://github.com/openscad/openscad/issues/373]<br />
<br />
Currently it [https://github.com/openscad/openscad/blob/master/src/PlatformUtils-posix.cc#L20 hard-codes] {{ic|~/.local/share}}.<br />
|-<br />
| [[OpenSSL]]<br />
| {{ic|~/.rnd}}<br />
|<br />
|<br />
| Seeding file .rnd's location can be set with RANDFILE environment variable per [https://www.openssl.org/docs/faq.html FAQ].<br />
|-<br />
| {{pkg|pass}}<br />
| {{ic|~/.password-store}}<br />
|<br />
|<br />
| {{ic|1=$ export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass}}<br />
|-<br />
| {{pkg|pidgin}}<br />
| {{ic|~/.purple}}<br />
|<br />
|<br />
| {{ic|1=$ pidgin --config="$XDG_DATA_HOME"/purple}}<br />
|-<br />
| [https://www.postgresql.org/ postgresql]<br />
| {{ic|~/.psqlrc}}<br />
{{ic|~/.psql_history}}<br />
<br />
{{ic|~/.pgpass}}<br />
<br />
{{ic|~/.pg_service.conf}}<br />
| 9.2<br />
| [https://www.postgresql.org/docs/current/static/app-psql.html]<br />
<br />
[https://www.postgresql.org/docs/current/static/libpq-envars.html]<br />
| {{ic|1=$ export PSQLRC="$XDG_CONFIG_HOME/pg/psqlrc"}}<br />
{{ic|1=$ export PSQL_HISTORY="$XDG_CACHE_HOME/pg/psql_history"}}<br />
<br />
{{ic|1=$ export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass"}}<br />
<br />
{{ic|1=$ export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf"}}<br />
<br />
It is required to create both directories {{ic|1=$ mkdir "$XDG_CONFIG_HOME/pg" && mkdir "$XDG_CACHE_HOME/pg"}}<br />
|-<br />
| [[PulseAudio]]<br />
| {{ic|~/.esd_auth}}<br />
|<br />
|<br />
| Very likely generated by the {{ic|module-esound-protocol-unix.so}} module. It can be configured to use a different location but it makes much more sense to just comment out this module in {{ic|/etc/pulse/default.pa}} or {{ic|"$XDG_CONFIG_HOME"/pulse/default.pa}}.<br />
|-<br />
| [https://pypi.python.org/pypi/setuptools python-setuptools]<br />
| {{ic|~/.python-eggs}}<br />
|<br />
|<br />
| {{ic|1=$ export PYTHON_EGG_CACHE="$XDG_CACHE_HOME"/python-eggs}}<br />
|-<br />
| [[readline]]<br />
| {{ic|~/.inputrc}}<br />
|<br />
|<br />
| {{ic|1=$ export INPUTRC="$XDG_CONFIG_HOME"/readline/inputrc}}<br />
|-<br />
| [http://utopia.knoware.nl/~hlub/uck/rlwrap/ rlwrap]<br />
| {{ic|~/.*_history}}<br />
|<br />
| [https://github.com/hanslub42/rlwrap/issues/25]<br />
| {{ic|1=$ export RLWRAP_HOME="$XDG_DATA_HOME"/rlwrap}}<br />
|-<br />
| [http://www.scala-sbt.org/ sbt]<br />
| {{ic|~/.sbt}}<br />
{{ic|~/.ivy2}}<br />
|<br />
|<br />
| {{ic|1=$ sbt -ivy "$XDG_DATA_HOME"/ivy2 -sbt-dir "$XDG_DATA_HOME"/sbt}}<br />
|-<br />
| [[screen]]<br />
| {{ic|~/.screenrc}}<br />
|<br />
|<br />
| {{ic|1=$ export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc}}<br />
|-<br />
| [https://www.stackage.org/ stack]<br />
| {{ic|~/.stack}}<br />
|<br />
| [https://github.com/commercialhaskell/stack/issues/342]<br />
| {{ic|1=$ export STACK_ROOT="$XDG_DATA_HOME"/stack}}<br />
|-<br />
| [[subversion]]<br />
| {{ic|~/.subversion}}<br />
|<br />
| [https://issues.apache.org/jira/browse/SVN-4599] [https://mail-archives.apache.org/mod_mbox/subversion-users/201204.mbox/%3c4F8FBCC6.4080205@ritsuka.org%3e][http://mail-archives.apache.org/mod_mbox/subversion-dev/201509.mbox/%3c20150917222954.GA20331@teapot%3e]<br />
| {{ic|1=$ svn --config-dir "$XDG_CONFIG_HOME"/subversion}}<br />
|-<br />
| {{pkg|task}}<br />
| {{ic|~/.task}}<br />
<br />
{{ic|~/.taskrc}}<br />
|<br />
|<br />
| {{ic|1=$ export TASKDATA="$XDG_DATA_HOME"/task}}<br />
<br />
{{ic|1=$ export TASKRC="$XDG_CONFIG_HOME"/task/taskrc}}<br />
|-<br />
| [http://jonas.nitro.dk/tig/ tig]<br />
| {{ic|~/.tigrc}}<br />
|<br />
|<br />
| {{ic|1=$ export TIGRC_USER="$XDG_CONFIG_HOME"/tig/tigrc}}<br />
|-<br />
| [http://tiptop.gforge.inria.fr/ tiptop]<br />
| {{ic|~/.tiptoprc}}<br />
|<br />
|<br />
| This will still expect the {{ic|.tiptoprc}} file.<br />
{{ic|$ tiptop -W "$XDG_CONFIG_HOME"/tiptop}}<br />
|-<br />
| [[tmux]]<br />
| {{ic|~/.tmux.conf}}<br />
|<br />
| [http://comments.gmane.org/gmane.comp.terminal-emulators.tmux.user/6013] [http://sourceforge.net/p/tmux/mailman/message/30619546/]<br />
| {{ic|1=$ tmux -f "$XDG_CONFIG_HOME"/tmux/tmux.conf}}<br />
<br />
{{ic|1=$ export TMUX_TMPDIR="$XDG_RUNTIME_DIR"}}<br />
|-<br />
| [https://github.com/bengardner/uncrustify uncrustify]<br />
| {{ic|~/.uncrustify.cfg}}<br />
|<br />
|<br />
| {{ic|1=$ export UNCRUSTIFY_CONFIG="$XDG_CONFIG_HOME"/uncrustify/uncrustify.cfg}}<br />
|-<br />
| [[Unison]]<br />
| {{ic|~/.unison}}<br />
|<br />
|<br />
| {{ic|1=$ export UNISON="$XDG_DATA_HOME"/unison}}<br />
|-<br />
| [[Rxvt-unicode/Tips_and_tricks#Daemon-client|urxvtd]]<br />
| {{ic|~/.urxvt/urxvtd-hostname}}<br />
|<br />
|<br />
| {{ic|1=$ export RXVT_SOCKET="$XDG_RUNTIME_DIR"/urxvtd}}<br />
|-<br />
| [[WeeChat]]<br />
| {{ic|~/.weechat}}<br />
|<br />
| [http://savannah.nongnu.org/task/?10934]<br />
| {{ic|1=$ export WEECHAT_HOME="$XDG_CONFIG_HOME"/weechat}}<br />
<br />
{{ic|1=$ weechat -d "$XDG_CONFIG_HOME"/weechat}}<br />
|-<br />
| [[wget]]<br />
| {{ic|~/.wgetrc}}<br />
|<br />
|<br />
| {{ic|1=$ export WGETRC="$XDG_CONFIG_HOME/wgetrc"}}<br />
|-<br />
| [[wine]]<br />
| {{ic|~/.wine}}<br />
|<br />
| [https://bugs.winehq.org/show_bug.cgi?id=20888]<br />
| [[Wine#Winetricks|Winetricks]] uses XDG-alike location below for [[Wine#WINEPREFIX|WINEPREFIX]] management:<br />
{{ic|1=$ mkdir -p "$XDG_DATA_HOME"/wineprefixes}}<br />
<br />
{{ic|1=$ export WINEPREFIX="$XDG_DATA_HOME"/wineprefixes/default}}<br />
|-<br />
| {{pkg|xorg-xauth}}<br />
| {{ic|~/.Xauthority}}<br />
|<br />
|<br />
| {{ic|1=$ export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority}}<br />
|-<br />
| {{pkg|xorg-xinit}}<br />
| {{ic|~/.xinitrc}}<br />
<br />
{{ic|~/.xserverrc}}<br />
|<br />
|<br />
| {{ic|1=$ export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc}}<br />
{{ic|1=$ export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc}}<br />
<br />
Note that these variables are respected by ''xinit'', but not by ''startx''.<br />
|-<br />
| {{pkg|xorg-xrdb}}<br />
| {{ic|~/.Xresources}}<br />
<br />
{{ic|~/.Xdefaults}}<br />
|<br />
|<br />
| Ultimately you [http://superuser.com/questions/243914/xresources-or-xdefaults should be] using {{ic|Xresources}} and since these resources are loaded via {{ic|xrdb}} you can specify a path such as {{ic|1=$ xrdb -load ~/.config/X11/xresources}}.<br />
|}<br />
<br />
==Hardcoded==<br />
<br />
{| class="wikitable sortable" style="width: 100%"<br />
! Application<br />
! Legacy Path<br />
! Discussion<br />
! Notes<br />
|-<br />
| [[adb]]<br />
| {{ic|~/.android}}<br />
| [https://developer.android.com/studio/command-line/variables.html#android_sdk_root]<br />
| {{ic|1=$ export ANDROID_SDK_HOME="$XDG_CONFIG_HOME"/android}}<br />
|-<br />
| [[AMule]]<br />
| {{ic|~/.aMule}}<br />
|<br />
|<br />
|-<br />
| [https://developer.android.com/studio/index.html Android Studio]<br />
| {{ic|~/.AndroidStudio2.3}}<br />
<br />
{{ic|~/.android}}<br />
<br />
{{ic|~/.java}}<br />
|<br />
|<br />
|-<br />
| [https://osdn.net/projects/anthy/ anthy]<br />
| {{ic|~/.anthy}}<br />
| [https://osdn.net/ticket/browse.php?group_id=14&tid=28397]<br />
|<br />
|-<br />
| [https://directory.apache.org/studio/ Apache Directory Studio]<br />
| {{ic|~/.ApacheDirectoryStudio}}<br />
|<br />
|-<br />
| [https://www.audacityteam.org/ Audacity]<br />
| {{ic|~/.audacity-data}}<br />
|<br />
|<br />
|-<br />
| [http://fixounet.free.fr/avidemux/ Avidemux]<br />
| {{ic|~/.avidemux6}}<br />
|<br />
|<br />
|-<br />
| [[bash]]<br />
| {{ic|~/.bashrc}}<br />
<br />
{{ic|~/.bash_history}}<br />
<br />
{{ic|~/.bash_profile}}<br />
<br />
{{ic|~/.bash_login}}<br />
<br />
{{ic|~/.bash_logout}}<br />
| [http://savannah.gnu.org/support/?108134]<sup>won't<br />
| A specified {{ic|bashrc}} can be sourced from {{ic|/etc/bashrc}}<br />
{{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/bash/history}}<br />
|-<br />
| [[bazaar]]<br />
| {{ic|~/.bazaar}}<br />
<br />
{{ic|~/.bzr.log}}<br />
|<br />
|<br />
|-<br />
| [https://www.haskell.org/cabal/ cabal]<br />
| {{ic|~/.cabal}}<br />
| [https://github.com/haskell/cabal/issues/680]<br />
| See discussion for potential workarounds. It is not very easy or straightforward but may be possible to emulate Base Directory compliance.<br />
|-<br />
| [https://calibre-ebook.com/ calibre]<br />
| {{ic|~/Calibre Library}}<br />
|<br />
|<br />
|-<br />
| [[CUPS]]<br />
| {{ic|~/.cups}}<br />
| [http://www.cups.org/str.php?L4243]<sup>won't<br />
|<br />
|-<br />
| [[darcs]]<br />
| {{ic|~/.darcs}}<br />
| [http://bugs.darcs.net/issue2453]<br />
|<br />
|-<br />
| [[dbus]]<br />
| {{ic|~/.dbus}}<br />
| [https://bugs.freedesktop.org/show_bug.cgi?id=35887]<br />
| This should be avoidable with kdbus [citation needed].<br />
|-<br />
| [https://wiki.gnome.org/Apps/Dia Dia]<br />
| {{ic|~/.dia}}<br />
|<br />
|-<br />
| [[eclipse]]<br />
| {{ic|~/.eclipse}}<br />
| [https://bugs.eclipse.org/bugs/show_bug.cgi?id=200809]<br />
| Option {{ic|1=-Dosgi.configuration.area=@user.home/.config/..}} overrides but must be added to {{ic|"$ECLIPSE_HOME"/eclipse.ini"}} rather than command line which means you must have write access to {{ic|$ECLIPSE_HOME}}. (Arch Linux hard-codes {{ic|$ECLIPSE_HOME}} in {{ic|/usr/bin/eclipse}})<br />
|-<br />
| [https://www.gnu.org/software/emacs/ emacs]<br />
| {{ic|~/.emacs}}<br />
<br />
{{ic|~/.emacs.d}}<br />
| [http://debbugs.gnu.org/cgi/bugreport.cgi?bug=583]<br />
| It's possible to set {{ic|HOME}}, but it has unexpected side effects. So far the most promising approach is modifying another Emacs environment variable to alter the load path and author your own site file which can manually load up your init file, but it changes the load process significantly.<br />
|-<br />
| [http://www.fetchmail.info/ Fetchmail]<br />
| {{ic|~/.fetchmailrc}}<br />
|<br />
|<br />
|-<br />
| [[Firefox]]<br />
| {{ic|~/.mozilla}}<br />
| [https://bugzil.la/259356]<br />
|<br />
|-<br />
| [https://www.haskell.org/ghc/ GHC]<br />
| {{ic|~/.ghc}}<br />
| [https://ghc.haskell.org/trac/ghc/ticket/6077]<br />
|<br />
|-<br />
| [http://www.gnu.org/software/parallel/ GNU parallel]<br />
| {{ic|~/.parallel}}<br />
|<br />
|<br />
|-<br />
| [http://recordmydesktop.sourceforge.net/about.php gtk-recordMyDesktop]<br />
| {{ic|~/.gtk-recordmydesktop}}<br />
|<br />
|<br />
|-<br />
| [http://www.idris-lang.org/ idris]<br />
| {{ic|~/.idris}}<br />
| [https://github.com/idris-lang/Idris-dev/pull/3456]<br />
|<br />
|-<br />
| [http://julialang.org/ julia]<br />
| {{ic|~/.juliarc.jl}}<br />
<br />
{{ic|~/.julia_history}}<br />
| [https://github.com/JuliaLang/julia/issues/4630] [https://github.com/JuliaLang/julia/issues/10016]<br />
|<br />
|-<br />
| [http://www.linux-pam.org/ Linux PAM]<br />
| {{ic|~/.pam_environment}}<br />
| [https://github.com/linux-pam/linux-pam/issues/7]<br />
| Hardcoded in [https://github.com/linux-pam/linux-pam/blob/master/modules/pam_env/pam_env.c modules/pam_env/pam_env.c]<br />
|-<br />
| [http://lldb.llvm.org/ lldb]<br />
| {{ic|~/.lldb}}<br />
<br />
{{ic|~/.lldbinit}}<br />
|<br />
|<br />
|-<br />
| [http://www.mathomatic.org/ mathomatic]<br />
| {{ic|~/.mathomaticrc}}<br />
<br />
{{ic|~/.matho_history}}<br />
|<br />
| History can be moved by using {{ic|rlwrap mathomatic -r}} with the {{ic|RLWRAP_HOME}} environment set appropriately.<br />
|-<br />
| [http://www.milkytracker.org/ milkytracker]<br />
| {{ic|~/.milkytracker_config}}<br />
| [https://github.com/Deltafire/MilkyTracker/issues/12]<br />
|<br />
|-<br />
| [https://minecraft.net/ Minecraft]<br />
| {{ic|~/.minecraft}}<br />
| [https://bugs.mojang.com/browse/MCL-2563]<br />
|<br />
|-<br />
| [https://www.mongodb.org/ mongodb]<br />
| {{ic|~/.mongorc.js}}<br />
<br />
{{ic|~/.dbshell}}<br />
| [https://jira.mongodb.org/browse/DOCS-5652?jql=text%20~%20%22.mongorc.js%22]<br />
| [http://stackoverflow.com/a/22349050/4200039 This Stack Overflow thread] suggests a partial workaround using command-line switch {{ic|--norc}}.<br />
|-<br />
|<br />
| {{ic|~/.netrc}}<br />
|<br />
| Like {{ic|~/.ssh}}, many programs expect this file to be here. These include projects like curl ({{ic|CURLOPT_NETRC_FILE}}), ftp ({{ic|NETRC}}), s-nail ({{ic|NETRC}}), etc. While some of them offer alternative configurable locations, many do not such as w3m, wget and lftp.<br />
|-<br />
| [https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS NSS]<br />
| {{ic|~/.pki}}<br />
| [https://bugzilla.mozilla.org/show_bug.cgi?id=818686]<br />
|<br />
|-<br />
| [https://www.openssh.com/ OpenSSH]<br />
| {{ic|~/.ssh}}<br />
| [https://bugzilla.mindrot.org/show_bug.cgi?id=2050]<br />
| Assumed to be present by many ssh daemons and clients such as DropBear and OpenSSH.<br />
|-<br />
| [https://www.palemoon.org/ palemoon]<br />
| {{ic|~/.moonchild productions}}<br />
| [https://forum.palemoon.org/viewtopic.php?f=5&t=9639]<br />
|<br />
|-<br />
| [https://perf.wiki.kernel.org/index.php/Main_Page perf]<br />
| {{ic|~/.debug}}<br />
|<br />
| Hardcoded in [https://github.com/torvalds/linux/blob/master/tools/perf/util/config.c#L18 tools/perf/util/config.c:18].<br />
|-<br />
| various [[shell]]s and [[display manager]]s<br />
| {{ic|~/.profile}}<br />
|<br />
|<br />
|-<br />
| [[python]]<br />
| {{ic|~/.python_history}}<br />
|<br />
| All history from interactive sessions is saved to {{ic|~/.python_history}} by default since [https://bugs.python.org/issue5845 version 3.4], custom path can still be set the same way as in older versions (see [https://docs.python.org/3/library/readline.html?highlight=readline#example this example]).<br />
|-<br />
| [https://doc.qt.io/qt-5/qtdesigner-manual.html Qt Designer]<br />
| {{ic|~/.designer}}<br />
|<br />
|<br />
|-<br />
| [https://quodlibet.readthedocs.io/en/latest/ quodlibet]<br />
| {{ic|~/.quodlibet}}<br />
|<br />
|<br />
|-<br />
| [https://racket-lang.org/ racket]<br />
| {{ic|~/.racketrc}}<br />
|<br />
|<br />
|-<br />
| [http://rednotebook.sourceforge.net/ RedNotebook]<br />
| {{ic|~/.rednotebook}}<br />
|<br />
|<br />
|-<br />
| [https://remarkableapp.github.io/linux.html Remarkable]<br />
| {{ic|~/.remarkable}}<br />
|<br />
|<br />
|-<br />
| [https://www.scribus.net/ Scribus]<br />
| {{ic|~/.scribus}}<br />
|<br />
|-<br />
| [http://www.seamonkey-project.org/ SeaMonkey]<br />
| {{ic|~/.mozilla}}<br />
| [https://bugzil.la/726939]<br />
|<br />
|-<br />
| [[Skype]] < 5.0<br />
| {{ic|~/.Skype}}<br />
| [https://community.skype.com/t5/Linux-archive/Skype-violates-XDG-basedir-spec-on-linux/td-p/4175884]<br />
|<br />
|-<br />
| [https://www.gnu.org/software/solfege/solfege.html Solfege]<br />
| {{ic|~/.solfege}}<br />
<br />
{{ic|~/.solfegerc}}<br />
<br />
{{ic|~/lessonfiles}}<br />
| [https://savannah.gnu.org/bugs/index.php?50251]<br />
|<br />
|-<br />
| [https://spamassassin.apache.org/ SpamAssassin]<br />
| {{ic|~/.spamassassin}}<br />
|<br />
|<br />
|-<br />
| [[spectrwm]]<br />
| {{ic|~/.spectrwm}}<br />
|<br />
|<br />
|-<br />
| [[SQLite]]<br />
| {{ic|~/.sqlite_history}}<br />
<br />
{{ic|~/.sqliterc}}<br />
| [https://unix.stackexchange.com/questions/306890/change-location-of-sqlite-history-file][http://sqlite.1065341.n5.nabble.com/Customizing-the-location-of-the-sqlite-history-td87055.html]<br />
| {{ic|$ sqlite3 -init "$XDG_CONFIG_HOME"/sqlite3/sqliterc}}<br />
|-<br />
| [[Steam]]<br />
| {{ic|~/.steam}}<br />
{{ic|~/.steampath}}<br />
{{ic|~/.steampid}}<br />
| [https://github.com/ValveSoftware/steam-for-linux/issues/1890]<br />
|<br />
|-<br />
| [[TeamSpeak]]<br />
| {{ic|~/.ts3client}}<br />
|<br />
|-<br />
| [http://www.texmacs.org/ TeXmacs]<br />
| {{ic|~/.TeXmacs}}<br />
|<br />
|<br />
|-<br />
| [[Thunderbird]]<br />
| {{ic|~/.thunderbird}}<br />
| [https://bugzil.la/735285]<br />
|<br />
|-<br />
| [https://git.archlinux.org/users/remy/texlive-localmanager.git/ tllocalmgr]<br />
| {{ic|~/.texlive}}<br />
|<br />
|-<br />
| [[vim]]<br />
| {{ic|~/.vim}}<br />
<br />
{{ic|~/.vimrc}}<br />
<br />
{{ic|~/.viminfo}}<br />
|<br />
| Since [https://github.com/vim/vim/commit/6a459902592e2a4ba68 7.3.1178] vim will search for {{ic|~/.vim/vimrc}} if {{ic|~/.vimrc}} is not found.<br />
<br />
{{ic|1=<nowiki>$ mkdir -p "$XDG_CACHE_HOME"/vim/{undo,swap,backup}</nowiki>}}<br />
<br />
{{hc|"$XDG_CONFIG_HOME"/vim/vimrc|<br />
set undodir&#61;$XDG_CACHE_HOME/vim/undo<br />
set directory&#61;$XDG_CACHE_HOME/vim/swap<br />
set backupdir&#61;$XDG_CACHE_HOME/vim/backup<br />
set viminfo+&#61;'1000,n$XDG_CACHE_HOME/vim/viminfo<br />
set runtimepath&#61;$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIMRUNTIME<br />
}}<br />
<br />
{{hc|~/.profile|<br />
export VIMINIT&#61;":source $XDG_CONFIG_HOME"/vim/vimrc<br />
}}<br />
<br />
* https://tlvince.com/vim-respect-xdg<br />
|-<br />
| [http://www.vimperator.org/ vimperator]<br />
| {{ic|~/.vimperatorrc}}<br />
| [http://www.mozdev.org/pipermail/vimperator/2009-October/004848.html]<br />
| {{ic|1=$ export VIMPERATOR_INIT=":source $XDG_CONFIG_HOME/vimperator/vimperatorrc"}}<br />
<br />
{{ic|1=$ export VIMPERATOR_RUNTIME="$XDG_CONFIG_HOME"/vimperator}}<br />
|-<br />
| [https://w1.fi/ wpa_cli]<br />
| {{ic|~/.wpa_cli_history}}<br />
|<br />
|<br />
|-<br />
| {{pkg|xdg-utils}}<br />
| {{ic|~/.gnome}}<br />
|<br />
| For some reason the script {{ic|xdg-desktop-menu}} hard-codes {{ic|gnome_user_dir&#61;"$HOME/.gnome/apps"}}. This is used by [[chromium]] amoung others.<br />
|-<br />
| [https://opensource.conformal.com/wiki/xombrero xombrero]<br />
| {{ic|~/.xombrero}}<br />
| [https://github.com/conformal/xombrero/issues/74]<br />
|<br />
|-<br />
| {{pkg|yarn}}<br />
| {{ic|~/.yarnrc}}<br />
<br />
{{ic|~/.yarn/}}<br />
<br />
{{ic|~/.yarncache/}}<br />
<br />
{{ic|~/.yarn-config/}}<br />
| [https://github.com/yarnpkg/yarn/issues/2334]<br />
|<br />
|-<br />
| [[zsh]]<br />
| {{ic|~/.zshrc}}<br />
<br />
{{ic|~/.zprofile}} {{ic|~/.zshenv}}<br />
<br />
{{ic|~/.zlogin}} {{ic|~/.zlogout}}<br />
<br />
{{ic|~/.histfile}}<br />
| [http://www.zsh.org/mla/workers/2013/msg00692.html]<br />
| Consider exporting {{ic|1=ZDOTDIR=$HOME/.config/zsh}} in {{ic|~/.zshenv}} (this is hardcoded due to the bootstrap problem). You could also add this to {{ic|/etc/zsh/zshenv}} and avoid the need for any dotfiles in your {{ic|HOME}}. Doing this however requires root privilege which may not be viable and is system-wide.<br />
<br />
{{ic|1=$ export HISTFILE="$XDG_DATA_HOME"/zsh/history}}<br />
|}<br />
<br />
==Library and language support==<br />
<br />
; C<br />
: [https://github.com/Cloudef/chck/tree/master/chck/xdg C99: Cloudef's simple implementation].<br />
<br />
; Haskell<br />
: Officially in [https://hackage.haskell.org/package/directory directory] since 1.2.3.0 [https://github.com/haskell/directory/commit/ab9d0810ce ab9d0810ce].<br />
: [https://hackage.haskell.org/package/xdg-basedir xdg-basedir]<br />
<br />
; Perl<br />
: [http://search.cpan.org/dist/File-BaseDir/lib/File/BaseDir.pm File-BaseDir]<br />
: [https://github.com/Aerdan/perl-file-xdg perl-file-xdg]<br />
<br />
; Python<br />
: [http://freedesktop.org/wiki/Software/pyxdg/ pyxdg]<br />
<br />
; Vala<br />
: Builtin support via [http://valadoc.org/#!api=glib-2.0/GLib.Environment GLib.Environment].<br />
: See {{ic|get_user_cache_dir}}, {{ic|get_user_data_dir}}, {{ic|get_user_config_dir}}, etc.<br />
<br />
==See also==<br />
<br />
* [https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders GNOME Goal: XDG Base Directory Specification Usage]<br />
* [https://plus.google.com/+RobPikeTheHuman/posts/R58WgWwN9jp Rob Pike: "Dotfiles" being hidden is a UNIXv2 mistake].<br />
* [http://www.freedesktop.org/software/systemd/man/systemd-path.html systemd-path(1)]<br />
* [http://www.freedesktop.org/software/systemd/man/file-hierarchy.html file-hierarchy(7)]<br />
* [https://github.com/grawity/dotfiles/blob/master/.dotfiles.notes Grawity's notes on dotfiles].<br />
* [https://github.com/grawity/dotfiles/blob/master/.environ.notes Grawity's notes on environment variables].<br />
* [https://ploum.net/207-modify-your-application-to-use-xdg-folders/ ploum.net: Modify Your Application to use XDG Folders].</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Bisecting_bugs_with_Git&diff=483819Bisecting bugs with Git2017-08-05T03:05:18Z<p>GenkiSky: /* Reverting to an older release */ Change ALA link to go directly to article</p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Version Control System]]<br />
Often when reporting bugs encountered with projects such as Mesa or Linux kernel, a user may be asked to bisect between the last known version that worked for them and the newer version which is causing them problems in order to see what is the troublesome commit. On Arch this can be done fairly trivially thanks to the functionality of the [[AUR]].<br />
<br />
== Reverting to an older release ==<br />
<br />
It might be useful to confirm that it is the new package release that is causing the problem. [[Downgrading packages]] on Arch can be accomplished trivially as long as an older version of the package is still stored as cache on your system, or you can use [[Arch Linux Archive]].<br />
<br />
{{Note|Even if the older version fixes the problem it is still possible that is not a bug within the program, but a problem with the packages as provided by Arch.}}<br />
<br />
== Building package from git ==<br />
<br />
In order to bisect we are going to need to build a version of package from [[git]]. This can be accomplished by building the ''-git'' package from the [[AUR]].<br />
<br />
== Setting up the Bisect ==<br />
<br />
Once package is successfully built you need to change into the git root directory in the {{ic|src/}} directory. The name of the git root directory is often the same as {{ic|''pkgname''}} (or without the {{ic|-git}} suffix):<br />
<br />
$ cd src/''git_root''<br />
<br />
From there you can start the process of bisecting:<br />
<br />
$ git bisect start<br />
<br />
The following command will show you all the tags you can use to specify where to bisect:<br />
<br />
$ git tag<br />
<br />
Following on from the earlier example, we will assume that the version ''oldver'' worked for us while ''newver'' did not:<br />
<br />
$ git bisect good ''oldver''<br />
$ git bisect bad ''newver''<br />
<br />
Now that we have our good and bad versions tagged we can proceed to test commits.<br />
<br />
== Bisecting ==<br />
<br />
Change back into the directory with the PKGBUILD. If you are still in the directory mentioned in the previous section this can be accomplished like so:<br />
<br />
$ cd ../..<br />
<br />
You can now rebuild and install the specific revision of the package:<br />
<br />
$ makepkg -efsi<br />
<br />
{{Note|It is very important to keep the {{ic|-e}} prefix intact as otherwise it will remove all the changes you have made.}}<br />
<br />
Once the new package is installed you can test for your previously discovered error. Return to the directory you were in the previous section:<br />
<br />
$ cd src/''git_root''<br />
<br />
If you encountered your problem, tell that the revision was bad:<br />
<br />
$ git bisect bad<br />
<br />
If you did not encounter your problem, tell that the revision it was good:<br />
<br />
$ git bisect good<br />
<br />
Then do as described at the beginning of this section again and repeat until git bisect names the troublesome commit.<br />
{{Note|You may need to run a make clean after issuing the git bisect command.}}<br />
{{Note|It will actually count down the number of steps all the way down to zero, so it is important not to stop until it actually names the first bad commit.}}<br />
<br />
== Speeding up builds ==<br />
<br />
If you're bisecting the Linux kernel or another large project built using {{ic|gcc}}, you can reduce build times by enabling [[ccache]]. It may take several build iterations before you start to see benefits from the cache, however. The likelihood of cache hits generally increases as the distance between bisection points decreases.<br />
<br />
You can also shorten kernel build times by building only the modules required by the local system using [[modprobed-db]].<br />
<br />
== Restoring package ==<br />
<br />
Reverting to an original version of the package can be done by installing the package from repositories with [[pacman]].<br />
<br />
== See also ==<br />
<br />
* [http://git-scm.com/docs/git-bisect-lk2009.html Fighting regressions with git bisect]<br />
* [https://www.kernel.org/pub/software/scm/git/docs/git-bisect.html git-bisect(1)]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Bisecting_bugs_with_Git&diff=483818Bisecting bugs with Git2017-08-05T03:04:31Z<p>GenkiSky: /* Reverting to an older release */ Fix link to Arch Linux Rollback Machine (now known as Arch Linux Archive)</p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Version Control System]]<br />
Often when reporting bugs encountered with projects such as Mesa or Linux kernel, a user may be asked to bisect between the last known version that worked for them and the newer version which is causing them problems in order to see what is the troublesome commit. On Arch this can be done fairly trivially thanks to the functionality of the [[AUR]].<br />
<br />
== Reverting to an older release ==<br />
<br />
It might be useful to confirm that it is the new package release that is causing the problem. [[Downgrading packages]] on Arch can be accomplished trivially as long as an older version of the package is still stored as cache on your system, or you can use [[Downgrading_packages#Arch_Linux_Archive|Arch Linux Archive]].<br />
<br />
{{Note|Even if the older version fixes the problem it is still possible that is not a bug within the program, but a problem with the packages as provided by Arch.}}<br />
<br />
== Building package from git ==<br />
<br />
In order to bisect we are going to need to build a version of package from [[git]]. This can be accomplished by building the ''-git'' package from the [[AUR]].<br />
<br />
== Setting up the Bisect ==<br />
<br />
Once package is successfully built you need to change into the git root directory in the {{ic|src/}} directory. The name of the git root directory is often the same as {{ic|''pkgname''}} (or without the {{ic|-git}} suffix):<br />
<br />
$ cd src/''git_root''<br />
<br />
From there you can start the process of bisecting:<br />
<br />
$ git bisect start<br />
<br />
The following command will show you all the tags you can use to specify where to bisect:<br />
<br />
$ git tag<br />
<br />
Following on from the earlier example, we will assume that the version ''oldver'' worked for us while ''newver'' did not:<br />
<br />
$ git bisect good ''oldver''<br />
$ git bisect bad ''newver''<br />
<br />
Now that we have our good and bad versions tagged we can proceed to test commits.<br />
<br />
== Bisecting ==<br />
<br />
Change back into the directory with the PKGBUILD. If you are still in the directory mentioned in the previous section this can be accomplished like so:<br />
<br />
$ cd ../..<br />
<br />
You can now rebuild and install the specific revision of the package:<br />
<br />
$ makepkg -efsi<br />
<br />
{{Note|It is very important to keep the {{ic|-e}} prefix intact as otherwise it will remove all the changes you have made.}}<br />
<br />
Once the new package is installed you can test for your previously discovered error. Return to the directory you were in the previous section:<br />
<br />
$ cd src/''git_root''<br />
<br />
If you encountered your problem, tell that the revision was bad:<br />
<br />
$ git bisect bad<br />
<br />
If you did not encounter your problem, tell that the revision it was good:<br />
<br />
$ git bisect good<br />
<br />
Then do as described at the beginning of this section again and repeat until git bisect names the troublesome commit.<br />
{{Note|You may need to run a make clean after issuing the git bisect command.}}<br />
{{Note|It will actually count down the number of steps all the way down to zero, so it is important not to stop until it actually names the first bad commit.}}<br />
<br />
== Speeding up builds ==<br />
<br />
If you're bisecting the Linux kernel or another large project built using {{ic|gcc}}, you can reduce build times by enabling [[ccache]]. It may take several build iterations before you start to see benefits from the cache, however. The likelihood of cache hits generally increases as the distance between bisection points decreases.<br />
<br />
You can also shorten kernel build times by building only the modules required by the local system using [[modprobed-db]].<br />
<br />
== Restoring package ==<br />
<br />
Reverting to an original version of the package can be done by installing the package from repositories with [[pacman]].<br />
<br />
== See also ==<br />
<br />
* [http://git-scm.com/docs/git-bisect-lk2009.html Fighting regressions with git bisect]<br />
* [https://www.kernel.org/pub/software/scm/git/docs/git-bisect.html git-bisect(1)]</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Notmuch&diff=480115Notmuch2017-06-19T23:38:29Z<p>GenkiSky: /* Frontends */ Remove extraneous space</p>
<hr />
<div>[[Category:Email clients]]<br />
[[ja:Notmuch]]<br />
{{Related articles start}}<br />
{{Related|mutt}}<br />
{{Related articles end}}<br />
<br />
[http://notmuchmail.org/ Notmuch] is a mail indexer. Essentially, is a very thin front end on top of ''xapian''.<br />
Much like [[Sup]], it focuses on one thing: indexing your email messages. Notmuch can be used as an email reader, or simply as an indexer and search tool for other MUAs, like [[mutt]].<br />
<br />
==Overview==<br />
Notmuch is written in C and an order of magnitude faster than sup-mail.<br />
Notmuch can be terminated during the indexing process, on the next run it will continue where it left off.<br />
Also like sup-mail, it does not provide a way to permanently delete unwanted email messages (however, see [[#Permanently delete emails]]).<br />
It doesn't fetch or send mails, nor does it store your email addresses, you'll need to use programs like [[OfflineIMAP]], [[msmtp]] and ''abook'' for those tasks.<br />
<br />
Notmuch is available in the [[official repositories]]: {{Pkg|notmuch}} or {{AUR|notmuch-git}} from the [[AUR]]<br />
<br />
It provides [[python]], [[vim]], and [[emacs]] bindings.<br />
<br />
==First time Usage==<br />
After installation, you enter an interactive setup by running:<br />
notmuch setup<br />
The program prompts you for the location of your maildir and your primary and secondary email addresses. You can also edit the config file directly which is created by default at {{ic|$HOME/.notmuch-config}}.<br />
<br />
Subsequent re-indexing of the mail directories is done with:<br />
notmuch new<br />
<br />
==Frontends==<br />
There are [http://notmuchmail.org/frontends/ a range of ways to use notmuch], including cli, or with one of the Unix $EDITORS:<br />
<br />
===Emacs===<br />
The default frontend for notmuch is Emacs. It is developed by the same people that develop notmuch.<br />
<br />
===Vim===<br />
There's a vim interface available and included in notmuch. To start it, type:<br />
vim -c NotMuch<br />
<br />
===alot===<br />
alot is a standalone CLI interface for notmuch, written in python. It is available from [[AUR]] as {{AUR|alot}} or {{AUR|alot-git}}.<br />
<br />
Alot uses [[wikipedia:Mailcap|mailcap]] for handling different kinds of files. This currently includes html mails, which means that you need to configure a {{Ic|~/.mailcap}} file in order to view html mails. As minimum, put this line into your {{Ic|~/.mailcap}}:<br />
<br />
text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput<br />
<br />
This uses {{Pkg|w3m}}, some other text based clients such as {{Pkg|links}} or {{Pkg|lynx}} can be used instead, although their arguments might differ.<br />
<br />
More file handlers can be configured of course.<br />
<br />
===bower===<br />
[https://github.com/wangp/bower bower] is another CLI interface, this one is written in [https://mercurylang.org/ Mercury].<br />
<br />
===Neomutt===<br />
[http://www.neomutt.org/ Neomutt] - Another mutt fork which includes many feature patches, among them the [http://www.neomutt.org/feature/notmuch Notmuch] integration patch. Install from the [[AUR]] as {{AUR|neomutt}} or {{AUR|neomutt-git}}.<br />
<br />
===astroid===<br />
<br />
[https://github.com/astroidmail/astroid Astroid] is a graphical MUA and interface to notmuch written using C++ and GTK+. {{AUR|astroid}} (stable) and {{AUR|astroid-git}} (VCS) packages are available in [[AUR]]. The GUI is designed to be very fast, preview HTML and attachments, be navigable by keyboard. It is extensively configurable and you use your favorite editor either embedded or launch it externally. Check out the [https://github.com/astroidmail/astroid/wiki Tour] to see how astroid can be used and for a description of the complete setup, or check out the [https://github.com/astroidmail/astroid README] for more information.<br />
<br />
===ner===<br />
[http://the-ner.org/ ner] - notmuch email reader - is yet another CLI interface, apparently written in C++.<br />
<br />
{{AUR|ner-git}}{{Broken package link|{{aur-mirror|ner-git}}}} is available from the [[AUR]].<br />
<br />
==Integrating with mutt==<br />
If you use [[mutt]] as your MUA, then notmuch is an excellent complementary tool to index and search your mail. The {{Pkg|notmuch-mutt}} package provides a script to integrate notmuch with mutt.<br />
<br />
After installing the {{Pkg|notmuch-mutt}} package and configuring notmuch, the only thing left before using notmuch to search from mutt is adding keybindings to call the <code>notmuch-mutt</code> perl script from mutt. Adding the following to your <code>.muttrc</code> is what is recommended in notmuch contrib source:<br />
<br />
macro index <F8> \<br />
"<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --prompt search<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>" \<br />
"notmuch: search mail"<br />
macro index <F9> \<br />
"<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thread<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter><enter-command>set wait_key<enter>" \<br />
"notmuch: reconstruct thread"<br />
macro index <F6> \<br />
"<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag -inbox<enter>" \<br />
"notmuch: remove message from inbox"<br />
<br />
The above uses <code>F8</code> to search your inbox using notmuch, <code>F9</code> to create threads from search results, and <code>F6</code> to tag search results.<br />
<br />
===notmuch-mutt problems===<br />
There can sometimes be disagreement between pacman-installed and managed perl modules and perl modules installed via cpan/cpanm. An error message of the format:<br />
Gnu.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xdb80080)<br />
can indicate that some of the notmuch-mutt dependencies are installed via cpan while some are installed and managed via pacman, and that you should install all dependencies via one or the other method.<br />
<br />
==Integrating with NeoMutt / mutt-kz==<br />
If you use either {{AUR|neomutt}}, {{AUR|mutt-kz}} or mutt with notmuch-patches, the {{Pkg|notmuch-mutt}} package is not needed. Instead, create a {{Ic|~/.mailboxes}} with some basic (virtual) mailboxes. A virtual mailbox is not an actual folder, but the result of a notmuch query for a specific tag:<br />
{{hc|~/.mailboxes|2=<br />
virtual-mailboxes "inbox" "notmuch://?query=tag:inbox"<br />
virtual-mailboxes "archive" "notmuch://?query=tag:archive"<br />
virtual-mailboxes "sent" "notmuch://?query=tag:sent"<br />
virtual-mailboxes "newsletters" "notmuch://?query=tag:newsletters"<br />
}}<br />
Next, make mutt aware of your virtual mailboxes by enabling virtual spoolfile and sourcing the latter:<br />
{{hc|~/.muttrc|2=<br />
set virtual_spoolfile=yes<br />
source ~/.mailboxes<br />
}}<br />
At this point, mutt will still list your mailboxes as empty, because your mails are not yet tagged and thus, notmuch querys are empty. To fill your vitual mailboxes, you need to initially tag the messages in your maildir. A very simple approach is to create a shell script like the following:<br />
{{hc|~/.scripts/notmuch-hook.sh|2=<br />
#!/bin/sh<br />
notmuch new<br />
# retag all "new" messages "inbox" and "unread"<br />
notmuch tag +inbox +unread -new -- tag:new<br />
# tag all messages from "me" as sent and remove tags inbox and unread<br />
notmuch tag -new -inbox +sent -- from:me@example.org or from:me@myself.com<br />
# tag newsletters, but dont show them in inbox<br />
notmuch tag +newsletters +unread -new -- from:newsletter@example.org or subject:'newsletter*'<br />
}}<br />
Make the shell script executable and run it:<br />
chmod +x ~/.scripts/notmuch-hook.sh<br />
~/.scripts/notmuch-hook.sh<br />
For the above example to work, make sure that notmuch tags new messages as 'new':<br />
{{hc|~/.notmuch-config|2=<br />
[new]<br />
tags=new<br />
}}<br />
Finally, your hook script needs to rerun on new mail arrival. If you use {{Pkg|offlineimap}} to sync IMAP to a local maildir, create a post sync hook:<br />
{{hc|~/.offlineimaprc|2=<br />
[Account myaccount]<br />
postsynchook = ~/.scripts/notmuch-hook.sh<br />
}}<br />
Some useful key bindings:<br />
{{hc|~/.muttrc|2=<br />
macro index A "<modify-labels>+archive -unread -inbox\\n" "Archive message"<br />
macro index c "<change-vfolder>?" "Change to vfolder overview"<br />
macro index \\\\ "<vfolder-from-query>" "Search mailbox"<br />
}}<br />
<br />
==Permanently delete emails==<br />
<br />
One choice is to maintain a tag of emails you wish to remove from your disk, for example, "killed". Then, you can run this to delete them permanently:<br />
notmuch search --output=files tag:killed | xargs -r rm<br />
notmuch new</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Advanced_Linux_Sound_Architecture/Troubleshooting&diff=474458Advanced Linux Sound Architecture/Troubleshooting2017-04-17T20:33:18Z<p>GenkiSky: /* Simultaneous playback problems */ Add note about dmix for "vanilla" ALSA</p>
<hr />
<div>[[Category:Sound]]<br />
[[ja:Advanced Linux Sound Architecture/トラブルシューティング]]<br />
See [[Advanced Linux Sound Architecture]] for the main article.<br />
<br />
== Volume ==<br />
<br />
=== Output is muted after reboot ===<br />
<br />
Run the following command:<br />
<br />
# alsactl restore<br />
<br />
If the problem persists, verify that the {{ic|Auto-Mute}} option in ''alsamixer'' is set to {{ic|Disabled}}.<br />
<br />
=== Volume is too low ===<br />
<br />
Run ''alsamixer'' and try to increase the value of the sliders, unmuting channels if necessary. Note that if you have many sliders, you may have to scroll to the right to see any missing sliders.<br />
<br />
If all the sliders are maxed out, and the volume is still too low, you can try running the following [http://www.alsa-project.org/hda-analyzer.py script] to reset your codec settings:<br />
<br />
$ wget http://www.alsa-project.org/hda-analyzer.py<br />
$ su -c 'python2 hda-analyzer.py'<br />
<br />
The script assumes that {{ic|/usr/bin/python}} refers to Python 2, which is incorrect on Arch by default. To avoid this issue run the following command:<br />
<br />
$ sed -i 's/python %s/python2 %s/' hda-analyzer.py<br />
<br />
Close the analyzer, and when prompted as to whether you want to reset the codecs, say "yes".<br />
<br />
If the volume is *still* too low, run ''alsamixer'' again: resetting the codecs may have caused new sliders to become enabled and some of them may be set to a low value.<br />
<br />
=== Low Sound Volume ===<br />
<br />
If you are facing low sound even after maxing out your speakers/headphones, you can give the softvol plugin a try. Add the following to {{ic|/etc/asound.conf}}.<br />
{{bc|1=<br />
pcm.!default {<br />
type plug<br />
slave.pcm "softvol"<br />
}<br />
<br />
pcm.softvol {<br />
type softvol<br />
slave {<br />
pcm "dmix"<br />
}<br />
control {<br />
name "Pre-Amp"<br />
card 0<br />
}<br />
min_dB -5.0<br />
max_dB 20.0<br />
resolution 6<br />
}<br />
}}<br />
<br />
{{Note|You will probably have to restart the computer, as restarting the alsa daemon did not load the new configuration for me. Also, if the configuration does not work even after restarting, try changing {{ic|plug}} with {{ic|hw}} in the above configuration.}}<br />
<br />
After the changes are loaded successfully, you will see a {{ic|Pre-Amp}} section in alsamixer. You can adjust the levels there.<br />
{{Note|<br />
* Setting a high value for {{ic|Pre-Amp}} can cause sound distortion, so adjust it according to the level that suits you.<br />
* Some audio codecs may need to have settings adjusted in the HDA Analyzer (see [[#Volume is too low]]) in order to achieve proper volume without distortion. Checking the HP option under widget control in the Playback Switch (Node[0x14] PIN in the ALC892 codec, for instance) can sometimes improve audio quality and volume significantly.<br />
}}<br />
<br />
=== Random lack of sound on startup ===<br />
<br />
You can quickly test sound by running {{ic|speaker-test}}. If there is no sound, the error message might look something like<br />
<br />
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave<br />
Playback open error: -16<br />
Device or resource busy<br />
<br />
If you have no sound on startup, this may be because your system has multiple sound cards, and their order may sometimes change on startup. If this is the case, try [[ALSA#Set the default sound card|setting the default sound card]].<br />
<br />
If you use mpd and the configuration tips above do not work for you, try [http://mpd.wikia.com/wiki/Configuration#ALSA_MPD_software_volume_control reading this] instead.<br />
<br />
== Microphone ==<br />
<br />
=== No microphone input ===<br />
<br />
In alsamixer, make sure that all the volume levels are up under recording, and that CAPTURE is toggled active on the microphone (e.g. Mic, Internal Mic) and/or on Capture (in alsamixer, select these items and press space). Try making positive Mic Boost and raising Capture and Digital levels higher; this make make static or distortion, but then you can adjust them back down once you are hearing ''something'' when you record<br />
<br />
As the pulseaudio wrapper is shown as "default" in alsamixer, you may have to press F6 to select your actual soundcard first. You may also need to enable and increase the volume of Line-in in the Playback section.<br />
<br />
To test the microphone, run these commands (see arecord's man page for further information):<br />
<br />
$ arecord -d 5 -f dat test-mic.wav<br />
$ aplay test-mic.wav<br />
<br />
Alternatively, you can run this command:<br />
<br />
$ arecord -vv -f dat /dev/null<br />
<br />
alongside alsamixer to easily identify channel which you should select and unmute.<br />
<br />
<br />
If all fails, you may want to eliminate hardware failure by testing the microphone with a different device.<br />
<br />
For at least some computers, muting a microphone (MM) simply means its input does not go immediately to the speakers. It still receives input.<br />
<br />
Many Dell laptops need "-dmic" to be appended to the model name in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options snd-hda-intel model=dell-m6-dmic<br />
<br />
Some programs use try to use OSS as the main input software. If you have enabled the {{ic|snd_pcm_oss}}, {{ic|snd_mixer_oss}} or {{ic|snd_seq_oss}} [[kernel modules]] previously (they are not loaded by default), try unloading them.<br />
<br />
See also:<br />
* http://www.alsa-project.org/main/index.php/SoundcardTesting<br />
* http://alsa.opensrc.org/Record_from_mic<br />
<br />
=== Setting the default microphone/capture device ===<br />
<br />
Some applications (Pidgin, Adobe Flash) do not provide an option to change the capture device. It becomes a problem if your microphone is on a separate device (e.g. USB webcam or microphone) than your internal sound card. To change only the default capture device, leaving the default playback device as is, you can modify your {{ic|~/.asoundrc}} file to include the following:<br />
<br />
{{bc|<br />
pcm.usb<br />
{<br />
type hw<br />
card U0x46d0x81d<br />
}<br />
<br />
pcm.!default<br />
{<br />
type asym<br />
playback.pcm<br />
{<br />
type plug<br />
slave.pcm "dmix"<br />
}<br />
capture.pcm<br />
{<br />
type plug<br />
slave.pcm "usb"<br />
}<br />
}<br />
}}<br />
<br />
Replace "U0x46d0x81d" with your capture device's card name in ALSA. You can use {{ic|arecord -L}} to list all the capture devices detected by ALSA.<br />
<br />
=== Internal microphone not working ===<br />
<br />
First make sure the volume is enabled under the {{ic|Capture}} view in ''alsamixer''. In some case, the "Internal Microphone" is not displayed in the capture list available when pressing F4. If so, specifying the card number given by {{ic|aplay -l}} to start ''alsamixer'' (for example {{ic|alsamixer -c 0}} ) can make it appear. <br />
<br />
<br />
Then add the following to {{ic|/etc/modprobe.d/snd-hda-intel.conf}}:<br />
<br />
options snd-hda-intel enable_msi=1<br />
<br />
Then reload the module:<br />
<br />
# rmmod snd-hda-intel && modprobe snd-hda-intel<br />
<br />
Now there should be an additional input under the previously mentioned {{ic|Capture}} view.<br />
<br />
=== Crackling microphone ===<br />
<br />
If you are getting a crackling or popping from your microphone that cannot be resolved with ALSA settings or cleaning your microphone jack, try adding the following line to {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
options snd-hda-intel model=MODEL position_fix=3<br />
<br />
This option will fix crackling on pure ALSA, but will cause issues to pulseaudio. To let Pulse use these settings effectively, edit {{ic|/etc/pulse/default.pa}} and find this line:<br />
<br />
load-module module-udev-detect<br />
<br />
And change it to this:<br />
<br />
load-module module-udev-detect tsched=0<br />
<br />
See the DMA-Position Problem in the kernel docs.<br />
<br />
* [https://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio.txt HD-audio Kernel Docs]<br />
<br />
== Audio Quality ==<br />
<br />
=== Crackling sound through mini-jack (headphones connector) ===<br />
<br />
Whether you followed [[Advanced_Linux_Sound_Architecture#Simultaneous_output|simultaneous output tip]] or managed to get it done on your own, you might get crackling sound through headphones or external speakers. This can be fixed by muting '''or''' setting volume to 0% on item '''Mic'''. Use {{ic|alsamixer}} or {{ic|amixer}}:<br />
$ amixer sset "Mic" 0%<br />
$ amixer sset "Mic" mute<br />
<br />
=== Popping sound after resuming from suspension ===<br />
<br />
You might hear a popping sound after resuming the computer from suspension. This can be fixed by editing {{ic|/etc/pm/sleep.d/90alsa}} and removing the line that says {{ic|aplay -d 1 /dev/zero}}<br />
<br />
=== Sound skipping during playback ===<br />
<br />
Run ''alsamixer'', and if channels exist for nonexistent output devices then disable them (e.g. ''alsamixer'' showing a center speaker but you not having one).<br />
<br />
=== Poor sound quality or clipping ===<br />
<br />
If you experience poor sound quality, try setting the PCM volume (in alsamixer) to a level such that gain is 0.<br />
<br />
If snd-usb-audio driver has been loaded, you could try to enable {{ic|softvol}} in {{ic|/etc/asound.conf}} file. Example configuration for the first audio device:<br />
<br />
{{bc|1=<br />
pcm.!default {<br />
type plug<br />
slave.pcm "softvol"<br />
}<br />
pcm.dmixer {<br />
type dmix<br />
ipc_key 1024<br />
slave {<br />
pcm "hw:0"<br />
period_size 4096<br />
buffer_size 131072<br />
rate 50000<br />
}<br />
bindings {<br />
0 0<br />
1 1<br />
}<br />
}<br />
pcm.dsnooper {<br />
type dsnoop<br />
ipc_key 1024<br />
slave {<br />
pcm "hw:0"<br />
channels 2<br />
period_size 4096<br />
buffer_size 131072<br />
rate 50000<br />
}<br />
bindings {<br />
0 0<br />
1 1<br />
}<br />
}<br />
pcm.softvol {<br />
type softvol<br />
slave { pcm "dmixer" }<br />
control {<br />
name "Master"<br />
card 0<br />
}<br />
}<br />
ctl.!default {<br />
type hw<br />
card 0<br />
}<br />
ctl.softvol {<br />
type hw<br />
card 0<br />
}<br />
ctl.dmixer {<br />
type hw<br />
card 0<br />
}<br />
}}<br />
<br />
=== Pops when starting and stopping playback ===<br />
<br />
Some modules (e.g. snd_ac97_codec and snd_hda_intel) can power off your sound card when not in use. This can make an audible noise (like a crack/pop/scratch) when turning on/off your sound card. Sometimes even when move the slider volume, or open and close windows (KDE4). If you find this annoying try {{ic|modinfo snd_MY_MODULE}}, and look for a module option that adjusts or disables this feature.<br />
<br />
''Example'': disable the power saving mode and solve cracking sound trough speakers problem, using snd_hda_intel add in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options snd_hda_intel power_save=0<br />
or:<br />
options snd_hda_intel power_save=0 power_save_controller=N<br />
<br />
You can also try it with {{ic|1=modprobe snd_hda_intel power_save=0}} before.<br />
<br />
You may also have to unmute the 'Line' ALSA channel for this to work. Any value will do (other than '0' or something too high).<br />
<br />
''Example:'' on an onboard VIA VT1708S (using the snd_hda_intel module) these cracks occured even though 'power_save' was set to 0. Unmuting the 'Line' channel and setting a value of '1' solved the problem.<br />
<br />
Source: https://www.kernel.org/doc/Documentation/sound/alsa/powersave.txt<br />
<br />
If you use a laptop, pm-utils will change {{ic|power_save}} back to 1 when you go onto battery power even if you disable power saving in {{ic|/etc/modprobe.d}}. Disable this for pm-utils by disabling the script that makes the change (see [[Pm-utils#Disabling_a_hook|Disabling a hook]] for more information):<br />
# touch /etc/pm/power.d/intel-audio-powersave<br />
<br />
=== Sound skipping while using dynamic CPU frequency scaling ===<br />
<br />
Some combinations of ALSA drivers and chipsets may cause audio from all sources to skip when used in combination with a dynamic frequency scaling governor such as {{ic|ondemand}} or {{ic|conservative}}. Currently, the solution is to switch back to the {{ic|performance}} governor.<br />
<br />
Refer to the [[CPU frequency scaling]] for more information.<br />
<br />
== Hardware and Cards ==<br />
<br />
=== Verifying output parameters ===<br />
<br />
Check the contents of {{ic|/proc/asound/cardX/pcmYp/subZ/hw_params}}, where {{ic|X}}, {{ic|Y}}, and {{ic|Z}} are system dependent.<br />
In order to find this file, execute the following command while outputting anything via ALSA:<br />
$ find /proc/asound/ -name hw_params | xargs -I FILE grep -v -l "closed" FILE | grep '/proc/asound/card./pcm.p/sub./hw_params'<br />
If nothing is playing there should be no results.<br />
<br />
Here is an example output for audio with a [[Wikipedia:Audio_bit_depth|bit depth]] of 24 bits and a [[Wikipedia:Sampling frequency|sampling frequency]] of 44.1 kilohertz:<br />
{{hc|cat /proc/asound/card1/pcm0p/sub0/hw_params|<br />
access: RW_INTERLEAVED<br />
format: S24_3LE<br />
subformat: STD<br />
channels: 2<br />
rate: 44100 (44100/1)<br />
period_size: 5513<br />
buffer_size: 22050<br />
}}<br />
<br />
More info is available in the [http://alsa.opensrc.org/Proc_asound_documentation ALSA documentation].<br />
<br />
=== Error 'Unknown hardware' appears after kernel update ===<br />
<br />
The following messages may be displayed during ALSA's initialization:<br />
Unknown hardware "foo" "bar" ...<br />
Hardware is initialized using a guess method<br />
/usr/bin/alsactl: set_control:nnnn:failed to obtain info for control #mm (No such file or directory)<br />
<br />
or:<br />
Found hardware: "HDA-Intel" "VIA VT1705" "HDA:11064397,18490397,00100000" "0x1849" "0x0397"<br />
Hardware is initialized using a generic method<br />
/usr/bin/alsactl: set_control:1328: failed to obtain info for control #1 (No such file or directory)<br />
/usr/bin/alsactl: set_control:1328: failed to obtain info for control #2 (No such file or directory)<br />
/usr/bin/alsactl: set_control:1328: failed to obtain info for control #25 (No such file or directory)<br />
/usr/bin/alsactl: set_control:1328: failed to obtain info for control #26 (No such file or directory)<br />
<br />
Simply store ALSA mixer settings again:<br />
# alsactl -f /var/lib/alsa/asound.state store<br />
<br />
It may be necessary configure ALSA again with alsamixer<br />
<br />
=== Fix wrong audio pin mapping ===<br />
<br />
If the mappings to your audio pins(plugs) do not correspond but ALSA works fine, you could try HDA Analyzer -- a pyGTK2 GUI for HD-audio control can be found [http://www.alsa-project.org/main/index.php/HDA_Analyzer at the ALSA wiki].<br />
Try tweaking the Widget Control section of the PIN nodes, to make microphones IN and headphone jacks OUT. Referring to the Config Defaults heading is a good idea.<br />
<br />
{{Note|The script is incompatible with Python 3, which is the default Python implementation on Arch Linux. In order to use the script, replace all occurrences of {{ic|python}} in the {{ic|run.py}} file with {{ic|python2}} to point the script to the Python 2 version. Then make the script [[chmod|executable]] and run it.}}<br />
<br />
=== S/PDIF output does not work ===<br />
<br />
If the optical/coaxial digital output of your motherboard/sound card is not working or stopped working, and have already enabled and unmuted it in alsamixer, try running the following:<br />
$ iecset audio on<br />
<br />
You can also put this command in an enabled [[systemd]] service as it sometimes it may stop working after a reboot.<br />
<br />
=== Conflicting PC speaker ===<br />
<br />
If you are sure nothing is muted, that your drivers are installed correctly, and that your volume is right, but you still do not hear anything, then try adding the following line to {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
options snd-NAME-OF-MODULE ac97_quirk=0<br />
<br />
The above fix has been observed to work with {{ic|via82xx}}<br />
options snd-NAME-OF-MODULE ac97_quirk=1<br />
The above fix has been reported to work with {{ic|snd-intel8x0}}<br />
<br />
{{Poor writing|Duplicated sections (e.g. for microphone) should be merged with eachother}}<br />
<br />
=== HP TX2500 ===<br />
<br />
Add these 2 lines into {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
options snd-cmipci mpu_port=0x330 fm_port=0x388<br />
options snd-hda-intel index=0 model=toshiba position_fix=1<br />
options snd-hda-intel model=hp (works for tx2000cto)<br />
<br />
=== No sound when S/PDIF video card is installed ===<br />
<br />
Discover available modules and their order:<br />
<br />
{{hc|$ cat /proc/asound/modules|<br />
0 snd_hda_intel<br />
1 snd_ca0106<br />
}}<br />
<br />
Disable the undesired video card audio codec in {{ic|/etc/modprobe.d/modprobe.conf}}:<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|<br />
install snd_hda_intel /bin/false<br />
}}<br />
<br />
If both devices use the same module then we can use the {{ic|enable}} parameter from snd_hda_intel module; it is an array of booleans that can enable/disable the desired sound card.<br />
<br />
options snd_hda_intel enable=1,0<br />
<br />
=== Wrong sound card model type ===<br />
<br />
Although ALSA detects your soundcard through the BIOS, at times ALSA may not be able to recognize your [http://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt model type]. The soundcard chip can be found in {{ic|alsamixer}} (e.g. ALC662) and the model can be set in {{ic|/etc/modprobe.d/modprobe.conf}} or {{ic|/etc/modprobe.d/sound.conf}}. For example:<br />
options snd-hda-intel model=MODEL<br />
<br />
There are other model settings too. For most cases ALSA defaults will do. If you want to look at more specific settings for your soundcard take a look at the [http://bugtrack.alsa-project.org/main/index.php/Matrix:Main ALSA Soundcard List] find your model, then Details, then look at the "Setting up modprobe..." section. Enter these values in {{ic|/etc/modprobe.d/modprobe.conf}}. For example, for an Intel AC97 audio:<br />
<br />
{{bc|<br />
# ALSA portion<br />
alias char-major-116 snd<br />
alias snd-card-0 snd-intel8x0<br />
# module options should go here<br />
<br />
# OSS/Free portion<br />
alias char-major-14 soundcore<br />
alias sound-slot-0 snd-card-0<br />
<br />
# card #1<br />
alias sound-service-0-0 snd-mixer-oss<br />
alias sound-service-0-1 snd-seq-oss<br />
alias sound-service-0-3 snd-pcm-oss<br />
alias sound-service-0-8 snd-seq-oss<br />
alias sound-service-0-12 snd-pcm-oss<br />
}}<br />
<br />
=== Intel onboard sound ===<br />
<br />
==== No sound with onboard Intel sound card ====<br />
<br />
There may be a problem with two conflicting modules loaded, namely {{ic|snd-intel8x0}} and {{ic|snd-intel8x0m}}. In this case, blacklist {{ic|snd-intel8x0m}}:<br />
<br />
{{hc|/etc/modprobe.d/modprobe.conf|blacklist snd-intel8x0m}}<br />
<br />
''Muting'' the "External Amplifier" in {{ic|alsamixer}} or {{ic|amixer}} may also help. See [http://alsa.opensrc.org/Intel8x0#Dell_Inspiron_8600_.28and_probably_others.29 the ALSA wiki].<br />
<br />
Unmuting the "Mix" setting in the mixer might help, also.<br />
<br />
==== No headphone sound with onboard intel sound card ====<br />
<br />
With '''Intel Corporation 82801 I (ICH9 Family) HD Audio Controller''' on laptop, you may need to add this line to modprobe or sound.conf:<br />
<br />
options snd-hda-intel model=''model''<br />
<br />
Where ''model'' is any one of the following:<br />
<br />
* dell-m6<br />
* dell-vostro<br />
* generic<br />
* laptop<br />
* laptop-hpsense<br />
* olpc-xo-1_5<br />
<br />
{{Note|It may be necessary to put this "options" line below (after) any "alias" lines about your card.}}<br />
<br />
You can see all the available models in the kernel documentation. For example [http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/Documentation/sound/alsa/HD-Audio-Models.txt here], but check that it is the correct version of that document for your kernel version.<br />
<br />
A list of available models is also available [http://www.mjmwired.net/kernel/Documentation/sound/alsa/HD-Audio-Models.txt here]. To know your chip name type the following command (with * being corrected to match your files). Note that some chips could have been renamed and do not directly match the available ones in the file.<br />
<br />
$ grep Codec /proc/asound/card*/codec*<br />
<br />
Note that there is a high chance none of the input devices (all internal and external mics) will work if you choose to do this, so it is either your headphones or your mic. Please report to ALSA if you are affected by this bug.<br />
<br />
And also, if you have problems getting beeps to work (pcspkr):<br />
<br />
options snd-hda-intel model=$model enable=1 index=0<br />
<br />
=== HDMI ===<br />
<br />
==== HDMI Output does not work ====<br />
<br />
The procedure described below can be used to test HDMI audio. Before proceeding, make sure you have enabled and unmuted the output with {{ic|alsamixer}}.<br />
<br />
{{Note|If you are using an AMD card a necessary kernel module is disabled by default. See [[ATI#HDMI audio]].}}<br />
<br />
Connect your PC to the Display via HDMI cable and enable the display with [[xrandr]].<br />
<br />
Use {{ic|aplay -l}} to get the discover the card and device number. For example:<br />
<br />
{{hc|$ aplay -l|2=<br />
**** List of PLAYBACK Hardware Devices ****<br />
card 0: SB [HDA ATI SB], device 0: ALC892 Analog [ALC892 Analog]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
card 0: SB [HDA ATI SB], device 1: ALC892 Digital [ALC892 Digital]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
'''card 1''': Generic [HD-Audio Generic], '''device 3''': HDMI 0 [HDMI 0]<br />
Subdevices: 1/1<br />
Subdevice #0: subdevice #0<br />
}}<br />
<br />
Send sound to the device. Following the example in the previous step, you would send sound to {{ic|'''card 1'''}}, {{ic|'''device 3'''}}:<br />
<br />
$ aplay -D plughw:1,3 /usr/share/sounds/alsa/Front_Center.wav<br />
<br />
If aplay does not output any errors, but still no sound is heard, "reboot" the receiver, monitor or tv set. Since the HDMI interface executes a handshake on connection, it might have noticed before that there was no audio stream embedded, and disabled audio decoding. If you are using a standalone window manager, you may need to have sound playing while plugging in the HDMI cable.<br />
<br />
mplay and other application could be configured to use special HDMI device as audio output. But flashplugin could only use default device. The following method is used to override default device. But you need to change it back when your TV is disconnected from HDMI port.<br />
<br />
If the test is successful, create or edit your {{ic|~/.asoundrc}} file to set HDMI as the default audio device.<br />
<br />
{{hc|~/.asoundrc|<br />
pcm.!default {<br />
type hw<br />
card 1<br />
device 3<br />
}<br />
}}<br />
<br />
Or if the above configuration does not work try:<br />
<br />
{{hc|~/.asoundrc|<br />
defaults.pcm.card 1<br />
defaults.pcm.device 3<br />
defaults.ctl.card 1<br />
}}<br />
<br />
==== PCM through HDMI does not work (Intel Gfx) ====<br />
<br />
As of Linux 3.1 multi-channel PCM output through HDMI with a Intel card (Intel Eaglelake, IbexPeak/Ironlake,SandyBridge/CougarPoint and IvyBridge/PantherPoint) is not yet supported. Support for it has been recently added and expected to be available in Linux 3.2. To make it work in Linux 3.1 you need to apply the following patches:<br />
<br />
* [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=76adaa34db407f174dd06370cb60f6029c33b465 drm: support routines for HDMI/DP ELD]<br />
* [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=e0dac65ed45e72fe34cc7ccc76de0ba220bd38bb drm/i915: pass ELD to HDMI/DP audio driver]<br />
<br />
==== HDMI 5.1 sound goes to wrong speakers ====<br />
<br />
Sound can be redirected to the intended speakers using ALSA's {{ic|remap}} function. To do so, add the following to {{ic|/etc/asound.conf}}:<br />
<br />
{{bc|1=<br />
pcm.!hdmi-remap {<br />
type asym<br />
playback.pcm {<br />
type plug<br />
slave.pcm "remap-surround51"<br />
}<br />
}<br />
<br />
pcm.!remap-surround51 {<br />
type route<br />
slave.pcm "hw:0,3"<br />
ttable {<br />
0.0= 1<br />
1.1= 1<br />
2.4= 1<br />
3.5= 1<br />
4.2= 1<br />
5.3= 1<br />
}<br />
}<br />
}}<br />
<br />
== Applications ==<br />
<br />
=== SDL: No sound with SDL applications ===<br />
<br />
If you get no sound using SDL based applications, try setting the [[environment variable]] {{ic|SDL_AUDIODRIVER}} to {{ic|alsa}}.<br />
<br />
=== OpenAL: No sound in applications that use OpenAL ===<br />
<br />
Openal defaults to pulseaudio, to change the order, add the following configuration to {{ic|/etc/openal/alsoft.conf}}:<br />
<br />
{{bc|1=<br />
drivers=alsa,pulse<br />
}}<br />
<br />
=== VirtualBox: Virtual machine has no sound ===<br />
<br />
If you experience problems with VirtualBox, the following command might be helpful:<br />
<br />
{{hc|$ alsactl init|2=<br />
Found hardware: "ICH" "SigmaTel STAC9700,83,84" "AC97a:83847600" "0x8086" "0x0000"<br />
Hardware is initialized using a generic method<br />
}}<br />
<br />
You might need to activate the ALSA output in your audio software as well. You might also try selecting different sound devices in your virtual machine settings to find one that works.<br />
<br />
=== Others: General application problems ===<br />
<br />
For other applications who insist on their own audio setup, e.g., XMMS or MPlayer, you would need to set their specific options.<br />
<br />
For [[MPlayer]] or [[mpv]], add the following line to the respective configuration file:<br />
ao=alsa<br />
<br />
Eg. for XMMS2, go into their options and make sure the sound driver is set to ALSA, not oss.<br />
<br />
To do this in XMMS:<br />
* Open XMMS<br />
** Options > Preferences.<br />
** Choose the ALSA output plugin.<br />
<br />
For applications which do not provide a ALSA output, you can use aoss from the alsa-oss package. To use aoss, when you run the program, prefix it with {{ic|aoss}}, e.g.:<br />
aoss realplay<br />
<br />
pcm.!default{ ... } doesnt work for me anymore. but this does:<br />
pcm.default pcm.dmixer<br />
<br />
== Other Issues ==<br />
<br />
=== Simultaneous playback problems ===<br />
<br />
If you are having problems with simultaneous playback, and if [[PulseAudio]] is installed, its default configuration is set to "hijack" the soundcard. Some users of ALSA may not want to use [[PulseAudio]] and are quite content with their current ALSA settings. One fix is to edit {{ic|/etc/asound.conf}} and comment out the following lines:<br />
{{bc|1=<br />
# Use PulseAudio by default<br />
pcm.!default {<br />
type pulse<br />
fallback "sysdefault"<br />
hint {<br />
show on<br />
description "Default ALSA Output (currently PulseAudio Sound Server)"<br />
}<br />
}<br />
}}<br />
<br />
Commenting the following out also may help:<br />
{{bc|1=<br />
ctl.!default {<br />
type pulse<br />
fallback "sysdefault"<br />
}<br />
}}<br />
<br />
This may be a much simpler solution than completely uninstalling [[PulseAudio]].<br />
<br />
Effectively, here is an example of a working {{ic|/etc/asound.conf}}:<br />
{{bc|1=<br />
pcm.dmixer {<br />
type dmix<br />
ipc_key 1024<br />
ipc_key_add_uid 0<br />
ipc_perm 0660<br />
}<br />
pcm.dsp {<br />
type plug<br />
slave.pcm "dmix"<br />
}<br />
}}<br />
<br />
{{Note|This {{ic|/etc/asound.conf}} file was intended for and used successfully with a global [[MPD]] configuration. See [[#Problems with availability to only one user at a time]].}}<br />
<br />
{{Note|Alternatively, if you do '''not''' have PulseAudio installed, and just want to get {{ic|dmix}} to work with vanilla ALSA, see the [http://www.alsa-project.org/main/index.php/Asoundrc#dmix upstream documentation]. In particular, you probably want to replace {{ic|dsp}} in the above config with {{ic|!default}}. Also, if you notice this causes certain applications to skip while playing (i.e. sound "glitchy"), and complain about underrun occurring, you may want to tweak the {{ic|slave.buffer_size}} inside {{ic|pcm.dmixer}}.}}<br />
<br />
=== Removing old ALSA state file (asound.state) ===<br />
<br />
The {{Pkg|alsa-utils}} package provides {{ic|alsa-store.service}} which automatically stores the current ALSA state to {{ic|/var/lib/alsa/asound.state}} upon system shutdown. This can be problematic for users who are trying to reset their current ALSA state as the {{ic|asound.state}} file will be recreated with the current state upon every shutdown (e.g., attempting to remove user-defined channels from the mixer). The {{ic|alsa-store.service}} service may be temporarily disabled by creating the following empty file:<br />
<br />
# mkdir -p /etc/alsa<br />
# touch /etc/alsa/state-daemon.conf<br />
<br />
The presence of {{ic|state-daemon.conf}} prevents {{ic|alsa-store.service}} from saving {{ic|asound.state}} during shutdown. After disabling this service, the {{ic|asound.state}} file may be removed as such:<br />
<br />
# rm /var/lib/alsa/asound.state<br />
<br />
After rebooting, the previous ALSA state should be lost and the current state should be reset to defaults. Re-enable {{ic|alsa-store.service}} by deleting the condition file we created:<br />
<br />
# rm /etc/alsa/state-daemon.conf<br />
<br />
On the next shutdown, the {{ic|asound.state}} file should be recreated with ALSA defaults. The file may also be generated immediately using:<br />
<br />
# alsactl store<br />
<br />
=== Problems with availability to only one user at a time ===<br />
<br />
You might find that only one user can use the dmixer at a time. This is probably ok for most, but for those who run [[mpd]] as a separate user this poses a problem. When mpd is playing a normal user cannot play sounds though the dmixer. While it is quite possible to just run mpd under a user's login account, another solution has been found. Adding the line {{ic|ipc_key_add_uid 0}} to the {{ic|pcm.dmixer}} block disables this locking. The following is a snippet from {{ic|asound.conf}}, the rest is the same as above.<br />
<br />
{{bc|1=<br />
...<br />
pcm.dmixer {<br />
type dmix<br />
ipc_key 1024<br />
ipc_key_add_uid 0<br />
ipc_perm 0660<br />
slave {<br />
...<br />
}}</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=Notmuch&diff=473049Notmuch2017-04-06T03:41:48Z<p>GenkiSky: Add section on permanently deleting emails to clarify comment in overview</p>
<hr />
<div>[[Category:Email clients]]<br />
[[ja:Notmuch]]<br />
{{Related articles start}}<br />
{{Related|mutt}}<br />
{{Related articles end}}<br />
<br />
[http://notmuchmail.org/ Notmuch] is a mail indexer. Essentially, is a very thin front end on top of ''xapian''.<br />
Much like [[Sup]], it focuses on one thing: indexing your email messages. Notmuch can be used as an email reader, or simply as an indexer and search tool for other MUAs, like [[mutt]].<br />
<br />
==Overview==<br />
Notmuch is written in C and an order of magnitude faster than sup-mail.<br />
Notmuch can be terminated during the indexing process, on the next run it will continue where it left off.<br />
Also like sup-mail, it does not provide a way to permanently delete unwanted email messages (however, see [[#Permanently delete emails]]).<br />
It doesn't fetch or send mails, nor does it store your email addresses, you'll need to use programs like [[OfflineIMAP]], [[msmtp]] and ''abook'' for those tasks.<br />
<br />
Notmuch is available in the [[official repositories]]: {{Pkg|notmuch}} or {{AUR|notmuch-git}}{{Broken package link|{{aur-mirror|notmuch-git}}}} from the [[AUR]]<br />
<br />
It provides [[python]], [[vim]], and [[emacs]] bindings.<br />
<br />
==First time Usage==<br />
After installation, you enter an interactive setup by running:<br />
notmuch setup<br />
The program prompts you for the location of your maildir and your primary and secondary email addresses. You can also edit the config file directly which is created by default at {{ic|$HOME/.notmuch-config}}.<br />
<br />
Subsequent re-indexing of the mail directories is done with:<br />
notmuch new<br />
<br />
==Frontends==<br />
There are [http://notmuchmail.org/frontends/ a range of ways to use notmuch], including cli, or with one of the Unix $EDITORS:<br />
<br />
===Emacs===<br />
The default frontend for notmuch is Emacs. It is developed by the same people that develop notmuch.<br />
<br />
===Vim===<br />
There's a vim interface available and included in notmuch. To start it, type:<br />
vim -c NotMuch<br />
<br />
===alot===<br />
alot is a standalone CLI interface for notmuch, written in python. It is available from [[AUR]] as {{AUR|alot}} or {{AUR|alot-git}}.<br />
<br />
Alot uses [[wikipedia:Mailcap|mailcap]] for handling different kinds of files. This currently includes html mails, which means that you need to configure a {{Ic|~/.mailcap}} file in order to view html mails. As minimum, put this line into your {{Ic|~/.mailcap}}:<br />
<br />
text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput<br />
<br />
This uses {{Pkg|w3m}}, some other text based clients such as {{Pkg|links}} or {{Pkg|lynx}} can be used instead, although their arguments might differ.<br />
<br />
More file handlers can be configured of course.<br />
<br />
===bower===<br />
[https://github.com/wangp/bower bower] is another CLI interface, this one is written in [https://mercurylang.org/ Mercury].<br />
<br />
===Neomutt===<br />
[http://www.neomutt.org/ Neomutt] - Another mutt fork which includes many feature patches, among them the [http://www.neomutt.org/feature/notmuch Notmuch] integration patch. Install from the [[AUR]] as {{AUR|neomutt}} or {{AUR|neomutt-git}}.<br />
<br />
===ner===<br />
[http://the-ner.org/ ner] - notmuch email reader - is yet another CLI interface, apparently written in C++.<br />
<br />
{{AUR|ner-git}}{{Broken package link|{{aur-mirror|ner-git}}}} is available from the [[AUR]].<br />
<br />
==Integrating with mutt==<br />
If you use [[mutt]] as your MUA, then notmuch is an excellent complementary tool to index and search your mail. The {{Pkg|notmuch-mutt}} package provides a script to integrate notmuch with mutt.<br />
<br />
After installing the {{Pkg|notmuch-mutt}} package and configuring notmuch, the only thing left before using notmuch to search from mutt is adding keybindings to call the <code>notmuch-mutt</code> perl script from mutt. Adding the following to your <code>.muttrc</code> is what is recommended in notmuch contrib source:<br />
<br />
macro index <F8> \<br />
"<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt --prompt search<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>" \<br />
"notmuch: search mail"<br />
macro index <F9> \<br />
"<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt thread<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter><enter-command>set wait_key<enter>" \<br />
"notmuch: reconstruct thread"<br />
macro index <F6> \<br />
"<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag -inbox<enter>" \<br />
"notmuch: remove message from inbox"<br />
<br />
The above uses <code>F8</code> to search your inbox using notmuch, <code>F9</code> to create threads from search results, and <code>F6</code> to tag search results.<br />
<br />
===notmuch-mutt problems===<br />
There can sometimes be disagreement between pacman-installed and managed perl modules and perl modules installed via cpan/cpanm. An error message of the format:<br />
Gnu.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xdb80080)<br />
can indicate that some of the notmuch-mutt dependencies are installed via cpan while some are installed and managed via pacman, and that you should install all dependencies via one or the other method.<br />
<br />
==Integrating with NeoMutt / mutt-kz==<br />
If you use either {{AUR|neomutt}}, {{AUR|mutt-kz}} or mutt with notmuch-patches, the {{Pkg|notmuch-mutt}} package is not needed. Instead, create a {{Ic|~/.mailboxes}} with some basic (virtual) mailboxes. A virtual mailbox is not an actual folder, but the result of a notmuch query for a specific tag:<br />
{{hc|~/.mailboxes|2=<br />
virtual-mailboxes "inbox" "notmuch://?query=tag:inbox"<br />
virtual-mailboxes "archive" "notmuch://?query=tag:archive"<br />
virtual-mailboxes "sent" "notmuch://?query=tag:sent"<br />
virtual-mailboxes "newsletters" "notmuch://?query=tag:newsletters"<br />
}}<br />
Next, make mutt aware of your virtual mailboxes by enabling virtual spoolfile and sourcing the latter:<br />
{{hc|~/.muttrc|2=<br />
set virtual_spoolfile=yes<br />
source ~/.mailboxes<br />
}}<br />
At this point, mutt will still list your mailboxes as empty, because your mails are not yet tagged and thus, notmuch querys are empty. To fill your vitual mailboxes, you need to initially tag the messages in your maildir. A very simple approach is to create a shell script like the following:<br />
{{hc|~/.scripts/notmuch-hook.sh|2=<br />
#!/bin/sh<br />
notmuch new<br />
# retag all "new" messages "inbox" and "unread"<br />
notmuch tag +inbox +unread -new -- tag:new<br />
# tag all messages from "me" as sent and remove tags inbox and unread<br />
notmuch tag -new -inbox +sent -- from:me@example.org or from:me@myself.com<br />
# tag newsletters, but dont show them in inbox<br />
notmuch tag +newsletters +unread -new -- from:newsletter@example.org or subject:'newsletter*'<br />
}}<br />
Make the shell script executable and run it:<br />
chmod +x ~/.scripts/notmuch-hook.sh<br />
~/.scripts/notmuch-hook.sh<br />
For the above example to work, make sure that notmuch tags new messages as 'new':<br />
{{hc|~/.notmuch-config|2=<br />
[new]<br />
tags=new<br />
}}<br />
Finally, your hook script needs to rerun on new mail arrival. If you use {{Pkg|offlineimap}} to sync IMAP to a local maildir, create a post sync hook:<br />
{{hc|~/.offlineimaprc|2=<br />
[Account myaccount]<br />
postsynchook = ~/.scripts/notmuch-hook.sh<br />
}}<br />
Some useful key bindings:<br />
{{hc|~/.muttrc|2=<br />
macro index A "<modify-labels>+archive -unread -inbox\\n" "Archive message"<br />
macro index c "<change-vfolder>?" "Change to vfolder overview"<br />
macro index \\\\ "<vfolder-from-query>" "Search mailbox"<br />
}}<br />
<br />
==Permanently delete emails==<br />
<br />
One choice is to maintain a tag of emails you wish to remove from your disk, for example, "killed". Then, you can run this to delete them permanently:<br />
notmuch search --output=files tag:killed | xargs -r rm<br />
notmuch new</div>GenkiSkyhttps://wiki.archlinux.org/index.php?title=User:GenkiSky&diff=472900User:GenkiSky2017-04-04T04:38:17Z<p>GenkiSky: Create initial page</p>
<hr />
<div>My website is at https://genki.is</div>GenkiSky