Posts Tagged ‘systemd’

1. Add PPA;

sudo add-apt-repository ppa:pitti/systemd
sudo apt-get update

2. Refresh packages

sudo apt-get update

3. Install systemd

sudo apt-get install systemd

4. Create a text file /lib/systemd/system/hwclock.service containing;

[Unit]
Description=hwclock

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

[Install]
WantedBy=multi-user.target

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

5. Symlink above file to /etc/systemd/system/multi-user.target.wants/hwclock.service

sudo ln -s /lib/systemd/system/hwclock.service /etc/systemd/system/multi-user.target.wants/hwclock.service

6. Edit your kernel command line 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

7. 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 Precise kernel. You will need to enable certain kernel settings (search on Google) if compiling your own kernel.

8. (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 Debian Wiki (Systemd section), Ubuntu Wiki and various online forums.

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.