Difference between revisions of "Systemd/Services"

From ArchWiki
Jump to: navigation, search
(redirect empty page marked for deletion, see also talk page)
 
(247 intermediate revisions by 69 users not shown)
Line 1: Line 1:
{{Lowercase title}}
+
#REDIRECT [[Systemd]]
[[Category:Daemons and system services]]
 
[[Category:Boot process]]
 
{{Article summary start}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|Systemd}}
 
{{Article summary end}}
 
 
 
This page is useful to publish [[systemd]] service files that are missing in the appropriate package in the repositories. These files can be copied from other distributions or created by yourself.
 
 
 
== atd ==
 
{{hc|/etc/systemd/system/atd.service|<nowiki>
 
 
 
[Unit]
 
Description=Execution Queue Daemon
 
 
 
[Service]
 
ExecStart=/usr/sbin/atd -f
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
== BOINC Daemon ==
 
{{hc|/etc/systemd/system/boinc.service|<nowiki>
 
[Unit]
 
Description=BOINC Daemon
 
 
 
[Service]
 
User=boinc
 
Nice=19
 
ExecStart=/usr/bin/boinc_client --dir /var/lib/boinc --redirectio
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
== CouchDB ==
 
{{hc|/etc/systemd/system/couchdb.service|<nowiki>
 
[Unit]
 
Description=CouchDB Server
 
 
 
[Service]
 
User=couchdb
 
Type=forking
 
PermissionsStartOnly=true
 
ExecStartPre=/bin/mkdir -p /var/run/couchdb ; /bin/chown -R couchdb /var/run/couchdb
 
ExecStart=/usr/bin/couchdb -b -o /dev/null -e /dev/null
 
ExecStop=/usr/bin/couchdb -d
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
== Courier-IMAP ==
 
{{hc|/etc/systemd/system/authdaemond.service|<nowiki>
 
[Unit]
 
Description=Courier Authentification Daemon
 
 
 
[Service]
 
Type=forking
 
ExecStart=/usr/sbin/authdaemond start
 
ExecStop=/usr/sbin/authdaemon stop
 
PIDFile=/run/authdaemon/pid
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
{{hc|/etc/systemd/system/courier-imapd.service|<nowiki>
 
[Unit]
 
Description=Courier IMAP Daemon
 
Requires=authdaemond.service
 
After=authdaemond.service
 
 
 
[Service]
 
Type=forking
 
EnvironmentFile=/etc/courier-imap/imapd
 
ExecStart=/usr/lib/courier-imap/imapd.rc start
 
ExecStop=/usr/lib/courier-imap/imapd.rc stop
 
PIDFile=/var/run/courier/imapd.pid
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
{{hc|/etc/systemd/system/courier-imapd-ssl.service|<nowiki>
 
[Unit]
 
Description=Courier IMAP Daemon
 
Requires=authdaemond.service
 
After=authdaemond.service
 
 
 
[Service]
 
Type=forking
 
EnvironmentFile=/etc/courier-imap/imapd
 
ExecStart=/usr/lib/courier-imap/imapd-ssl.rc start
 
ExecStop=/usr/lib/courier-imap/imapd-ssl.rc stop
 
PIDFile=/var/run/courier/imapd-ssl.pid
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
{{hc|/usr/lib/tmpfiles.d/authdaemond.conf|<nowiki>
 
D /run/authdaemon 0755 courier courier
 
</nowiki>}}
 
 
 
{{hc|/usr/lib/tmpfiles.d/courier-imapd.conf|<nowiki>
 
D /run/courier 0755 courier courier
 
</nowiki>}}
 
 
 
{{Note|Taken from Gentoo and modified for Arch. You could replace the files in tmpfiles.d with appropriate ExecStartPre calls as well. Service files for pop3d and pop3d-ssl are still missing, but are probably very similar to the imapd files!}}
 
 
 
== dropbear ==
 
{{hc|/etc/systemd/system/dropbear.service|
 
<nowiki>
 
[Unit]
 
Description=Dropbear SSH server
 
 
 
[Service]
 
Type=oneshot
 
ExecStart=/usr/sbin/dropbear -p 22 -d /etc/dropbear/dropbear_dss_host_key -w -P /var/run/dropbear.pid
 
RemainAfterExit=yes
 
 
 
[Install]
 
WantedBy=multi-user.target
 
 
 
</nowiki>}}
 
 
 
== IPv6 (Hurricane Electric) ==
 
{{hc|/etc/systemd/system/he-ipv6.service|<nowiki>
 
 
 
[Unit]
 
Description=he.net IPv6 tunnel
 
After=network.target
 
 
 
[Service]
 
Type=oneshot
 
RemainAfterExit=yes
 
ExecStart=/sbin/ip tunnel add he-ipv6 mode sit remote 209.51.161.14 local <local IPv4> ttl 255
 
ExecStart=/sbin/ip link set he-ipv6 up mtu 1480
 
ExecStart=/sbin/ip addr add <local IPv6>/64 dev he-ipv6
 
ExecStart=/sbin/ip -6 route add ::/0 dev he-ipv6
 
ExecStart=/sbin/ip addr add <public IPv6>/64 dev he-ipv6
 
ExecStop=/sbin/ip -6 route del ::/0 dev he-ipv6
 
ExecStop=/sbin/ip link set he-ipv6 down
 
ExecStop=/sbin/ip tunnel del he-ipv6
 
 
 
[Install]
 
WantedBy=multi-user.target
 
 
 
</nowiki>}}
 
 
 
== irexecd ==
 
{{hc|/etc/systemd/system/irexecd.service|<nowiki>
 
 
 
[Unit]
 
Description=LIRC irexec Daemon
 
Requires=lircd.service
 
After=lircd.service
 
 
 
[Service]
 
Type=forking
 
ExecStart=/usr/bin/irexec --daemon
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
References:
 
* http://lists.freedesktop.org/archives/systemd-devel/2011-January/001182.html
 
 
 
== lircd ==
 
{{hc|/etc/systemd/system/lircd.service|<nowiki>
 
 
 
[Unit]
 
Description=LIRC Daemon
 
After=network.target
 
 
 
[Service]
 
Type=forking
 
EnvironmentFile=/etc/conf.d/lircd.conf
 
PIDFile=/run/lirc/lircd.pid
 
ExecStartPre=/bin/mkdir -p /run/lirc
 
ExecStartPre=/bin/rm -f /dev/lircd
 
ExecStartPre=/bin/rm -f /run/lirc/lircd
 
ExecStartPre=/bin/ln -s /run/lirc/lircd /dev/lircd
 
 
 
ExecStart=/usr/sbin/lircd -d $LIRC_DEVICE -P /run/lirc/lircd.pid -H $LIRC_DRIVER $LIRC_CONFIGFILE
 
ExecStopPost=/bin/rm -f /dev/lircd
 
ExecStopPost=/bin/rm -fR /run/lirc
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
{{Note|{{ic|$LIRC_EXTRAOPTS}} set in {{ic|/etc/conf.d/lircd.conf}} will not work, as {{ic|lircd}} will print an error about the argument count. Any extra options should be hardcoded into the unit file.}}
 
 
 
References:
 
* http://lists.freedesktop.org/archives/systemd-devel/2011-January/001182.html
 
* https://bbs.archlinux.org/viewtopic.php?id=141300
 
 
 
== Logmein Hamachi ==
 
{{hc|/etc/systemd/system/hamachi.service|<nowiki>
 
[Unit]
 
Description=Hamachi Daemon
 
After=network.target
 
 
 
[Service]
 
Type=forking
 
ExecStart=/opt/logmein-hamachi/bin/hamachid
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
== Noip ==
 
{{hc|/etc/systemd/system/noip2.service|<nowiki>
 
[Unit]
 
Description=No-IP Dynamic DNS Update Client
 
After=network.target
 
 
 
[Service]
 
Type=forking
 
ExecStart=/usr/bin/noip2
 
 
 
[Install]
 
WantedBy=multi-user.target</nowiki>}}
 
 
 
== pcscd ==
 
{{hc|/etc/systemd/system/pcscd.service|<nowiki>
 
[Unit]
 
Description=PC/SC Smart Card Daemon
 
Requires=pcscd.socket
 
 
 
[Service]
 
ExecStart=/usr/sbin/pcscd --foreground --auto-exit
 
ExecReload=/usr/sbin/pcscd --hotplug
 
StandardOutput=syslog
 
 
 
[Install]
 
Also=pcscd.socket
 
</nowiki>}}
 
 
 
{{hc|/etc/systemd/system/pcscd.socket|<nowiki>
 
[Unit]
 
Description=PC/SC Smart Card Daemon Activation Socket
 
 
 
[Socket]
 
ListenStream=/var/run/pcscd/pcscd.comm
 
 
 
[Install]
 
WantedBy=sockets.target
 
</nowiki>}}
 
Reference:
 
* http://ludovicrousseau.blogspot.de/2011/11/pcscd-auto-start-using-systemd.html
 
 
 
== rc.local ==
 
{{hc|/etc/systemd/system/rc-local.service|<nowiki>
 
[Unit]
 
Description=/etc/rc.local Compatibility
 
 
 
[Service]
 
Type=oneshot
 
ExecStart=/etc/rc.local
 
TimeoutSec=0
 
StandardInput=tty
 
RemainAfterExit=yes
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
{{Tip|You can replace your rc.local with native systemd units in {{ic|/etc/systemd/system/}}.}}
 
{{Note|Also available in {{Pkg|initscripts}} (see: [[Systemd#Arch_integration]]).}}
 
{{Note|1=StandardInput=tty may give strange behaviour:
 
https://bbs.archlinux.org/viewtopic.php?id=147790}}
 
 
 
== Remote filesystem mounts ==
 
''See: [[Systemd#Remote_filesystem_mounts]]''
 
 
 
== Static Ethernet network ==
 
This is a custom service file for static Ethernet configurations. For other configurations, see [[Systemd#Network]]
 
{{hc|/etc/conf.d/network|<nowiki>
 
interface=eth0
 
address=192.168.0.1
 
netmask=24
 
broadcast=192.168.0.255
 
gateway=192.168.0.254</nowiki>}}
 
 
 
{{hc|/etc/systemd/system/network.service|<nowiki>
 
[Unit]
 
Description=Network Connectivity
 
Wants=network.target
 
Before=network.target
 
 
 
[Service]
 
Type=oneshot
 
RemainAfterExit=yes
 
EnvironmentFile=/etc/conf.d/network
 
ExecStart=/sbin/ip link set dev ${interface} up
 
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev ${interface}
 
ExecStart=/sbin/ip route add default via ${gateway}
 
ExecStop=/sbin/ip addr flush dev ${interface}
 
ExecStop=/sbin/ip link set dev ${interface} down
 
 
 
[Install]
 
WantedBy=multi-user.target</nowiki>}}
 
 
 
== tpfand ==
 
{{hc|/etc/systemd/system/tpfand.service|<nowiki>
 
[Unit]
 
Description=ThinkPad Fan Control
 
 
 
[Service]
 
Type=forking
 
PIDFile=/var/run/tpfand.pid
 
ExecStart=/usr/sbin/tpfand
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
== verynice ==
 
{{hc|/etc/systemd/system/verynice.service|<nowiki>
 
[Unit]
 
Description=A tool for dynamically adjusting the nice-level of processes
 
 
 
[Service]
 
Type=forking
 
PIDFile=/var/run/verynice.pid
 
ExecStart=/usr/sbin/verynice -d /var/run/verynice.pid
 
ExecStop=/bin/kill -15 $MAINPID
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
== VideoLAN 2.0 ==
 
Change the '''User''' parameter.
 
 
 
{{hc|/etc/systemd/system/vlc.service|<nowiki>
 
[Unit]
 
Description=VideoOnLAN Service
 
After=network.target
 
 
 
[Service]
 
Type=forking
 
User=nobody
 
ExecStart=/usr/bin/cvlc --intf=lua --lua-intf=http --daemon --http-port 8090
 
Restart=on-abort
 
 
 
[Install]
 
WantedBy=multi-user.target
 
</nowiki>}}
 
 
 
== See also ==
 
 
 
* [[systemd]]
 
* [http://en.gentoo-wiki.com/wiki/Systemd systemd at gentoo wiki]
 

Latest revision as of 14:34, 15 May 2015

Redirect to: