Link to home
Start Free TrialLog in
Avatar of Jasaida
Jasaida

asked on

enable/disable systemd on ubuntu?

how to enable/disable systmctl "systemd command)?
Avatar of David Favor
David Favor
Flag of United States of America image

You can't really do this.

Disabling systemd will brick your system.

Brick == system won't work or reboot.

If you dislike systemd, then switch to using an OpenRC based Distro like Alpine.
Avatar of Dr. Klahn
Dr. Klahn

I agree with  your feelings about systemd, and the first thing I do when I bring up a new Debian system is get rid of it and replace it with sysvinit.

This is a popular issue and there are numerous commentaries about it.  It's pretty simple, as detailed at the page below.  Ubuntu being built atop Debian, this should also work for your system.

http://without-systemd.org/wiki/index.php/How_to_remove_systemd_from_a_Debian_Stretch_installation

  1.     Install the sysvinit packages: apt-get install sysvinit-core
  2.    Copy inittab: cp /usr/share/sysvinit/inittab /etc/inittab
  3.    Reboot the system: reboot

I also remove cgroups, but many would consider this to be going too far.

Check to see if cgroups are active
  >mount
  If they are, disable them at boot time
  Disable kernel EFI support as well ...
  And network interface renaming ...
  >nano /etc/default/grub
    GRUB_CMDLINE_LINUX_DEFAULT="noefi net.ifnames=0 biosdevname=0 cgroup_disable=cpuset,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,net_prio,perf_event,pids,systemd"
    GRUB_CMDLINE_LINUX="noefi net.ifnames=0 biosdevname=0 cgroup_disable=cpuset,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,net_prio,perf_event,pids,systemd"
  >update-grub
  >reboot -s now

Open in new window

Avatar of Jasaida

ASKER

I do not have a proble or dislike  systemd. acctully i want to run stystemd, but for (i don't know) resean systemd is not working on min ubuntu 16 and when i using systemct status ssh i get error : Failed to get properties: No such interface ''
i want to enable systemd then if it's take a some mismatch with the other custom service den i want to disable it.

" sudo systemctl  daemon-reload  is not help.:-)
ASKER CERTIFIED SOLUTION
Avatar of Jasaida
Jasaida

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, likely not.

If you had to reinstall systemd, I'd say you best reinstall your entire OS from scratch.

If systemd was somehow clobbered/broken, likely many other packages may also have problems.

I suggest a full reinstall + start with Ubuntu 18 (Bionic) rather than 16 (Xenial), as Xenial is already very old.

Bionic fixes... to many things to even begin naming, over Xenial.