Jump to content

How I Converted My Arch to 100% Systemd or...


V.T. Eric Layton

Recommended Posts

Here's the list of Arch specific units from systemd-arch-units

  • usr/
  • usr/lib/
  • usr/lib/systemd/
  • usr/lib/systemd/scripts/
  • usr/lib/systemd/system/
  • usr/lib/systemd/system/polkitd.service
  • usr/lib/systemd/system/saslauthd.service
  • usr/lib/systemd/system/zram.service
  • usr/lib/systemd/system/udisks.service
  • usr/lib/systemd/system/openvpn@.service
  • usr/lib/systemd/system/modem-manager.service
  • usr/lib/systemd/system/irqbalance.service
  • usr/lib/systemd/system/gdm.service
  • usr/lib/systemd/system/dhcpd4.service
  • usr/lib/systemd/system/dhcpd6.service
  • usr/lib/systemd/system/postgresql.service
  • usr/lib/systemd/scripts/postgresql-initdb
  • usr/lib/systemd/scripts/zramctrl

Link to comment
Share on other sites

A bit about performance.

 

Raw install without tweaking

systemd-analyze

= 4963ms

 

After adding quiet to my kernel line in GRUB = 3250ms

 

After adding the noauto and automount options to my /home partition in /etc/fstab = 4220ms (removed this)

 

The systemd Optimizations page recommends this

Consider bypassing the initrd, if you use one. On Fedora, make sure to install the OS on a plain disk without encryption, and without LVM/RAID/... (encrypted /home is fine) when doing this. Then, simply edit grub.conf and remove the initrd from your configuration, and change the root= kernel command line parameter so that it uses kernel device names instead of UUIDs, i.e. "root=sda5" or what is appropriate for your system. Also specify the root FS type with "rootfstype=ext4" (or as appropriate). Note that using kernel devices names is not really that nice if you have multiple hard disks, but if you are doing this for a laptop (i.e. with a single hdd), this should be fine. Note that you shouldn't need to rebuild your kernel in order to bypass the initrd. Distribution kernels (at least Fedora's) work fine with and without initrd, and systemd supports both ways to be started.

 

How would one go about doing this in Arch, is it possible, does it require GRUB2 (as opposed to Legacy)?

Link to comment
Share on other sites

V.T. Eric Layton

Well, my reboot took longer than planned. I was trying to get rid of the dead/inactive auditd.service, plymouth-quit-wait.service, plymouth-start.service, and the rc-local.service. In the process, I realized I hadn't created the locale.conf file in /etc the other day, so I did that, too. When I rebooted, I got a locale error in dmesg and my dropbox wouldn't show in the notification area. Something is not right with the locale.conf, so I deleted it for the moment. All's OK now.

 

=====

 

root@ericsbane05|Arch/home/vtel57:# systemd-analyze
Startup finished in 5546ms (kernel) + 12916ms (userspace) = 18462ms

 

About that GRUB mod, I wouldn't do it on my system, but it looks simple enough. Just edit as shown your menu.lst for legacy GRUB and menu.conf for GRUB2.

  • Like 1
Link to comment
Share on other sites

For comparison sake I was trying to find my previous bootchart results for init based boot, but could not.

Going from memory, I think I remember something in the range of 8900 ms for this laptop to boot from GRUB to kdm login screen.

Now with systemd and some of the tweaks I am seeing average times between 3000 and 4000 ms with a lot of variation.

Edited by amenditman
Link to comment
Share on other sites

securitybreach

For comparison sake I was trying to find my previous bootchart results for init based boot, but could not.

Going from memory, I think I remember something in the range of 8900 ms for this laptop to boot from GRUB to kdm login screen.

Now with systemd and some of the tweaks I am seeing average times between 3000 and 4000 ms with a lot of variation.

 

It sounds as though you need to disable some of the daemons in /usr/lib/systemd/system/. EX:

# systemctl disable irexecd.service

Link to comment
Share on other sites

It sounds as though you need to disable some of the daemons in /usr/lib/systemd/system/. EX:

# systemctl disable irexecd.service

I plan on doing some tweaking this evening. That is a huge list in there. Any suggestions on how to go about disabling daemons? How do I decide if I need it or not? Google each one individually?

Link to comment
Share on other sites

V.T. Eric Layton

In Slack (and many other distros) you can permanently kill daemons by simply changing their permissions in /etc/rc.d to non-executable.

 

 # chmod 644 irexecd

 

I think that will still work in Arch-systemd. However, it's probably not the Arch Way. :(

Link to comment
Share on other sites

securitybreach

In Slack (and many other distros) you can permanently kill daemons by simply changing their permissions in /etc/rc.d to non-executable.

 

 # chmod 644 irexecd

 

I think that will still work in Arch-systemd. However, it's probably not the Arch Way. :(

 

Actually the syntax is:

Activate a unit immediately:

# systemctl start

Deactivate a unit immediately:

# systemctl stop

Restart a unit:

# systemctl restart

Ask a unit to reload its configuration:

# systemctl reload

Show the status of a unit, including whether it is running or not:

$ systemctl status

Check whether a unit is already enabled or not:

$ systemctl is-enabled

Enable a unit to be started on bootup:

# systemctl enable

Note: If services do not have an Install section, it usually means they are called automatically by other services. But if you need to install them manually, use the following command, replacing "foo" with the name of the service.

# ln -s /usr/lib/systemd/system/foo.service /etc/systemd/system/graphical.target.wants/

Disable a unit to not start during bootup:

# systemctl disable

Show the manual page associated with a unit (this has to be supported by the unit file):

$ systemctl help

 

https://wiki.archlin...emd#Using_Units

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
V.T. Eric Layton

Josh or Bob,

 

I think these updates today broke some stuff on my system:

 

x86_64 Core systemd 189-3 system and service manager

x86_64 Core systemd-sysvcompat 189-3 sysvinit compat for systemd

 

My ntpd.service and dropboxd.service are broken; loading, but failing. Also, I now have a whole slew of inactive/dead services that I didn't have before. :(

 

root@ericsbane05/home/vtel57:# systemctl --all | grep failed
ntpd.service			  loaded failed   failed	    Network Time Service
root@ericsbane05/home/vtel57:# systemctl --all | grep inactive
proc-sys...fmt_misc.mount loaded inactive dead		  Arbitrary Executable File Formats File System
sys-fs-f...nections.mount loaded inactive dead		  FUSE Control File System
sys-kernel-config.mount   loaded inactive dead		  Configuration File System
alsa-restore.service	  loaded inactive dead		  Restore Sound Card State
alsa-store.service	    loaded inactive dead		  Store Sound Card State
auditd.service		    masked inactive dead		  auditd.service
display-manager.service   masked inactive dead		  display-manager.service
emergency.service		 loaded inactive dead		  Emergency Shell
plymouth...t-wait.service masked inactive dead		  plymouth-quit-wait.service
plymouth-start.service    masked inactive dead		  plymouth-start.service
rc-local.service		  masked inactive dead		  rc-local.service
rescue.service		    loaded inactive dead		  Rescue Shell
sshdgenkeys.service	   loaded inactive dead		  SSH Key Generation
systemd-...onsole.service loaded inactive dead		  Dispatch Password Requests to Console
systemd-...d-wall.service loaded inactive dead		  Forward Password Requests to Wall
systemd-binfmt.service    loaded inactive dead		  Set Up Additional Binary Formats
systemd-fsck-root.service loaded inactive dead		  File System Check on Root Device
systemd-...v-sda6.service loaded inactive dead		  File System Check on /dev/sda6
systemd-...v-sda8.service loaded inactive dead		  File System Check on /dev/sda8
systemd-...v-sdc2.service loaded inactive dead		  File System Check on /dev/sdc2
systemd-initctl.service   loaded inactive dead		  /dev/initctl Compatibility Daemon
systemd-...-flush.service loaded inactive dead		  Trigger Flushing of Journal to Persistent Storage
systemd-...s-load.service loaded inactive dead		  Load Kernel Modules
systemd-...d-load.service loaded inactive dead		  Load Random Seed
systemd-...d-save.service loaded inactive dead		  Save Random Seed
systemd-...ollect.service loaded inactive dead		  Collect Read-Ahead Data
systemd-...d-done.service loaded inactive dead		  Stop Read-Ahead Data Collection
systemd-...replay.service loaded inactive dead		  Replay Read-Ahead Data
systemd-shutdownd.service loaded inactive dead		  Delayed Shutdown Service
systemd-...-clean.service loaded inactive dead		  Cleanup of Temporary Directories
systemd-...nlevel.service loaded inactive dead		  Update UTMP about System Runlevel Changes
systemd-...utdown.service loaded inactive dead		  Update UTMP about System Shutdown
emergency.target		  loaded inactive dead		  Emergency Mode
final.target			  loaded inactive dead		  Final Step
nss-lookup.target		 loaded inactive dead		  Host and Network Name Lookups
nss-user-lookup.target    loaded inactive dead		  User and Group Name Lookups
rescue.target			 loaded inactive dead		  Rescue Mode
shutdown.target		   loaded inactive dead		  Shutdown
umount.target			 loaded inactive dead		  Unmount All Filesystems
systemd-...ead-done.timer loaded inactive dead		  Stop Read-Ahead Data Collection 10s After Completed Startup

 

WAAAAAAAAA! :(

Link to comment
Share on other sites

securitybreach

First off to see why ntpd is not loading, run this command:

#[/color][size=1] systemctl enable [/size][color=#000000]ntpd[/color][color=#666600].[/color][color=#000000]service

 

As far as the inactive/dead services, I think those are services that are loaded at boot but not currently active. If I am not mistaken, some services are loaded on the fly and only when needed. For instance, look at the last couple of services:

shutdown.target loaded inactive dead Shutdown

umount.target loaded inactive dead Unmount All Filesystems

 

To me it looks like those are inactive as you are not currently unmounting a partition or rebooting. I may be wrong but that is what it looks like.

 

Mind you, you are more familiar with systemd than I am as I just set it up after your suggestion and have not really messed with it since:

 

 ╔═ comhack@Cerberus 10:52 PM 
╚═══ ~->su
Password: 
[root@Cerberus comhack]# systemctl --all | grep failed
[root@Cerberus comhack]# 
[root@Cerberus comhack]# systemctl --all | grep inactive
proc-sys...fmt_misc.mount loaded inactive dead          Arbitrary Executable File Formats File System
sys-kernel-config.mount   loaded inactive dead          Configuration File System
alsa-restore.service      loaded inactive dead          Restore Sound Card State
alsa-store.service        loaded inactive dead          Store Sound Card State
arch-modules-load.service masked inactive dead          arch-modules-load.service
auditd.service            loaded inactive dead          Audit Daemon
display-manager.service   masked inactive dead          display-manager.service
emergency.service         loaded inactive dead          Emergency Shell
plymouth...t-wait.service masked inactive dead          plymouth-quit-wait.service
plymouth-start.service    masked inactive dead          plymouth-start.service
rc-local.service          masked inactive dead          rc-local.service
rescue.service            loaded inactive dead          Rescue Shell
sshdgenkeys.service       loaded inactive dead          SSH Key Generation
systemd-...onsole.service loaded inactive dead          Dispatch Password Requests to Console
systemd-...d-wall.service loaded inactive dead          Forward Password Requests to Wall
systemd-binfmt.service    loaded inactive dead          Set Up Additional Binary Formats
systemd-fsck-root.service loaded inactive dead          File System Check on Root Device
systemd-...6c267a.service loaded inactive dead          File System Check on /dev/disk/by-uuid/3067b591-934e-4c73-a4a7-e5d9da6c267a
systemd-...528774.service loaded inactive dead          File System Check on /dev/disk/by-uuid/93723ccc-25e8-4483-ba61-dd8854528774
systemd-...bcb1b5.service loaded inactive dead          File System Check on /dev/disk/by-uuid/cb0d6b0f-1c2a-46c8-99eb-bbe4e1bcb1b5
systemd-initctl.service   loaded inactive dead          /dev/initctl Compatibility Daemon
systemd-...-flush.service loaded inactive dead          Trigger Flushing of Journal to Persistent Storage
systemd-...s-load.service loaded inactive dead          Load Kernel Modules
systemd-...d-load.service loaded inactive dead          Load Random Seed
systemd-...d-save.service loaded inactive dead          Save Random Seed
systemd-...ollect.service loaded inactive dead          Collect Read-Ahead Data
systemd-...d-done.service loaded inactive dead          Stop Read-Ahead Data Collection
systemd-...replay.service loaded inactive dead          Replay Read-Ahead Data
systemd-shutdownd.service loaded inactive dead          Delayed Shutdown Service
systemd-...-clean.service loaded inactive dead          Cleanup of Temporary Directories
systemd-...nlevel.service loaded inactive dead          Update UTMP about System Runlevel Changes
systemd-...utdown.service loaded inactive dead          Update UTMP about System Shutdown
emergency.target          loaded inactive dead          Emergency Mode
final.target              loaded inactive dead          Final Step
nss-user-lookup.target    loaded inactive dead          User and Group Name Lookups
rescue.target             loaded inactive dead          Rescue Mode
shutdown.target           loaded inactive dead          Shutdown
umount.target             loaded inactive dead          Unmount All Filesystems
systemd-...ead-done.timer loaded inactive dead          Stop Read-Ahead Data Collection 10s After Completed Startup
[root@Cerberus comhack]# systemctl --all | grep error 
[root@Cerberus comhack]# 

Link to comment
Share on other sites

V.T. Eric Layton

You seem to be correct about them being nothing to worry about, J.

 

https://bbs.archlinux.org/viewtopic.php?pid=1151151#p1151151

 

However, the dropbox daemon is running, but not my panel icon. Also, when I enable the ntpd.service and then start it, it still fails. :(

 

root@ericsbane05/home/vtel57:# systemctl enable ntpd.service
root@ericsbane05/home/vtel57:# systemctl start ntpd.service
root@ericsbane05/home/vtel57:# systemctl --all | grep failed
ntpd.service			  loaded failed   failed	    Network Time Service

 

Late. I'm going to bed. I'll snoop around a bit more tomorrow. Thanks. :)

Link to comment
Share on other sites

securitybreach

You seem to be correct about them being nothing to worry about, J.

 

https://bbs.archlinu...151151#p1151151

 

However, the dropbox daemon is running, but not my panel icon. Also, when I enable the ntpd.service and then start it, it still fails. :(

 

root@ericsbane05/home/vtel57:# systemctl enable ntpd.service
root@ericsbane05/home/vtel57:# systemctl start ntpd.service
root@ericsbane05/home/vtel57:# systemctl --all | grep failed
ntpd.service			  loaded failed   failed		Network Time Service

 

Late. I'm going to bed. I'll snoop around a bit more tomorrow. Thanks. :)

 

Sounds good!! We will figure out what the problem is B)

Link to comment
Share on other sites

V.T. Eric Layton

Well, the ntpd.service failing issue was caused by a corrupted locale. I had to create a new /etc/locale.gen file (using Arch Wiki guidance) and rerun the command:

 

# locale-gen

 

To fix the locale issue, which in turn seems to have fixed the ntpd.service issue.

 

About the Dropbox, though...

 

The daemon is loading and running fine. I just no longer have the Dropbox icon in my notification area. Plus, I'm getting an error at logoff that says "an instance of dropbox is already running (PID)". *shrugging* :(

Link to comment
Share on other sites

V.T. Eric Layton

Well, I don't know how my dropbox got messed up, but I was able to fix it.

 

> Disable dropboxd.service at boot up:

 

# systemctl disable dropboxd.service

 

> Enable Dropbox using Xfce4 Session Manager:

 

Go to Xfce Menu --> Settings --> Session & Startup --> add Dropbox

 

All's well now. :)

Link to comment
Share on other sites

Well this has been an interesting read. I have not jumped into yet and obviously it is something that is going to take some time but from what Josh mentioned in an earlier post. We Arch users are going to have to do all of this eventually???

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...