VSIDO Community

VSIDO Support => Scripts and How To's => How To's => Topic started by: VastOne on April 07, 2013, 02:18:09 PM

Title: How To : systemd on VSIDO
Post by: VastOne on April 07, 2013, 02:18:09 PM
In a post over on #!, DapperMe17 tested systemd on VSIDO (http://crunchbang.org/forums/viewtopic.php?pid=300551#p300551)

This How To will show you how to install systemd to test and how to setup grub2 correctly

This should only be done on a Debian Kernel install.  If you try it on Liquorix, you will see a Kernel Panic

It is best run on a new install of VSIDO, IMO

1: Install systemd

sudo apt-get install systemd

2: Add a kernel with init=/lib/systemd/systemd added to the grub2 boot menu

sudo medit /etc/grub.d/40_custom


#!/bin/sh
exec tail -n +3 $0
menuentry "VSIDO Image Build latest Debian Kernel on sdc10" {
    set root=(hd2,10)
        linux /vmlinuz root=/dev/sdc10 ro quiet init=/lib/systemd/systemd
        initrd /initrd.img
}

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


NOTE - The above is what is installed on my system and needs a bit of an explanation

sdc10 is the device/partition where this VSIDO is installed. It is on the 3rd disk in my machine which represents (hd2,10).  If you have just one hard drive it would be (hd0,X), on a second hard drive it would be (hd1,X) where X represents the device number and match the sdx number (in my case, sdc10)

3: update grub2

sudo update-grub

When you reboot you will have a menu entry for this (or whatever you named it):

QuoteVSIDO Image Build latest Debian Kernel on sdc10

Once all of this is completed, you can run smxi and install the Liquroix kernel if that is your preference

As I said over on that thread, I am seeing boot times of 12 seconds and shutdowns of 3 seconds with no issues running systemd

Very good grub2 Tutorial (https://help.ubuntu.com/community/Grub2)

I prefer the 40_custom method in grub2 because that is the recommended way of adding an entry to so that update-grub and grub-mkconfig does not remove edited or added entries

The 40_custom concept was also added to help eliminate user created errors/hacks to grub.cfg that made the system unbootable

Good luck
Title: Re: How To : systemd on VSIDO
Post by: Sector11 on April 07, 2013, 03:35:13 PM
You said:
Quote2: Add 'init=/lib/systemd/systemd' to the grub2 line

But you have:
Quotemenuentry "VSIDO Image Build latest Debian Kernel on sdc10" {
    set root=(hd2,10)
        linux /vmlinuz root=/dev/sdc10 ro quiet init=/lib/systemd/systemd
        initrd /initrd.img
}


My "/etc/grub.d/40_custom" looks like this:

#!/bin/sh
exec tail -n +3 $0

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


Should the change just be:
#!/bin/sh
exec tail -n +3 $0

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

init=/lib/systemd/systemd


What does "initrd /initrd.img" that you have do?

From the link:
Quoteadded  "init=/lib/systemd/systemd" (Without the quotes)
    to the kernel parameter line in grub.cfg.
    Works fine as tested with the Liquorix kernel.
    Both boot & shutdown are noticably quicker.

Why the difference between grub.cfg and /etc/grub.d/40_custom?
Title: Re: How To : systemd on VSIDO
Post by: VastOne on April 07, 2013, 03:49:47 PM
^ No, the changes have to be just as I have outlined them.  The only differences would be whatever your hardware is (sdxx and hdx,x)

I have provided the precise example of what my /etc/grub.d/40_custom looks like to make it work

There is a BIG message on grub.cfg that says

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub


because by running update-grub will revert any changes made here to the default when run, meaning they will not be saved on an update.  Reading up on grub2 will let you know all about why /etc/grub.d/40_custom is the best way to add anything

initrd /initrd.img is the initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real root file system is available. The initrd is bound to the kernel and loaded as part of the kernel boot procedure. The kernel then mounts this initrd as part of the two-stage boot process to load the modules to make the real file systems available and get at the real root file system.

It is absolutely needed just as I have outlined it
Title: Re: How To : systemd on VSIDO
Post by: Sector11 on April 07, 2013, 04:14:12 PM
OK, Thank you
Title: Re: How To : systemd on VSIDO
Post by: jedi on April 09, 2013, 04:31:54 AM
WOW!!!  This works wonderfully and makes the grub menu on boot-up 1000% better!  Installing the changes to the /etc/grub.d/40_custom in my main go to partition (which by the way does NOT have systemd installed) fully corrected the issue I was having which was my own idiocy.  I now have a very nice selection on boot-up from my Grub2 menu as to which Install I want to boot too.
Also, the boot speeds which are already incredible with SSD, are even faster now.  Thanks for the great How To VastOne.
Here is what my /etc/grub.d/40_custom file looks like on my laptop!


#!/bin/sh
exec tail -n +3 $0
menuentry "VSIDO Test Gnome 3, Cinnamon, and Mate DE's sda5" {
    set root=(hd0,5)
        linux /vmlinuz root=/dev/sda5 ro quiet nomodeset nouvea.modeset=0 init=/lib/systemd/systemd
        initrd /initrd.img
}
menuentry "VSIDO and Nvidia not installed on sda6" {
    set root=(hd0,6)
        linux /vmlinuz root=/dev/sda6 ro quiet init=/lib/systemd/systemd
        initrd /initrd.img
}

# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.


Maybe this will give others an idea of how this is supposed to work!  Once it's going, the simplicity factor on boot-up as to which install you want to boot into is incredibly simple!
Title: Re: How To : systemd on VSIDO
Post by: VastOne on April 09, 2013, 04:34:40 AM
^ Great to hear that jedi, thanks for sharing your successes
Title: Re: How To : systemd on VSIDO
Post by: PackRat on May 11, 2013, 08:47:04 PM
Worked as advertised on my Debian Sid install; using a custom build 3.9 kernel.

Now that you have been using it for a while, have you noticed any performance improvements other than boot and shutdown times? I distro hopped to OpenSuse and Arch just to get a look at systemd. I wasn't on those distros that long, but it looked like administration would be easier once you're past the learning curve.
Title: Re: How To : systemd on VSIDO
Post by: ozitraveller on May 14, 2013, 06:40:52 AM
This look kind useful too.

http://crunchbang.org/forums/viewtopic.php?pid=308233#p308233 (http://crunchbang.org/forums/viewtopic.php?pid=308233#p308233)
Title: Re: How To : systemd on VSIDO
Post by: ozitraveller on May 14, 2013, 09:39:07 PM
I've just done this using the instructions by VastOne, and allowing the upgrade to happen, on a liquorix kernel and dual boot, with out issue. All good so far. :) No kernel panic at all. I don't see any boot speed increase at all though.
Title: Re: How To : systemd on VSIDO
Post by: VastOne on May 14, 2013, 11:43:21 PM
VSIDO + systemd + FluxBox

OOTB

(http://www.zimagez.com/miniature/screenshot-05142013-063128pm.php) (http://www.zimagez.com/zimage/screenshot-05142013-063128pm.php)
Title: Re: How To : systemd on VSIDO
Post by: Sector11 on May 16, 2013, 03:33:02 PM
How does one do this with a liqiorix kernel and not get "colonel" panic?

--- "general" or even "captain" clamness would be nice.
Title: Re: How To : systemd on VSIDO
Post by: VastOne on May 18, 2013, 12:33:18 AM
All I do is install systemd before any smxi activity...

Once it is installed and booted I run smxi and install the liquorix kernel with no panics
Title: Re: How To : systemd on VSIDO
Post by: Sector11 on May 18, 2013, 12:50:37 AM
Perfect for a new install ... what about an install that is up and running with a liquorix kernel already.

Is there any way to do this?
Title: Re: How To : systemd on VSIDO
Post by: VastOne on May 18, 2013, 12:51:46 AM
Not to my knowledge... Perhaps the liquorix kernel folks can answer that one
Title: Re: How To : systemd on VSIDO
Post by: statmonkey on November 04, 2013, 02:40:13 AM
Apologize for the necro-bump but wanted to say thanks for this VastOne, simple and well explained as always.
Title: Re: How To : systemd on VSIDO
Post by: VastOne on November 04, 2013, 04:00:20 AM
You using it now statmonkey?

Thanks!   ;D
Title: Re: How To : systemd on VSIDO
Post by: statmonkey on November 04, 2013, 04:14:42 AM
Yes and thanks to you.  What really pushed me over the edge was two issues:
    1) The obtuse coding I was seeing in the new deb package source code that forces you to write for both SysV and Systemd and then inserts a message saying that SysV is deprecated.
    2) The arcane way that SysV makes you jump through hoops when a package updates (like mpd) and then insists on autostarting as root making you have to hunt and peck if you have your own system set up.  If you have seen it you know what I mean.

The fact that it is indeed faster is a bonus to me.  I did some testing and committed by altering my grub.cfg the deb guys can shoot me :)

Rant alert!  Now, systemd is half implemented by Debian and they are also looking at Upstart.  The systemd folks, the grub folks and the Debian maintainers are contradicting each other on what to use and how to implement it.  I love the way systemd works internally, it's easy to write a program for it and it has a lot of potential based on how it works with udev (see ignorant guru for more). I just wish they would implement it and move on.  I see canonical's ugly head in this and for see another Gnome debacle.  Canonical is great, they fork something, talk down the alternatives, stir up a bunch of sh** and then sit back and watch the dev community claw each other to death.  I sometimes wonder if Mark Shuttlesworth is really Bill Gates.  End of rant.
Title: Re: How To : systemd on VSIDO
Post by: dizzie on November 04, 2013, 09:31:12 AM
The one thing I like most about systemd is: shitt fast as hell booting and shutdown. Personally i reboot in 1sec, a cold boot (push the powerbutton) takes about 2. Yes ofcause I use an SSD, but thats not the point :)


systemctl add, enable, disable- is extremely nice, and simple too :)



Title: Re: How To : systemd on VSIDO
Post by: statmonkey on November 04, 2013, 07:47:27 PM
ROT RO!!!!

Just came across this issue "invoke-rc.d: initscript console-screen.sh, action "start" failed.systemd"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726774 (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726774) I am still researching but think it is an old problem and has something to do with the xfce stuff.

FWIW a very interesting thread with some good links in it http://forum.siduction.org/index.php?topic=3499.15 (http://forum.siduction.org/index.php?topic=3499.15)
Resources link http://www.freedesktop.org/wiki/Software/systemd/ (http://www.freedesktop.org/wiki/Software/systemd/)
     From that tips and tricks http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks/ (http://www.freedesktop.org/wiki/Software/systemd/TipsAndTricks/)
     From that the FAQ http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions/ (http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions/)

If anyone knows the answer to the above issue or a pointer to an answer (other then removing X11 or console-tools etc.) I would be interested.

dizzie that is amazing.  I would be afraid my desk would catch on fire or I would sit there all day monkeying with phones, pads, laptops, etc starting both at the same time and seeing which I could get to win. Hmm, I need an ssd :)