0% found this document useful (0 votes)
2 views2 pages

Sytemd Commands

The document outlines various commands and procedures for managing system services using systemd and init scripts. It includes commands for checking the status of services, enabling or disabling them, and switching between different targets. Additionally, it describes how to set default targets and modify boot-time target selections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Sytemd Commands

The document outlines various commands and procedures for managing system services using systemd and init scripts. It includes commands for checking the status of services, enabling or disabling them, and switching between different targets. Additionally, it describes how to set default targets and modify boot-time target selections.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

init script

ls /etc/init.d/network
unit files
ls /etc/systemd/system/multi-user.target.wants/sshd.service

#control
systemctl status crond
#active enabled

systemctl disable crond

systemctl status crond

restart
---------------------------
systemctl start crond
systemctl enable crond
---------------------
systemctl is-enabled crond
systemctl is-active crond

systemctl poweroff
systemctl reboot
--------
systemctl mask crond #doesnot startany way
systemctl start crond

systemctl unmask crond


systemctl start crond
---------------------------------
init commands
service crond status
chkconfig crond on

--------------------------------------
systemctl get-default

systemctl set-default multi-user.target

reboot

----------------------------
systemctl isolate graphical.target

------------------------------------
configuration files
ls /etc/systemd
ls /etc/systemd/system
--------------------------
system list units

systemctl list-units --type=service --all

systemctl list-dependencies sshd.service

Selecting a Target at Runtime


On a running system, administrators can switch to a different target using the
systemctl isolate command.
[root@host ~]# systemctl isolate multi-user.target

Setting a Default Target


[root@host ~]# systemctl get-default
multi-user.target
[root@host ~]# systemctl set-default graphical.target

Selecting a Different Target at Boot Time


To select a different target at boot time, append the systemd.unit=target.target
option to
the kernel command line from the boot loader

systemd.unit=rescue.target

You might also like