Difference between revisions of "System Control"
| (One intermediate revision by the same user not shown) | |||
| 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> | ||
| Line 36: | Line 38: | ||
<code>sysctl -w parameter=value</code> change $parameter to $value (fleeting)</br> | <code>sysctl -w parameter=value</code> change $parameter to $value (fleeting)</br> | ||
<code>sysctl -p</code> reload settings</br> | <code>sysctl -p</code> reload settings</br> | ||
== Disable IPv6 on Debian == | |||
<pre>echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf | |||
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf | |||
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf | |||
sysctl -p</pre> | |||
Latest revision as of 16:14, 15 September 2025
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
Disable IPv6 on Debian
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf sysctl -p