Difference between revisions of "System Control"

From 6bit.ch wiki
Jump to navigation Jump to search
Line 17: Line 17:
<code>systemctl list-unit-files --state=enabled</code> show all enabled units</br>
<code>systemctl list-unit-files --state=enabled</code> show all enabled units</br>
<code>systemctl list-unit-files --state=disabled</code> show all disabled units</br>
<code>systemctl list-unit-files --state=disabled</code> show all disabled units</br>
</br>
<code>systemctl edit --full <unit></code> edit settings for $unit</br>
</br>
</br>
<code>systemctl daemon-reload</code> check units for changes</br>
<code>systemctl daemon-reload</code> check units for changes</br>

Revision as of 15:10, 9 October 2024

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