System Control

From 6bit.ch wiki
Revision as of 15:10, 9 October 2024 by Xbl (talk | contribs) (→‎Use)
Jump to navigation Jump to search

systemd

Systemd is a suite of basic building blocks for a Linux system. It provides a system and service manager that runs as PID 1 and starts the rest of the system.

Use

systemctl status <unit> show status
systemctl start <unit> start $unit
systemctl stop <unit> stop $unit

systemctl is-enabled <unit> show if $unit is en- or disabled
systemctl enable <unit> enable autostart
systemctl enable --now <unit> enable autostart and stop $unit
systemctl disable <unit> disable autostart
systemctl disable --now <unit> disable autostart and stop $unit

systemctl list-unit-files show all units and their state
systemctl list-unit-files --state=enabled show all enabled units
systemctl list-unit-files --state=disabled show all disabled units

systemctl edit --full <unit> edit settings for $unit

systemctl daemon-reload check units for changes

Useful Flags

--user make changes in the user context
--no-pager don't pipe output into a pager

sysctl

Reads/sets kernel settings from the virtual /proc file system.
Values can be edited directly with echo 1/0 >> /proc/net/ipv6/conf/all/disable_ipv6 (fleeting) or by editing /etc/sysctl.conf or /etc/sysctl.d/parameter (persistent).

Settings

sysctl -a list all settings
sysctl -a | grep net.ipv6.conf.all.disable_ipv6 list specific setting
sysctl net.ipv6.conf.all.disable_ipv6 list specific setting
sysctl -w parameter=value change $parameter to $value (fleeting)
sysctl -p reload settings