Difference between revisions of "Systemd/Services"

From ArchWiki
Jump to: navigation, search
m
m (cpufrequtils: provide -> provides)
Line 249: Line 249:
 
== cpufrequtils ==
 
== cpufrequtils ==
  
{{Pkg|cpupower}} provide the native service file.
+
{{Pkg|cpupower}} provides the native service file.
  
 
== See also ==
 
== See also ==

Revision as of 00:10, 22 August 2012

Template:Article summary start Template:Article summary text

Template:Article summary heading Template:Article summary wiki Template:Article summary end

Currently, systemd is mostly at feature parity with Arch's initscripts. However, a lot more testing is needed. If you would like to help out, you can fork the initscripts-systemd or systemd-arch-units git repos and submit pull requests for your additions. This wiki page can serve as a staging area for these files.

atd

/etc/systemd/system/atd.service

[Unit]
Description=Execution Queue Daemon

[Service]
ExecStart=/usr/sbin/atd -f

[Install]
WantedBy=multi-user.target

irexecd

/etc/systemd/system/irexecd.service

[Unit]
Description=LIRC irexec Daemon
Requires=lircd.service
After=lircd.service

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/irexec.conf
ExecStart=/usr/bin/irexec --daemon $IREXEC_OPTS

[Install]
WantedBy=multi-user.target

References:

lircd

/etc/systemd/system/lircd.service

[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
Note: $LIRC_EXTRAOPTS set in /etc/conf.d/lircd.conf will not work, as lircd will print an error about the argument count. Any extra options should be hardcoded into the unit file.

References:

rc.local

/etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility

[Service]
Type=oneshot
ExecStart=/etc/rc.local
TimeoutSec=0
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
Note: Also available in initscripts (see: Systemd#Arch_integration).

apache2

Note: You have to either reboot or use systemd-tmpfiles --create httpd.conf for the tmpfile to take effect.
/etc/systemd/system/httpd.service
[Unit]
Description=Apache Webserver
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/apache
ExecStart=/usr/sbin/httpd -k start $OPTIONS
ExecStop=/usr/sbin/httpd -k graceful-stop $OPTIONS
ExecReload=/usr/sbin/httpd -k graceful $OPTIONS
Restart=always

[Install]
WantedBy=multi-user.target
/etc/tmpfiles.d/httpd.conf
D /var/run/httpd 0755 http http -

Static ethernet network

This is a custom service file for static ethernet configurations. For other configurations, see Systemd#Network

/etc/conf.d/network
interface=eth0
address=192.168.0.1
netmask=24
broadcast=192.168.0.255
gateway=192.168.0.254
/etc/systemd/system/network.service
[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

distccd

/etc/systemd/system/distccd.service
[Unit]
Description=distcc

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/distccd
ExecStart=/usr/bin/distccd --daemon $DISTCC_ARGS
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target

verynice

/etc/systemd/system/verynice.service
[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

BOINC Daemon

/etc/systemd/system/boinc.service
[Unit]
Description=BOINC Daemon

[Service]
User=boinc
Nice=19
ExecStart=/usr/bin/boinc_client --dir /var/lib/boinc --redirectio

[Install]
WantedBy=multi-user.target

Logmein Hamachi

/etc/systemd/system/hamachi.service
[Unit]
Description=Hamachi Daemon
After=network.target

[Service]
Type=forking
ExecStart=/opt/logmein-hamachi/bin/hamachid

[Install]
WantedBy=multi-user.target

tftpd

/etc/systemd/system/tftpd.service
[Unit]
Description=TFTPD Server
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/conf.d/tftpd
ExecStart=/usr/sbin/in.tftpd $TFTPD_ARGS
ExecStop=/bin/kill -15 $MAINPID

[Install]
WantedBy=multi-user.target

redis

/etc/systemd/system/redis.service
[Unit]
Description=Redis Server
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/redis-server /etc/redis.conf
ExecStop=/bin/kill -15 $MAINPID
PIDFile=/var/run/redis.pid
Restart=always

[Install]
WantedBy=multi-user.target

Taken from https://bbs.archlinux.org/viewtopic.php?id=135922

Remote filesystem mounts

See: Systemd#Remote_filesystem_mounts

cpufrequtils

cpupower provides the native service file.

See also