When it first started out, there was a lot of press about systemd and its ability to speed up boot time. That feature had a mostly-universal appeal (it's less important to those who don't reboot), so in many ways, that's the reputation it still has today. And while it's true that systemd is the thing that launches services in parallel during startup, there's a lot more to it than that. Here are three things you may not have realized systemd could do but should be taking advantage. Get more tips from our new downloadable eBook, A pragmatic guide to systemd.
1. Simplify Linux psIf you've ever used the ps or even just the top command, then you know that your computer is running hundreds of processes at any given moment. Sometimes, that's exactly the kind of information you need in order to understand what your computer, or its users, are up to. Other times, all you really need is a general overview.
The systemd-cgtop command provides a simple view of your computer's load based on the cgroups (control groups) tasks have been arranged into. Control groups are important to modern Linux, and are essentially the support structures underneath containers and Kubernetes (which in turn are why the cloud scales the way it does), but also they're useful constructs on your home PC. For instance, from the output of systemd-cgtop, you can see the load of your user processes as opposed to system processes:
Control Group Proc+ %CPU Memory Input/s Output/s / 183 5.0 1.6G 0B 3.0M user.slice 4 2.8 1.1G 0B 174.7K user.slice/user-1000.slice 4 2.8 968.2M 0B 174.7K system.slice 65 2.2 1.5G 0B 2.8MYou can also view just your userspace processes, or just your userspace processes and kernel threads.
This isn't a replacement for top or ps by any means, but it's an additional view into your system from a different and unique angle. And it can be vital when running containers, because containers use cgroups.
2. Linux cronCron is a classic component of Linux. When you want to schedule something to happen on a regular basis, you use cron. It's reliable and pretty well integrated into your system.
The problem is, cron doesn't understand that some computers get shut down. If you have a cronjob scheduled for midnight, but you turn your computer off at 23:59 every day, then your cronjob never runs. There's no facility for cron to detect that there was a missed job overnight.
As an answer to that problem, there's the excellent anacron, but that's not quite as integrated as cron. There's a lot of setup you have to do to get anacron running.
A second alternative is systemd timers. Like cron, it's already built in and ready to go. You have to write a unit file, which is definitely more lines than a one-line crontab entry, but it's also pretty simple. For instance, here's a unit file to run an imaginary backup script 30 minutes after startup, but only once a day. This ensures that my computer gets backed up, and prevents it from trying to backup more than once daily.
[Unit] Description=Backup Requires=myBackup.service [Timer] OnBootSec=30min OnUnitActiveSec=1d [Install] WantedBy=timers.targetYou can, of course, intervene and prompt a job to run with . Thanks to the OnUnitActiveSec directive, systemd doesn't attempt to run a job you've manually activated.
Linux Containers What are Linux containers? What is Kubernetes? Free online course: Deploy containerized applications eBook: A guide to Kubernetes for SREs and sysadmins Free online course: Running containers with Red Hat technical overview Podman cheat sheet The latest articles on Linux containers 3. Run Linux containersContainers make starting up a complex service really easy. You can run a Mattermost or Discourse server in mere minutes. The hard part, in some cases, is managing and monitoring the containers once you have them running. Podman makes it easy to manage them, but what do use to manage Podman? Well, you can use systemd.
Podman has a built-in command to generate unit files so your containers can be managed and monitored by systemd:
$ podman generate systemd --new --files --name example_podAll you have to do then is start the service:
$ systemctl --user start pod-example_pod.serviceAs with any other service on your computer, systemd ensures that your pod runs no matter what. It logs problems, which you can view with journalctl along with your other essential logs, and you can monitor its activity within cgroups using systemd-cgtop.
It's no Kubernetes platform, but for one or two containers that you just want to have available on a reliable and predictable basis, Podman and systemd are an amazing pair.
Download the systemd eBookThere's a lot more to systemd, and you can learn the basics, along with lots of useful and pragmatic tips, from author David Both in his new complimentary pragmatic guide to systemd.
It's not just for making your computer boot faster. Download our new systemd eBook for Linux sysadmins for more tips.
Image by:Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0
Sysadmin Linux Containers What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. Register or Login to post a comment.Threaded online conversations are a relatively new form of communication that can improve knowledge transfer and availability, but they can also stray from the original intent. Online technical conversations in open source communities using Slack or one of the several open source alternatives experience these benefits and drawbacks.
Say a community member posts a question or shares an idea to start a conversation. As in any conversation, sometimes things can get off track. While not all diversions from the prompt are unhelpful, there are times when a comment can be unproductive—and sometimes even hurtful.
The Drupal community is like most other open source communities, in that we have many online conversations happening at any given time, in a variety of places. Sometimes, when a community member flags an online comment as hurtful, the Drupal Community Working Group (CWG) is asked to step in and mediate the situation. The CWG is responsible for maintaining the health of the community. Often, the solution is as simple as reminding the author of the comment of the Code of Conduct.
In 2020, the CWG began looking into how they could crowdsource this activity in a way that would be predictable and non-confrontational. The group decided to author several nudges: prewritten, formatted responses that community members could copy and paste into an online conversation to get conversations back on track.
The Drupal community currently has five different nudges depending on the situation. It is up to community members to select one from this list:
For example, the inclusive language, ableist terms nudge contains this message:
This discussion appears to include the use of ableist language in a comment. Ableist language can be harmful to our community because it can devalue challenges experienced by people with disabilities.
For more information, please refer to Drupal’s Values and Principles about treating each other with dignity and respect.
This comment is provided as a service (currently being tested) of the Drupal Community Health Team as part of a project to encourage all participants to engage in positive discourse. For more information, please visit https://www.drupal.org/project/drupal_cwg/issues/3129687
Our favorite resources about open source Git cheat sheet Advanced Linux commands cheat sheet Open source alternatives Free online course: RHEL technical overview Check out more cheat sheetsCurrently, using one of the nudges is a manual copy-paste process, but the group is discussing the possibility of providing tools for easier use. We provide both formatted (for forum and issue queues) and unformatted (Slack) versions of each nudge. The CWG is also working on adding a sixth nudge for unhelpful or inauthentic comments. This nudge is aimed at discouraging users who add comments to a thread solely to gain a contribution credit on the issue.
Over the past two years that nudges have been available, the CWG has not fielded any complaints related to their use. While the number of conflicts between community members escalated to the CWG has declined during this period, it is difficult to attribute this solely to nudges. Other efforts have been made to improve community health (not to mention outside factors). Nevertheless, the CWG feels that nudges have been a net positive to the community and continues to access, improve, and encourage their use. In a blog post to the community announcing their general availability, the CWG wrote:
To continue to grow a healthy community, we all must work under the assumption that no one intentionally uses language to hurt others. Even so, despite our best efforts we sometimes still use words or phrases that are discouraging, harmful, or offensive to others. We are all human beings who make mistakes, but as members of a shared community, it's our responsibility to lift each other up and encourage the best in each other.
Prewritten nudges for various situations are useful prompts for members of any community to keep conversations productive and encouraging—and do so in a friendly way!
The Drupal community uses nudges to keep conversations productive and inclusive.
Drupal Community management Diversity and inclusion What to read next This work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. 203 points Ipswich, UKRuth has been a keen advocate of Open Source for over 18 years.
As a contributor to the Joomla! and Mautic community, she volunteered on the Joomla! Community Leadership Team for over three years, and currently works as Project Lead for Mautic, the world's first open source marketing automation platform, at Acquia.
Ruth is a keen runner, and lives with a condition called Ehlers-Danlos Syndrome which means that she sometimes needs to use a wheelchair or walking aids.
| Follow RCheesley Open Minded Author Linux Community Manager Geek Joomla Contributor Club 931 points San Francisco Bay AreaAmyJune is an experienced community manager, mentor, public speaker, and inclusion advocate. While her roots are in Drupal, she also contributes regularly to the Linux and Accessibility communities. With a dual focus on both open-source community development and inclusivity, she is uniquely positioned to help individuals become more comfortable and confident as they contribute to their communities.
AmyJune lives adjacent to the San Francisco Bay Area in the rural agricultural hub of San Benito County. Having two grown children who survived their teenage years, and being the youngest of 5 sisters, AmyJune is either very lucky to have made it this far in life or is very talented at talking herself out of deadly situations.
Outside of her mission in the open source community space, she has a deep love for mycology, geocaching, and air-cooled Volkswagens.
| Follow volkswagenchick | Connect volkswagenchick User Attributes Team Open Source Evangelist Author Contributor Club Register or Login to post a comment.