System V style init and systemd in practice

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Administration with systemadm (systemd)

This GUI program, available on Ubuntu via the systemd-ui package, makes it possible to quickly and easily administer systemd and the services [5][6].

The interface is self-explanatory and the operation itself takes little getting used to. Figure 10 shows a status request.

Figure 10: Status notification with systemadm.

syslog vs. journald

Now that you are using systemd for your services, you should also use systemd-journald instead of syslog . This can be handled as you prefer. For example, you can change from syslog to systemd-journald or vice versa.

When you use journald , the log data will only be saved during runtime. You can modify the configuration by changing entries in /etc/systemd/journald.conf . By using the setting Storage=persistent you can permanently save the journal in /var/log/journal . You should limit the size of the log with something like SystemMaxUse=100M . Listing 8 shows all of the items in this file that have been modified. Note that the log files from systemd/journald are not searchable with customary text tools like find, grep, etc. You will need to use journalctl .

Listing 8

Storing Logs Using journald

01 [Journal]
02 Storage=persistent
03 ......
04 SystemMaxUse=100M
05 ......

To see the logs using journalctl , you can enter the command without any other option and the program will list a complete journal. Table 8 contains some filtering possibilities.

Table 8

Journalctl – Important Options

Limit to one unit -u UNIT
Kernel messages -k
Additional output of plaintext explanations -x
Running display -f

Figure 11 shows a journal request that was limited to one service, apache.2service .

Figure 11: Journal inquiry for apache2.service.

Buy this article as PDF

Express-Checkout as PDF

Pages: 1

Price $0.99
(incl. VAT)

Buy Ubuntu User

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Systemd as central control for the Linux system

    Some Linux followers see systemd as the best thing since sliced bread – for others, it's the work of the devil. However, it also has the stuff to clear out old trenches and form a unified base for Linux.

  • Innovation in the Linux environment

    Testers constantly encounter new trends in the experimental branches of Linux distributions. I look at who drives Linux forward and how the future is shaping up.

  • What is Upstart?

    Originally created for use in Ubuntu, Upstart is suitable for deployment in all Linux distributions as an alternative to the System-V init.

  • Installing and testing Nextcloud

    Leading ownCloud developers, including the project founder Frank Karlitschek, became dissatisfied with the direction of the project, so they started Nextcloud, a fork of the code and a new company. The goal is to create a better balance among the company, clients, and users. We take a look at how Nextcloud is faring.

  • Use multiple distributions at the same time with Bedrock Linux

    Bedrock transparently combines virtually any number of distributions with different architectures, package management, and init systems under a filesystem.