« Back to Settings for systemd units

RestrictRealtime setting

The property RestrictRealtime is a systemd unit setting used for sandboxing. It is available since systemd 231.

Purpose: limit the ability to use realtime scheduling

Why and when to use RestrictRealtime

The setting RestrictRealtime aims to restrict the usage of realtime scheduling by a service.

When using this option enabled, a service won’t be able to use realtime scheduling policies, such as:

  • SCHED_FIFO
  • SCHED_RR
  • SCHED_DEADLINE
  • SCHED_OTHER / SCHED_NORMAL

Generic advice

This option can be applied to most services. Typically only a small amount of services that require priority scheduling should not be restricted.

To find out if any scheduling policy is used, considering looking in the code of the program or use the strings command.

Values

Systemd unit setting RestrictRealtime expects a boolean (yes/no or true/false).

Values for systemd unit setting RestrictRealtime
ValueIntended actionAvailable since
systemd version
nodo not restrict a service - default
yesprevent service from using realtime scheduling

Example to show the current value of RestrictRealtime for the ssh service:

systemctl show --property=RestrictRealtime ssh.service

Related hardening profiles

The systemd unit setting RestrictRealtime is used in the following hardening profiles.

Frequently Asked Questions

How to use systemctl edit?

Run systemctl with the 'edit' subcommand and service.

systemctl edit UNIT.service

See full answer at How to use systemctl edit to change a service?

Related articles

Like to learn more? Here is a list of articles within the same category or having similar tags.

Feedback

Small picture of Michael Boelen

This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

Mastodon icon