Systemd step by step howto for Archlinux

Posted: May 18, 2012 in Linux
Tags: , , ,

1. pacman -S the following;

systemd
dbus-python
initscripts
initscripts-systemd
python2-cairo
systemd-arch-units

2. mkdir /etc/systemd/system/graphical.target.wants

3. Create a text file /etc/systemd/system/graphical.target.wants/xinit.service containing;

[Unit]
Description=Direct login to X
Requires=dev-tty7.device
After=dev-tty7.device systemd-user-sessions.service

[Service]
ExecStart=/bin/su [put in your user name here] -l -c “/bin/bash –login -c xinit”

[Install]
WantedBy=graphical.target

N.B. There are two minus sign’s in front of login above.

4. Create a text file /etc/systemd/system/graphical.target.wants/hwclock.service containing;

[Unit]
Description=hwclock

[Service]
Type=oneshot
ExecStart=/sbin/hwclock –hctosys –localtime
ExecStop=/sbin/hwclock –systohc –localtime

[Install]
WantedBy=graphical.target

N.B. There are two minus sign’s in front of hctosys, localtime and systohc above.

5. Edit your kernel command line (i.e. /boot/grub/menu.lst if using Grub1) to include init=/bin/systemd for e.g;

Before
kernel /boot/vmlinuz-linux root=/dev/sda2 loglevel=3 ro quiet resume=/dev/sda6 nomodeset

After
kernel /boot/vmlinuz-linux root=/dev/sda2 loglevel=3 ro quiet resume=/dev/sda6 nomodeset init=/bin/systemd

6. Reboot and select the new kernel entry (and hope everything works – otherwise just revert changes by editing grub during boot). Note above steps were tested using stock Arch 3.3.6 kernel. You will need to enable certain kernel settings (search on Google) if compiling your own kernel.

7. (Optional step) – If you need to debug your stuck boot process, edit your kernel command line as follows to enable more verbose text during boot (this also includes systemd details to dmesg output);

kernel /boot/vmlinuz root=/dev/sda2 loglevel=3 resume=/dev/sda6 init=/bin/systemd systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M

Credits to Archlinux Wiki (Systemd section), Gentoo Wiki and various online forums.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s