Announcement

Collapse
No announcement yet.

Why Systemd?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Why Systemd?

    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    #2
    Good intro video and launching point for those not familiar with systemd.
    ​"Keep it between the ditches"
    K*Digest Blog
    K*Digest on Twitter

    Comment


      #3
      Thanks for this. Good run down of some of the benefits of using it. Hard to find when everybody is arguing about how much it sucks...

      Comment


        #4
        When I first encountered systemd I was antagonistic towards it, as some of my earlier posts in this forum will show. Linus Torvald's rant two years ago against a former co-developer of Systemd, for "continually submitting code which breaks downstream packages" and he wasn't going to merge his future code, was the tipping point. However, when I began searching for a distro that did not feature Systemd or planned to go to it in a future release, I realized that there were NO other choices for me since I did not want to use Slackware or Gentoo. So, I greased up my 75 year old brain and set about to learn as much as I could absorb about Systemd. It's been in rapid development since 2010 (and under the radar much of that time) and a LOT of the online videos and documentation is too old or out of date to be helpful, so I began restricting myself to reading and viewing only sources made available this year.

        It's been an eye-opener! SystemD has been called an "octopus" or "fungus" because its tentacles or rhizomes are creeping into every bit of Linux. And, it is! Whereas Upstart is a collection of sysVinit and previous shell scripts, each with their own script formatting and layout, varying from distro to distro and not standardized at all, Systemd is uniform across distros, with minor changes in unit names, but with the same conf structure for each unit. One can edit all units (services, targets, mounts, paths, etc...) in one location! When one install systemd-gui, along with kde-config-systemd and a couple of other packages, a very nice SystemD GUI appears in SystemSettings5. In that GUI one can control just about every aspect of a distro's operation. The rest of SystemSettings5 is to control various aspects of Plasma5 and some devices.

        For example. For several months my wifi connection has been stable. There were some updates yesterday that didn't seem related to my wifi connection. However, this morning an old pattern appeared that had, in the past, forced me to use my cable connection instead. When the wifi connects the NetworkManager complains and immediately disconnects it. In the past, deleting my old ESSID configuration and redoing it didn't help, which was why I used my cable connection for the first couple of months I used 16.04. This morning, after a dozen of so connect-disconnect messages I opened SystemSettings5 and fired up the Systemd GUI. I went to the NetworkManager.service, right clicked on it and chose "restart". That was four hours ago. My wifi has been solid every since.

        I suspect that even KDE, which has its config files spread throughout ~/.kde, ~/.local and ~/.config and SystemSettings, will get its act together and merge with Systemd, so folks don't have to go drilling down through hidden directories to find disconnected config files that have obtuse formatting and config demands.

        On a distro wide basis, I can see a Linux distro being reduced to three basic components: the kernel, Systemd and the user interface, be it a console or a desktop.

        As far as some who claim that Systemd is a "great unknown" that would be a haven for government spying then their only solution would be to use a distro that compiles all code from the source files. But to be sure that the government hasn't embedded a TSL-like hole in the code they would first have to examine every line of every source file to be sure it is free of embedded "doors". Except for security researchers paid to do that, I don't know of anyone else who has the time or the skill level to do that. As a retired programmer myself, even IF I devoted 8-10 hours every day scouring the Arch or Gentoo code I doubt that I would be able to look at all 800-1000 source files that comprise a bare-bones Arch or Gentoo release before the next release became available. I wouldn't have time to even compile the code before I ran the distro. Besides, that's what vetted repositories are for. One hundred and sixty people can do in a day what it would take one person 160 days to do.



        The libc6 library is another matter:
        Any Unix-like operating system needs a C library: the library which defines the ``system calls'' and other basic facilities such as open, malloc, printf, exit...

        The history of Unix and various standards determine much of the interface of the C library. In general the GNU C Library supports the ISO C and POSIX standards. We also try to support the features of popular Unix variants (including BSD and System V) when those do not conflict with the standards. Different compatibility modes (selectable when you compile an application) allow the peaceful coexistence of compatibility support for different varieties of Unix.
        I can see Systemd absorbing the functions that libc6 are currently required to do.

        So, instead of listening to the complainers I began researching Systemd itself.
        Last edited by Snowhog; Oct 10, 2016, 06:39 PM.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Originally posted by GreyGeek View Post
          So, instead of listening to the complainers I began researching Systemd itself.
          Ah, taking the road less traveled! Good for you!
          Windows no longer obstructs my view.
          Using Kubuntu Linux since March 23, 2007.
          "It is a capital mistake to theorize before one has data." - Sherlock Holmes

          Comment


            #6
            "The only constant is change itself"

            I'll be following this thread and Systemd. It looks like the choices outside of this will become limited in the future...
            Kubuntu 24.11 64bit under Kernel 6.12.3, Hp Pavilion, 6MB ram. Stay away from all things Google...

            Comment


              #7
              Nice video. I wasn't in any camp on that one. I understood both sides so that just left me.... well, don't know as I really was in the middle on that one.

              Comment


                #8
                I was continuing my self-studies of Systemd by following example commands given for it on this web page.

                In 15.04 and 15.10 one could switch between Upstart and Systemd. When I installed 16.04, and added Neon on top of it, I assumed that I could do the same, so I followed the procedure used in 15.10 and attempted to switch to Upstart. The result was that I borked my installation because one cannot switch 16.04 from Systemd to Upstart in 16.04. That led me to believe that Systemd was started by the kernel first thing. Indeed, the systemd-analyze plot graph seemed to show just that:
                Click image for larger version

Name:	Screenshot_20161012_112659.jpg
Views:	1
Size:	86.7 KB
ID:	643344

                That is, it was PID=1.

                That's why the results from the following command stunned me:
                ps -aef | grep [s]ystemd
                Systemd has PID=318

                PID=1 is /sbin/init

                That is Upstart/SysVinit. So, systemd is setting on top of Upstart, which explains
                Upstart has not been removed and can't be removed. Systemd is not yet ready to be PID=1.
                It also explains why systemctl seems to be doing (some/a lot) of its work by calling init services,
                even from the systemd-gui in Systemsettings5. Any why, when mysql is installed, for example,
                one cannot control it using systemd-gui or systemctl.
                Code:
                :~$ [B]systemctl status mysql[/B]
                ● mysql.service
                   Loaded: not-found (Reason: No such file or directory)
                   Active: inactive (dead)
                
                :~$ [B]systemctl status mysqld[/B]
                ● mysqld.service
                   Loaded: not-found (Reason: No such file or directory)
                   Active: inactive (dead)
                
                :~$ [B]whereis mysqld[/B]
                mysqld: /usr/sbin/mysqld /usr/share/man/man8/mysqld.8.gz
                jerry@jerry-Aspire-7739:~$ ps -aef | grep [m]ysql
                jerry     1789  1786  0 11:00 ?        00:00:03 /usr/sbin/mysqld --defaults-file=/home/jerry/.local/share/akonadi/mysql.conf --datadir=/home/jerry/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-jerry.HXGeTN/mysql.socket
                :~$
                Even if, for the present, Systemd is using Upstart/init scripts in the background to do the heavy lifting, Systemd-gui is a convenient one-stop shopping center for all most of your service needs.

                I'm looking forward to when Kubuntu drops Upstart completely and becomes a pure Systemd disto. That will probably depend on Debian and Ubuntu. I have not tried 16.10. Does anyone know what the PID=1 task is for that release?
                Last edited by GreyGeek; Oct 12, 2016, 11:06 AM.
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment


                  #9
                  Not sure if this/you have mentioned this, but a rather nice aspect of Systemd (the GUI app) is that it allows you to open/see everything it displays without having to do so 'as root'. You are only prompted to authenticate (provide your password) if you have made changes and you want to save them.
                  Windows no longer obstructs my view.
                  Using Kubuntu Linux since March 23, 2007.
                  "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                  Comment


                    #10
                    Originally posted by GreyGeek View Post

                    PID=1 is /sbin/init

                    That is Upstart/SysVinit. So, systemd is setting on top of Upstart, which explains
                    Upstart has not been removed and can't be removed. Systemd is not yet ready to be PID=1.
                    Not really, in recent versions of *buntus, /sbin/init is (should be) a symlink to /lib/systemd/systemd
                    Code:
                    $ls -l /sbin/init
                    lrwxrwxrwx 1 root root 1K 05.10.2016 03:12 /sbin/init -> /lib/systemd/systemd
                    And upstart can certainly be removed (and it shouldn't be installed at all by default)

                    You might be confused by the fact that systemd commonly runs several processes, only one of which is pid 1:
                    Code:
                    $pgrep -l systemd
                    1 systemd
                    243 systemd-journal
                    321 systemd-udevd
                    624 systemd-timesyn
                    741 systemd-logind
                    1111 systemd
                    Last edited by kubicle; Oct 12, 2016, 02:20 PM.

                    Comment


                      #11
                      Originally posted by kubicle View Post
                      Not really, in recent versions of *buntus, /sbin/init is (should be) a symlink to /lib/systemd/systemd
                      Code:
                      $ls -l /sbin/init
                      lrwxrwxrwx 1 root root 1K 05.10.2016 03:12 /sbin/init -> /lib/systemd/systemd
                      And upstart can certainly be removed (and it shouldn't be installed at all by default)

                      You might be confused by the fact that systemd commonly runs several processes, only one of which is pid 1:
                      Code:
                      $pgrep -l systemd
                      1 systemd
                      243 systemd-journal
                      321 systemd-udevd
                      624 systemd-timesyn
                      741 systemd-logind
                      1111 systemd
                      pgrep is a new one on me. A process grep command. Nice.

                      I'm confused? Indeed! It looks like a shell game:
                      Code:
                      :-$ [B]ps aux | less[/B]
                      USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
                      root         [B]1[/B]  0.0  0.0 185444  6044 ?        Ss   10:59   0:01 [B]/sbin/init[/B] splash
                      root         2  0.0  0.0      0     0 ?        S    10:59   0:00 [kthreadd]
                      root         3  0.0  0.0      0     0 ?        S    10:59   0:00 [ksoftirqd/0]
                      ...
                      I never noticed nor did it ever dawn on me that /sbin/init was a link to systemd.
                      Upstart/sysVinit was associated with init.d and I made too quick an assumption about /sbin/init. Wish I had known about pgrep.

                      I mistyped when I said Upstart cannot be removed. In my previous installation I was trying to switch from systemd to upstart and I installed upstart. It was when I attempted to remove systemd that I ran into a dependency roadblock. So, having installed upstart, I changed the grub kernel line on the run to fire upstart and my system when bye-bye.

                      That explains why my attempts to remove systemd borked my system. With Sam's input I realized that Upstart isn't really installed on my current system.
                      Code:
                      :~$ [FONT=courier new][B]locate upstart[/B][/FONT]
                      /etc/init/usb-modeswitch-upstart.conf
                      /etc/network/if-down.d/upstart
                      /etc/network/if-up.d/upstart
                      /lib/lsb/init-functions.d/01-upstart-lsb
                      /usr/share/upstart
                      /usr/share/doc/pulseaudio/examples/pulseaudio.upstart.example
                      /usr/share/locale-langpack/en@boldquot/LC_MESSAGES/upstart.mo
                      /usr/share/locale-langpack/en@quot/LC_MESSAGES/upstart.mo
                      /usr/share/locale-langpack/en_AU/LC_MESSAGES/upstart.mo
                      /usr/share/locale-langpack/en_CA/LC_MESSAGES/upstart.mo
                      /usr/share/locale-langpack/en_GB/LC_MESSAGES/upstart.mo
                      /usr/share/upstart/sessions
                      /usr/share/upstart/xdg
                      /usr/share/upstart/sessions/at-spi2-registryd.conf
                      /usr/share/upstart/sessions/dbus.conf
                      /usr/share/upstart/sessions/gpg-agent.conf
                      /usr/share/upstart/sessions/im-config.conf
                      /usr/share/upstart/sessions/no-pinentry-gnome3.conf
                      /usr/share/upstart/sessions/session-migration.conf
                      /usr/share/upstart/sessions/ssh-agent.conf
                      /usr/share/upstart/xdg/autostart
                      /usr/share/upstart/xdg/autostart/at-spi-dbus-bus.desktop
                      /var/lib/app-info/icons/ubuntu-xenial-main/64x64/upstart-monitor_upstart-monitor.png
                      /var/lib/app-info/icons/ubuntu-xenial-updates-main/64x64/upstart-monitor_upstart-monitor.png
                      
                      :~$[FONT=courier new][B] whereis upstart[/B][/FONT]
                      upstart: /usr/share/upstart
                      
                      :~$ [FONT=courier new][B]vdir /usr/share/upstart[/B][/FONT]
                      total 8
                      drwxr-xr-x 2 root root 4096 Sep  6 23:31 sessions
                      drwxr-xr-x 3 root root 4096 Sep  6 23:30 xdg
                      
                      :~$ [FONT=courier new][B]vdir /usr/share/upstart/sessions/[/B][/FONT]
                      total 28
                      -rw-r--r-- 1 root root 401 Feb 24  2016 at-spi2-registryd.conf
                      -rw-r--r-- 1 root root 765 Apr  1  2016 dbus.conf
                      -rw-r--r-- 1 root root 992 Apr  8  2016 gpg-agent.conf
                      -rw-r--r-- 1 root root 935 Mar 25  2016 im-config.conf
                      -rw-r--r-- 1 root root 332 Jul  3  2015 no-pinentry-gnome3.conf
                      -rw-r--r-- 1 root root 159 May  7  2015 session-migration.conf
                      -rw-r--r-- 1 root root 792 Aug 11 11:24 ssh-agent.conf
                      
                      :~$ [FONT=courier new][B]vdir /usr/share/upstart/xdg[/B][/FONT]
                      total 4
                      drwxr-xr-x 2 root root 4096 Sep  6 23:30 autostart
                      
                      :~$ [FONT=courier new][B]vdir /usr/share/upstart/xdg/autostart/[/B][/FONT]
                      total 4
                      -rw-r--r-- 1 root root 135 Feb 24  2016 at-spi-dbus-bus.desktop
                      Now I am wondering why systemd-gui (or systemctl) doesn't seem know about mysql or mysqld?
                      :-$ systemctl status mysql.service
                      ● mysql.service
                      Loaded: not-found (Reason: No such file or directory)
                      Active: inactive (dead)
                      :~$ systemctl status mysqld
                      ● mysqld.service
                      Loaded: not-found (Reason: No such file or directory)
                      Active: inactive (dead)

                      :~$ whereis mysqld
                      mysqld: /usr/sbin/mysqld /usr/share/man/man8/mysqld.8.gz
                      jerry@jerry-Aspire-7739:~$ ps -aef | grep [m]ysql
                      jerry 1789 1786 0 11:00 ? 00:00:03 /usr/sbin/mysqld --defaults-file=/home/jerry/.local/share/akonadi/mysql.conf --datadir=/home/jerry/.local/share/akonadi/db_data/ --socket=/tmp/akonadi-jerry.HXGeTN/mysql.socket
                      I'm not going to temp fate by trying to disable it as a test
                      systemctl stop mysql(d) or systemctl disable mysql(d)

                      since KMail and akonadi are working well on my system.

                      Edit: What's with the emoticons appearing as icons while editing and as text when posted?
                      Last edited by GreyGeek; Oct 12, 2016, 06:13 PM.
                      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                      – John F. Kennedy, February 26, 1962.

                      Comment


                        #12
                        Originally posted by GreyGeek View Post
                        Edit: What's with the emoticons appearing as icons while editing and as text when posted?
                        It's a glitch in a very minor change I made to one of the vBulletin files some time back. Long story short, just click the Go Advanced button and scroll down and uncheck/recheck the Disable smilies in text (to have icon smilies not show in text) or uncheck to have icon smilies appear in text.

                        I did this to prevent iconized smiles from appearing in code tagged konsole output. However, the proffered fix (from over on vBulletin.com Forums) isn't entirely perfect.

                        Added:

                        Actually, I only made the change to style KFNBlue. If you aren't using that style, the unmodified behavior is in effect; the option is unchecked by default. Her is my Administrative note:
                        2016-07-31
                        Administrator: Snowhog
                        Edited KFNBlue's newpost_disablesmiliesoption template to enable 'Disable smilies in text' option in new posts. The change made for this on 2016-05-13 didn't actually work, so inquired as to why on vBulletin Forums and made a change recommended by MarkFL, changing {vb:raw checked="checked"} to just checked="checked". Typed smilies still show in the Your Message window if you click on Preview Post, but the actual post doesn't convert the typed smilies to graphical smilies. Acceptable, but I've also inquired if he knows why this happens.

                        Added:

                        If you're interested, this is the thread on vBulletin Forums.
                        Last edited by Snowhog; Oct 13, 2016, 03:24 PM.
                        Windows no longer obstructs my view.
                        Using Kubuntu Linux since March 23, 2007.
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          Originally posted by Snowhog View Post
                          It's a glitch in a very minor change I made to one of the vBulletin files some time back. Long story short, just click the Go Advanced button and scroll down and uncheck/recheck the Disable smilies in text (to have icon smilies not show in text) or uncheck to have icon smilies appear in text.
                          ....
                          Ah! That fixed it! Thanks! Now I can wear my dunce cap proudly.
                          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                          – John F. Kennedy, February 26, 1962.

                          Comment


                            #14
                            Originally posted by GreyGeek View Post
                            Code:
                            :-$ [B]ps aux | less[/B]
                            USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
                            root         [B]1[/B]  0.0  0.0 185444  6044 ?        Ss   10:59   0:01 [B]/sbin/init[/B] splash
                            Yes, ps aux lists processes with the command used to start them, not the actual executable. You can check that systemd is actually pid 1 with:
                            Code:
                            $sudo ls -l /proc/1/exe
                            Originally posted by GreyGeek View Post
                            Now I am wondering why systemd-gui (or systemctl) doesn't seem know about mysql or mysqld?
                            Commonly (and in the default install) the mysql (or mariadb) systemd service unit is not installed (the service is in package mysql-server-{version}), and therefore mysqld is not started by systemd. A system wide mysqld instance (which would be started by systemd) is usually not necessary for desktop machines (unless you are running a web server on that machine, for example).
                            Code:
                            $apt-file search mysql.service
                            mysql-server-5.7: /lib/systemd/system/mysql.service
                            Instead, akonadi (the PIM backend) will start a local mysqld instance for every user (if you are running akonadi with the mysql backend...which is the default)
                            Last edited by kubicle; Oct 12, 2016, 09:55 PM.

                            Comment


                              #15
                              Ah, another CLI tool I was unaware of, even though I've used apt-get and apt-cache for years.

                              I've been using Linux since 1998, and beginning with the move to Upstart what I used to know about Linux has become outdated and replaced, and learning what is replacing past tools is becoming, for me, a full time job. Luckily, I'm retired and can devote more time to it. Unfortunately, my brain doesn't work as well as it used to.

                              :~$ apt-file search mysql.service
                              The program 'apt-file' is currently not installed. You can install it by typing:
                              sudo apt install apt-file

                              :~$ sudo apt install apt-file
                              [sudo] password for jerry:
                              Reading package lists... Done
                              Building dependency tree
                              Reading state information... Done
                              ....
                              After this operation, 349 kB of additional disk space will be used.
                              Do you want to continue? [Y/n]
                              Get:1 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 libconfig-file-perl all 1.50-3 [9,722 B]
                              Get:2 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 libregexp-assemble-perl all 0.36-1 [77.5 kB]
                              Get:3 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 apt-file all 2.5.5ubuntu1 [21.6 kB]
                              Fetched 109 kB in 0s (233 kB/s)
                              ....

                              :~$ apt-file search mysql.service
                              E: The cache is empty. You need to run 'apt-file update' first.

                              :~$ apt-file update
                              apt-file is now using the user's cache directory.
                              If you want to switch back to the system-wide cache directory,
                              run 'apt-file purge'
                              Downloading complete file http://us.archive.ubuntu.com/ubuntu/...tents-amd64.gz
                              % Total % Received % Xferd Average Speed Time Time Time Current
                              Dload Upload Total Spent Left Speed
                              100 31.7M 100 31.7M 0 0 2091k 0 0:00:15 0:00:15 --:--:-- 2506k
                              ......
                              Downloading complete file http://archive.ubuntu.com/ubuntu/dis...tents-amd64.gz
                              % Total % Received % Xferd Average Speed Time Time Time Current
                              Dload Upload Total Spent Left Speed
                              100 1378k 100 1378k 0 0 954k 0 0:00:01 0:00:01 --:--:-- 955k

                              :~$ apt-file search mysql.service
                              mysql-server-5.7: /lib/systemd/system/mysql.service
                              :~$
                              And there it is!

                              Thanks Sam, the info you supplied has cleared up a lot of confusion on my part. I never knew that
                              ps aux lists processes with the command used to start them, not the actual executable
                              Has that always been the case? I've read tons on how Linux worked over the years and do not recall reading that before.

                              I noticed that systemd does not use /etc/inittab, which I understood well and used, but which is no longer in my /etc directory. Changes like that made me feel like I am walking on quicksand, with Tux doing magic ps tricks with both sleeves rolled up! When I though about the process that led to my current ignorance of Linux, after having known it so well for over 10 years, I can trace it back to January of 2009, when I first installed Kubuntu 9.04 Alpha and decided to move away from the command line and use GUI config tools from then on. I never bothered to look into the internal workings of Upstart and felt justified in doing so because it came and went within a single computer generation.

                              I was going to remain with Kubuntu 14.04 till its EOL, which I thought I had read was 2019. When I learned it was 2017, I didn't see any reason not to switch to 16.04, except for the matte theme of Plasma5, which I hated. For three months earlier this year I ran Mint KDE and others as guest OS's, but all of them were moving to Plasma5. So, I came back to Kubuntu and installed 16.04 and set about making the theme as Plasma4-like as possible. That's when I ran into Systemd. At first it felt like I had encountered the Alien aboard spaceship Kubuntu, and it was eating my guts out.

                              At first I hated it but since almost EVERY major distro was switching to it I decided to ignore the dissenters and learn about it. My first learning problem was that Systemd started in 2010 and has had a rapid development cycle. There was a lot of conflicting information between then and now, and between various distros, which have varying degrees of implementation of systemd. I decided to limit my searches to articles written since January of this year, and to make this thread a sort of "blog" of my learning experiences, and a place to store links and info that I can refer to later as my memory continues to fade.
                              Thanks again, Sam!
                              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                              – John F. Kennedy, February 26, 1962.

                              Comment

                              Working...
                              X