U bekijkt momenteel de Netherlands versie van de site.
Wilt u overschakelen naar uw lokale site?
14 MIN LEESTIJD
RUST

Controlling processes and using Unix signals

Join Mihalis Tsoukalos as he demonstrates how to use Rust to work and manage child processes, and handle Unix signals.

OUR EXPERT

Mihalis Tsoukalos is a systems engineer and a technical writer. You can find him at @mactsouk.

QUICK TIP

QUICK TIP

ABOUT UNIX SIGNALS

QUICK TIP

TYPES OF LINUX PROCESSES

OUR EXPERT

QUICK TIP

Get the code for this tutorial from the Linux Format archive: www.linuxformat.com/archives?issue=291.

You can learn more about Rust at www.rust-lang.org.

Get the code for this tutorial from the Linux Format archive: www.linuxformat.com/archives?issue=291.

Having an expect() or unwrap() part on the Rust statements that you execute is considered good practice, so do not forget to add one of them in your statements. Always be prepared for the unexpected!

UNIX Signals are software interrupts that offer a method of handling asynchronous events on a UNIX system. Every application, apart from the trivial ones, must be able to deal with signals. Each signal can be identified either by its name or a numeric value; the former approach is easier to remember and therefore is the recommended way. To send a signal to a running application, you should have the right privileges or just be root. The most critical use of signals is for avoiding blocking situations. Blocking can happen when waiting for user input, reading a file or reading from a device.

If you put an underscore at the beginning of a variable name, the Rust compiler isn’t going to complain if that variable isn’t being used. Put simply, it tells the Rust compiler that this is intentional.

A process is an execution environment that contains instructions, user data and system data parts, and other types of resources that are obtained during runtime. On the other hand, a program is a binary file that contains instructions and data that are used for initialising the instruction and user data parts of a process. Put simply, a process is a program that runs. Each running UNIX process is uniquely identified by an unsigned integer, which is called the process ID of the process.

Mihalis Tsoukalos is a systems engineer and a technical writer. You can find him at @mactsouk.

Ontgrendel dit artikel en nog veel meer met
Je kunt genieten:
Geniet volledig van deze editie
Direct toegang tot 600+ titels
Duizenden oude edities
Geen contract of verplichting
ABONNEER NU
30 dagen proberen, dan gewoon €11,99 / maand. Op elk moment opzeggen. Alleen nieuwe abonnees.


Meer informatie
Pocketmags Plus
Pocketmags Plus

Dit artikel komt uit...


View Issues
Linux Format
August 2022
IN DE WINKEL BEKIJKEN

Andere artikelen in dit nummer


WELCOME
First step…
It seems that Tux can safely visit Hell,
REGULARS AT A GLANCE
Ubuntu Snaps under fire
The release of Ubuntu 22.04 has prompted more people to complain about the usefulness of Snaps.
Framework Laptop receives 12th gen processor upgrade
Popular modular laptops with Linux support now available with 12th gen Intel processors.
Turkish district reaps Linux rewards
Local government saves $1m by going open source.
DECISIONS, DECISIONS
Matt Yonkovit is the head of open source
BE A GIT
Keith Edmunds is MD of Tiger Computing Ltd,
Convergence lives on with Gnome Shell
The dream of a Linux desktop for mobile devices isn’t dead in the water.
Mesa 22.1 brings better ray tracing
Open-source graphics driver stack receives a big update.
Thunderbird donations increase
Revenue of the email client rose by 21 per cent in 2021.
Distro watch
What’s down the side of the free software sofa?
SPOTLIGHT ON MESON
Xavier Claessens is a senior software engineer at
MULTIMESS
Jon Masters is a kernel hacker who’s been
Kernel Watch
Jon Masters summarises the latest happenings in the Linux kernel, so that you don’t have to.
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com
Mailserver
WRITE TO US Do you have a burning
Kooha
Version: 2.0.1 Web: https://github.com/seadve/kooha
AppImage Pool
Version: 5.0.0 Web: https://github.com/prateekmedia/appimagepool
Blanket
Version: 0.6.0 Web: https://github .com/rafaelmardojai/blanket
Universal Media Server
Version: 10.21.0.1 Web: www.universalmediaserver.com
Beaker Browser
Version: 1.1.0 Web: https://beakerbrowser.com
superProductivity
Version: 7.11.5 Web: https://super-productivity.com
Safe Eyes
Version: 2.1.3 Web: https://slgobinath . github.io/SafeEyes
Mudlet
Version: 4.16.0 Web: www.mudlet.org
StackAndConquer
Version: 0.10.0 Web: https://github.com/ElTh0r0/stackandconquer
Bottles
Version: 2022.5.14-trento-3 Web: https://usebottles.com
Filmulator
Version: 0.11.1 Web: https://filmulator.org
REVIEWS
GoDaddy
Purchase and bid on domains with the daddy of services and Stefan Ionescu.
OpenSUSE 15.4
If someone were to compile the definitive list of the mysteries of life, Mayank Sharma would ask them to include openSUSE at number 42.
Tails 5.1
This distro is one of those things that Mayank Sharma would rather have and not need, than need and not have.
OpenMediaVault 6
Old wine in a new bottle is such a cliché, but that’s exactly how Mayank Sharma likes his software to grow and evolve.
OnlyOffice 7.1
Usually Mayank Sharma will run everything that’ll fit inside a browser, but today he’ll try something he’s petrified to launch even as a native program.
The Stanley Parable: Ultra Deluxe
Management doesn’t like self-referential things. It just reminds them they’re a simple strapline-based comedy construct of Christopher Livingston.
ROUNDUP
Raspberry Pi distros
The top-end Raspberry Pis can be used to build a formidable desktop. Michael Reed finds there’s a fair bit of choice when it comes to Linux distros
Fast virtual machines
Fast Virtual Machines
Jonni Bidwell transcends meat space, ventures virtuously into the valleys of the virtual and returns laden with actual knowledge.
Pi USER
Turing 2 Pi raises $1 million in a day
The Pi-based cluster computing Kickstarter project smashes its own targets for full funding.
Waveshare CM4-NANO
Les Pounder looks at Waveshare’s Compute Module 4 carrier board that offers Raspberry Pi 4 performance in a near Zero-sized package.
Create a custom LCD menu system
Les Pounder loves to get hands-on with a good button, and if doing so can save him time and looks great, then it’s a win-win situation!
Replacing rc.local and using Systemd
Sean Conway is struggling with change – specifically, what system administration knowledge to keep and what to throw away.
IN DEPTH
World Web 3
Battle lines are being drawn up as technologies for a Web 3.0 are primed and loaded, Mats Tage Axelsson helps you prepare for a user-owned world.
IN DEPTHTUTORIALS
Multi-boot USB drives
Shashank Sharma can’t parallel park, but he knows how to just copy and paste live distributions into a USB drive to boot ‘em up.
TUTORIALS
How to take better screengrabs in Ubuntu
Nick Peers reveals how easy it is to take screengrabs and annotate them using a combination of Ubuntu’s built-in tools and third-party utilities.
Emulate the first portable computer
Rounding off our emulation series, Mike Bedfords revives the first portable computer that ran the bizarre APL language.
Make beautiful algorithmic music
Create royalty-free music automatically, or try your hand at producing music by coding. Mike Bedford explores both composition options…
Back up and copy entire hard drives
Michael Reed shows you how to tame Clonezilla, a powerful piece of software that can help copy and restore hard disk partitions.
Keep your passwords secret and safe
David Rutland has learned from past mistakes, and endeavours to keep all of his logins, usernames and passwords firmly under lock and key.
Configure a crossplatform KVM system
Use Barrier to replace a physical KVM switch and enable a keyboard and mouse to be shared between multiple devices. Matt Holder explains all.
SEEING THE LIGHT
Three humble developers of Bodhi Linux enlighten Jonni Bidwell on the ways of Zen and the art of distro maintenance.
CODING ACADEMY
Updating the LXF GIT monitoring tool
John Schwartzman adds new features to an existing PyQt5 program that finds all of your git repositories and displays their status.
Chat
X
Pocketmags ondersteuning