Process Life Cycle

A short while back, I had to do a revision about process life cycle in the operating system, Linux specifically. Last time that I had to learn about this topic was back in the good old days in college. I don’t know when I need to review it again, so I think it’s a good idea to dump what I’ve learned including the references to this topic. Also, I will only focus mainly on the 5-state model. ...

August 3, 2024 · 2 min · 372 words · kenno

Snapshot of LVM logical volume - a brief howto

Recently, after an OS updated and rebooted, I was not able to login to the desktop environment. When that happened, I thought to myself, “I wish I could just do a quick EBS snapshot like I would on the cloud before running any OS updates.” On my Linux desktop, the root volume is an LVM volume, I knew that snapshot was possible, but never tried to create one before. A friend at work encouraged that I should make use of it, and it was not that hard to get started. Well, let’s see how it goes as I’m about to explore how LVM snapshot works on my desktop. ...

July 26, 2024 · 3 min · 491 words · kenno

Systemctl cat is cool

Sometimes we want to see the content of a Systemd unit file. One obvious way to do it is to just cat/vim the content of the unit file directly. For example, to display the content of systemd-tmpfiles-clean.timer, we can perform the following step: ➜ systemctl status systemd-tmpfiles-clean.timer | grep Loaded Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static) ➜ cat /usr/lib/systemd/system/systemd-tmpfiles-clean.timer; # SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Daily Cleanup of Temporary Directories Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) ConditionPathExists=!/etc/initrd-release [Timer] OnBootSec=15min OnUnitActiveSec=1d But, can we do better than manually looking up the unit file and read it? Sure, can! ...

July 20, 2024 · 2 min · 306 words · kenno

SELinux revision note

Today, I decided to have a quick revision on SELinux as it’s been a long while that I worked on any projects that required my attention to fiddling with SELinux. While I was looking for an sealert in /var/log/messages on my Fedora based desktop, I found a real issue that I need to fix. Like most of my blog posts, I’d like to start writing the post while I was about to solve the issue. ...

July 20, 2024 · 3 min · 510 words · kenno

How to test UDP port connectivity

Earlier today, I have a need to check for a UDP opening port on a remote Linux server. And I felt blank in my brain, like I never done this before. Then I remember with TCP, I could use nc command to check it. Something like: ➜ nc -vz opnsense 22 Ncat: Version 7.92 ( https://nmap.org/ncat ) Ncat: Connection to 2400:a888:333:0:222:ffff:fe54:67de failed: TIMEOUT. Ncat: Trying next address... Ncat: Connection to 192.168.1.1 failed: TIMEOUT. Ncat: Trying next address... Ncat: TIMEOUT. The above output indicates that there is a failed connection between my computer to the remote host ‘opnsense’ on port 22. ...

July 17, 2024 · 3 min · 495 words · kenno