SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-05-07 06:57:30

Super-Nathan
#! CrunchBanger
From: South Korea
Registered: 2009-12-18
Posts: 158
Website

Even faster boots with Systemd

WARNING!:
This was fast, easy, and awesome for me, your results may vary. If you follow this guide you sure as shit better have a backup and a clonezilla of your HD.

Requirements:
I don't know of any reason not to do this, please post otherwise.
I strongly recommend that you are running Jessie. This should world fine in Wheezy and I have no idea about Squeeze.

Background :
Systemd is an alternative startup daemon for Linux. Debian has traditionally been using a series a shell scripts to start it's systems. Systemd is an actual program instead of a series of scripts that run through a shell interpreter so it is much faster. Most non-Debian-Based distros are making the switch.

What to do:
This will royally piss off aptitude, use apt-get. It will aggravate apt-get and ask you to enter "Yes, do as I say!", you must do that. It warns you because this is testing software and it will remove a core Debian program (sysvinit).
first elevate your status

sudo $SHELL

Then install

apt-get update && apt-get install systemd && apt-get install systemd-sysv

Finally you need to hold the systemd-sysv package or debian will try to remove it and replace with the old initscripts

echo systemd-sysv hold | dpkg --set-selections

Now you can reboot and give it a spin! My boot is down to under 5 seconds


#echo "Something useful" > /dev/null

PiBang Linux

Offline

Be excellent to each other!

#2 2013-05-07 08:26:32

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 11,508

Re: Even faster boots with Systemd

Has anyone else tried systemd + systemd-sysv with SLiM?  Did it work for you?  (It failed for me.)

@Super-Nathan:  I assume you're either using a different login manager or invoking startx directly?


Yes; as a matter of fact, I am a cop.  Why do you ask? cool
I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#3 2013-05-07 08:41:49

DebianJoe
#! Code Whisperer
From: The Bleeding Edge
Registered: 2013-03-13
Posts: 1,207
Website

Re: Even faster boots with Systemd

@pvsage, I use systemd with SLiM.  One of the things you might look into is if you're still trying to start SLiM with inittab.  You are going to have to use systemd to start the slim daemon at boot time to get them to play with each other.  If I remember correctly, the command is

sudo systemctl enable slim.service

EDIT: In fear of the furious retribution that could strike at random should I not really take the time to fully address all possibilities.  There are a few things that can cause SLiM to not work at boot.  If you've successfully migrated to systemd for boot, use

systemctl status slim

To see if the service has been correctly loaded.  If not, it should provide you with hints as to why.  You can also use

ls /usr/lib/systemd/system/ |grep slim

to make sure that the service itself is available.  SLiM (much like everything else) wasn't originally created with a service file as it came out before systemd was implemented on most systems.  If you have an older packaged version of SLiM, then there may not be a slim.service to start.  This is corrected in newer releases of SLiM.

Last edited by DebianJoe (2013-05-07 08:51:43)

Offline

#4 2013-05-07 09:15:08

Super-Nathan
#! CrunchBanger
From: South Korea
Registered: 2009-12-18
Posts: 158
Website

Re: Even faster boots with Systemd

pvsage wrote:

Has anyone else tried systemd + systemd-sysv with SLiM?  Did it work for you?  (It failed for me.)

@Super-Nathan:  I assume you're either using a different login manager or invoking startx directly?

Nope, I'm using slim. Stock #! Waldorf configs. My system is Waldorf/Sid.


MAJOR UPDATE!
Built a kernel real quick using localmodconfig, and tweaked a bunch of stuff. Tried to build most of my modules directly into the Kernel. New boot time? Almost 3.5 seconds!

Last edited by Super-Nathan (2013-05-07 10:22:45)


#echo "Something useful" > /dev/null

PiBang Linux

Offline

#5 2013-05-07 14:24:33

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,939

Re: Even faster boots with Systemd

Anyone try using netctl on debian? I've been using it on arch but I can't get it to run after my computer starts up. If I could get that working (or just disabled netctl alltogether)  could seriously get my boot time under half a second. It's still worth it though, super tired of messing with network-manager and wicd just to get a wired connection.

(daniel@delphiarch)(1358/pts/2)(10:23am:05/07/13)-
(%:/)- systemd-analyze time
Startup finished in 1.566s (kernel) + 581ms (userspace) = 2.148s
(daniel@delphiarch)(1359/pts/2)(10:24am:05/07/13)-
(%:/)- systemd-analyze blame
          1.909s netctl@ethernet\x2dstatic.service
           127ms httpd.service
            94ms systemd-logind.service
            66ms console-kit-log-system-start.service
            66ms console-kit-daemon.service
            56ms alsa-restore.service
            53ms systemd-udev-trigger.service
            49ms systemd-modules-load.service
            49ms systemd-sysctl.service
            40ms udisks2.service
            40ms dev-hugepages.mount
            39ms systemd-remount-fs.service
            39ms systemd-fsck@dev-disk-by\x2duuid-08BA\x2dE656.service
            36ms dev-mqueue.mount
            36ms systemd-vconsole-setup.service
            33ms sys-kernel-debug.mount
            32ms polkit.service
            30ms systemd-static-nodes.service
            29ms rc-local.service
            26ms systemd-tmpfiles-setup.service
            23ms systemd-journal-flush.service
             9ms systemd-tmpfiles-clean.service
             6ms systemd-random-seed-load.service
             6ms systemd-user-sessions.service
             5ms upower.service
             3ms sys-kernel-config.mount
             3ms tmp.mount
             3ms systemd-udevd.service
             2ms boot-efi.mount
             1ms boot.mount
           634us sys-fs-fuse-connections.mount

Edit: Tried disabling netctl all together (before I had it disabled but set to start 5 seconds after boot with a cron job) and starting netctl manually after boot, this is what I got:

(daniel@delphiarch)(1404/pts/0)(10:38am:05/07/13)-
(%:/)- syssystemd-analyze time
Startup finished in 1.587s (kernel) + 610ms (userspace) = 2.197s
(daniel@delphiarch)(1405/pts/0)(10:38am:05/07/13)-
(%:/)- systemd-analyze blame
           120ms systemd-logind.service
            69ms console-kit-daemon.service
            60ms systemd-udev-trigger.service
            53ms systemd-modules-load.service
            50ms systemd-remount-fs.service
            46ms alsa-restore.service
            46ms sys-kernel-debug.mount
            46ms systemd-sysctl.service
            43ms dev-hugepages.mount
            43ms rc-local.service
            40ms dev-mqueue.mount
            39ms console-kit-log-system-start.service
            37ms systemd-fsck@dev-disk-by\x2duuid-08BA\x2dE656.service
            36ms systemd-vconsole-setup.service
            32ms polkit.service
            30ms systemd-static-nodes.service
            29ms systemd-user-sessions.service
            26ms systemd-tmpfiles-setup.service
             9ms upower.service
             6ms systemd-random-seed-load.service
             6ms systemd-journal-flush.service
             6ms tmp.mount
             3ms sys-kernel-config.mount
             3ms boot.mount
             3ms systemd-udevd.service
             2ms boot-efi.mount
             1ms sys-fs-fuse-connections.mount

So it isn't showing as taking 2 seconds at startup anymore, but the boot time hasn't changed significantly. I actually started 0.049 seconds faster with netctl enabled, who knew? Kinda scratching my head at why stuff that is started via cron shows up in systemd-analyze, but whatever. I can deal with a two second boot.

Last edited by mynis01 (2013-05-07 14:46:35)

Offline

#6 2013-05-07 14:49:51

wuxmedia
wookiee madclaw
From: Back in Blighty
Registered: 2012-03-09
Posts: 1,447
Website

Re: Even faster boots with Systemd

I dunno if it'll make it boot faster - I followed the arch wiki to make a systemd unit. On arch.
I thought that was pretty cool

Offline

#7 2013-05-07 17:24:04

MrPink
#! CrunchBanger
From: .dk
Registered: 2011-06-28
Posts: 213

Re: Even faster boots with Systemd

Does anyone know, how well this works with encryption and lvm?

Offline

#8 2013-05-07 18:30:04

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,939

Re: Even faster boots with Systemd

MrPink wrote:

Does anyone know, how well this works with encryption and lvm?

I don't really think service management and LVM really interact with each other all that much (though I could be dead wrong). The only mention of systemd in the dm-crypt with LUKS page of the arch wiki is here. Arch has been using systemd for months now so it would probably say something in there by now if there was some kind of conflict.

Offline

#9 2013-05-07 19:47:08

donkeyotay
#! CrunchBanger
From: Everywhere
Registered: 2011-01-28
Posts: 190

Re: Even faster boots with Systemd

@MrPink. I can't comment on encryption, but I have it working with LVM without any issues other than the slim problem detailed above.


I didn't say it was your fault... I said I was going to blame you.

Offline

#10 2013-05-09 06:46:24

drmfoti
New Member
Registered: 2013-02-25
Posts: 2

Re: Even faster boots with Systemd

Just want to thank Super Nathan for this - up and running speedily on 4 machines, now: netbook, q9550 and q6600 desktops, and Turion 64x2 laptop. All fine. Sweet!

Offline

#11 2013-05-09 11:49:15

Super-Nathan
#! CrunchBanger
From: South Korea
Registered: 2009-12-18
Posts: 158
Website

Re: Even faster boots with Systemd

drmfoti wrote:

Just want to thank Super Nathan for this - up and running speedily on 4 machines, now: netbook, q9550 and q6600 desktops, and Turion 64x2 laptop. All fine. Sweet!

HAHA, no worries, glad it is loving you!


#echo "Something useful" > /dev/null

PiBang Linux

Offline

#12 2013-05-11 11:43:26

SV_25
New Member
From: Belgium
Registered: 2013-05-11
Posts: 1

Re: Even faster boots with Systemd

Hello, I just tried this on my old pentium 4. It didn't do anything to the boot time (a monstreous 50 sec.), but it did halved the shutdown time (from 7 to nearly 3 sec.)
Now I'll just try to compile that kernel with localemod to see if that will change anything. Thanks anyway for the tip!

Offline

#13 2013-05-11 15:41:48

hhh
Caught in the Vortex
Registered: 2010-08-04
Posts: 1,885

Re: Even faster boots with Systemd

Super-Nathan wrote:

I have no idea about Squeeze.

systemd isn't available in squeeze...
http://packages.debian.org/search?keywords=systemd

I get super fast boots by never shutting down. Just sayin'.  monkey

Offline

#14 2013-05-12 03:29:32

DapperMe17
#! CrunchBanger
From: Todd's Gang
Registered: 2012-10-19
Posts: 216

Re: Even faster boots with Systemd

fyi

echo systemd-sysv hold | dpkg --set-selections

results in...

"dpkg: error: operation requires read/write access to dpkg status area"

Offline

#15 2013-05-12 03:52:57

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 11,508

Re: Even faster boots with Systemd

^ That's one command with which I had no problem.  Rather than entering a root shell, I used sudo with all the commands; in this case, insert sudo after the pipe.


Yes; as a matter of fact, I am a cop.  Why do you ask? cool
I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#16 2013-05-12 03:54:58

DapperMe17
#! CrunchBanger
From: Todd's Gang
Registered: 2012-10-19
Posts: 216

Re: Even faster boots with Systemd

cool

Offline

#17 2013-05-12 04:32:38

Super-Nathan
#! CrunchBanger
From: South Korea
Registered: 2009-12-18
Posts: 158
Website

Re: Even faster boots with Systemd

DapperMe17 wrote:

fyi

echo systemd-sysv hold | dpkg --set-selections

results in...

"dpkg: error: operation requires read/write access to dpkg status area"


This command is why i enter a root shell!

smile


#echo "Something useful" > /dev/null

PiBang Linux

Offline

#18 2013-05-12 05:09:56

DapperMe17
#! CrunchBanger
From: Todd's Gang
Registered: 2012-10-19
Posts: 216

Re: Even faster boots with Systemd

Root shell, and no root shell....same dpkg: error.

Offline

#19 2013-05-12 05:39:41

xoraxiom
Member
Registered: 2013-03-07
Posts: 41

Re: Even faster boots with Systemd

Try this:

sudo echo systemd-sysv hold | sudo dpkg --set-selections

Offline

#20 2013-05-12 13:45:02

DigitalJedi
#! CrunchBanger
From: Kernel
Registered: 2012-11-20
Posts: 102

Re: Even faster boots with Systemd

MrPink wrote:

Does anyone know, how well this works with encryption and lvm?

I have the entire hard drive encrypted (3 partitions: root, swap & home) with external usb boot and it worked literally out of the box, no problems at all. Superfast boot!

Good work Super-Nathan!


"Do or do not. There is no try." ~ Master Jedi Yoda

Offline

#21 2013-05-14 00:47:17

diegoelsurfer
Member
From: Rosario, Santa Fe, Argentina
Registered: 2013-05-07
Posts: 36
Website

Re: Even faster boots with Systemd

Super-Nathan wrote:

WARNING!:
This was fast, easy, and awesome for me, your results may vary. If you follow this guide you sure as shit better have a backup and a clonezilla of your HD.

Now you can reboot and give it a spin! My boot is down to under 5 seconds

I have just done it. It reboot so amazingly fast that I did not realise it.

Super!

Thanks


http://www.vanguardiasur.com.ar
embedded systems & kernel development

Offline

#22 2013-05-14 04:24:42

Ozitraveller
#! CrunchBanger
From: Far from the madding crowd!
Registered: 2011-04-26
Posts: 215

Re: Even faster boots with Systemd

Just wondering whether anyone has tried this on sid? smile

Offline

#23 2013-05-14 05:52:17

xoraxiom
Member
Registered: 2013-03-07
Posts: 41

Re: Even faster boots with Systemd

Yes, systemd in Debian is working with unstable (sid). No unusual issues specifically with systemd (presently), though sid has some quirks at the moment... Running LVM, LUKS, and NFS bits without issue, though LUKS somewhat mitigates the boot speed enhancements of systemd over sysvinit.

One thing to note, if one is running /var/log in tmpfs, then ConsoleKit throws an error, a solution is:

systemctl status console-kit-log-system-start.service

To check for an error starting the service.

mkdir -p /etc/tmpfiles.d
echo 'D /var/log/ConsoleKit/ 0755 root root' > /etc/tmpfiles.d/console-kit.conf

This tells console-kit-log-system-start.service to delay starting until the tmpfs is established.

Offline

#24 2013-05-14 11:17:18

zubcho81
#! CrunchBanger
From: Sofia, Bulgaria
Registered: 2012-08-12
Posts: 184

Re: Even faster boots with Systemd

Will be systemd program  added in Jessie? And how it will perform on a new hardware? If you put your HDD on another PC?

Offline

Help fund CrunchBang, donate to the project!

#25 2013-05-14 18:29:06

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,106

Re: Even faster boots with Systemd

^I thought consolekit is redundant with systemd? A few default #! processes started at boot are now (i.e. acpid, consolekit, probably others...).

Elsewhere it's suggested that LUKS, encryption, etc., negates possibility of faster boot-ups (if that's your game). http://freedesktop.org/wiki/Software/sy … imizations

Last edited by dura (2013-05-14 18:30:19)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo