run0 cheat sheet
Many Linux distributions are using systemd as its service manager. In release 256 the new tool run0 was introduced. In this cheat sheet commands are collected to quickly use the capabilities of run0.
Never used run0 before? Have a look at run0 introduction and usage.
Missing something? Let it know!
Commonly used options
Option | Action |
---|---|
--background=[COLOR] | Set background color, or disable when set empty value |
--chdir=PATH | Set current working directory to PATH |
--description="TEXT" | Give the transient unit a custom description |
--nice=VALUE | Define nice level (19 to -20) |
--property=NAME=VALUE | Set property (e.g. sandboxing/resource limitation) |
--setenv=ENV=VALUE | Declare an environment variable ENV with value VALUE |
--unit=NAME | Define a name of our transient unit instead of random one |
Basic usage
To elevate permissions without running a specific command, run run0 without any parameters.
run0
Set unit name and description
run0 --unit=mynewunit --description="This is a new unit" systemctl status mynewunit.service
Background color
Use a blue background instead of red.
run0 --background="44" ps -ef
Disable color:
run0 --background= ps -ef
Nice level
run --nice=19 my-task-with-low-priority
Environment variable
run --setenv=SECRET=true bash -c 'export'
Set a property
Define a property to apply sandboxing or restrict system resources.
run0 --property=ProtectSystem=strict bash -c 'echo test > /var/log/this-will-fail'