Systemd vs SysVinit Cheatsheet

1
Systemd SysVinit Systemd SysVinit VS Service Related Commands Miscellaneous Commands Systemd New Commands Runlevels Comments Comments Comments Comments Systemd Systemd Systemd Systemd SysVinit SysVinit SysVinit Start a service Stop a service Restart a service Reload a service Service status Restart a service if already running Enable service at startup Disable service at startup Check if a service is enabled at startup Create a new service file or modify configuration Note : New version of systemd support “systemctl start dummy” format. System halt Power off the system Restart the system Suspend the system Hibernate Follow the system log file Execute a systemd command on remote host Check boot time Kill all processes related to a service Get logs for events for today Hostname and other host related information Date and time of system with timezone and other information System halt Single user mode Multi user Multi user with Network Experimental Multi user, with network, graphical mode Reboot Emergency Shell Change to multi user runlevel/target Set multi-user target on next boot Check current runlevel Change default runlevel service dummy start service dummy stop service dummy restart service dummy reload service dummy status service dummy condrestart chkconfig dummy on chkconfig dummy off chkconfig dummy chkconfig dummy --add halt poweroff reboot pm-suspend pm-hibernate tail -f /var/log/messages or tail -f /var/log/syslog systemctl dummy.service start -H user@host systemd-analyze or systemd-analyze time systemctl kill dummy journalctl --since=today hostnamectl timedatectl 0 1, s, single 2 3 4 5 6 emergency telinit 3 sed s/^id:.*:initdefault:/ id:3:initdefault:/ runlevel sed s/^id:.*:initdefault:/ id:3:initdefault:/ systemctl start dummy.service systemctl stop dummy.service systemctl restart dummy.service systemctl reload dummy.service systemctl status dummy.service systemctl condrestart dummy.service systemctl enable dummy.service systemctl disable dummy.service systemctl is-enabled dummy.service systemctl daemon-reload systemctl halt systemctl poweroff systemctl reboot systemctl suspend systemctl hibernate journalctl -f runlevel0.target, poweroff.target runlevel1.target, rescue.target runlevel2.target, multi-user.target runlevel3.target, multi-user.target runlevel4.target, multi-user.target runlevel5.target, graphical.target runlevel6.target, reboot.target emergency.target systemctl isolate multi-user.target (OR systemctl isolate runlevel3. target) ln -sf /lib/systemd/system/multi- user.target /etc/systemd/system/ default.target systemctl get-default systemctl set-default multi-user.target Systemd Commands: http://linoxide.com/linux-command/linux-systemd-commands/ Brought to you by LinOxide Team

description

linux cheat sheet

Transcript of Systemd vs SysVinit Cheatsheet

  • Systemd SysVinitSystemd SysVinitVSService Related Commands

    Miscellaneous Commands

    Systemd New Commands

    Runlevels

    Comments

    Comments

    Comments

    Comments

    Systemd

    Systemd

    Systemd

    Systemd

    SysVinit

    SysVinit

    SysVinit

    Start a serviceStop a serviceRestart a serviceReload a serviceService statusRestart a service if already runningEnable service at startupDisable service at startupCheck if a service is enabled at startupCreate a new service file or modify configuration

    Note : New version of systemd support systemctl start dummy format.

    System haltPower off the systemRestart the systemSuspend the systemHibernateFollow the system log file

    Execute a systemd command on remote hostCheck boot timeKill all processes related to a serviceGet logs for events for todayHostname and other host related informationDate and time of system with timezone and other information

    System haltSingle user modeMulti userMulti user with NetworkExperimentalMulti user, with network, graphical modeRebootEmergency ShellChange to multi user runlevel/target

    Set multi-user target on next boot

    Check current runlevelChange default runlevel

    service dummy startservice dummy stopservice dummy restartservice dummy reloadservice dummy statusservice dummy condrestartchkconfig dummy onchkconfig dummy offchkconfig dummychkconfig dummy --add

    haltpoweroffrebootpm-suspendpm-hibernatetail -f /var/log/messages or tail -f /var/log/syslog

    systemctl dummy.service start -H user@hostsystemd-analyze or systemd-analyze timesystemctl kill dummyjournalctl --since=todayhostnamectltimedatectl

    01, s, single23456emergencytelinit 3

    sed s/^id:.*:initdefault:/id:3:initdefault:/

    runlevelsed s/^id:.*:initdefault:/id:3:initdefault:/

    systemctl start dummy.servicesystemctl stop dummy.servicesystemctl restart dummy.servicesystemctl reload dummy.servicesystemctl status dummy.servicesystemctl condrestart dummy.servicesystemctl enable dummy.servicesystemctl disable dummy.servicesystemctl is-enabled dummy.servicesystemctl daemon-reload

    systemctl haltsystemctl poweroffsystemctl rebootsystemctl suspendsystemctl hibernatejournalctl -f

    runlevel0.target, poweroff.targetrunlevel1.target, rescue.targetrunlevel2.target, multi-user.targetrunlevel3.target, multi-user.targetrunlevel4.target, multi-user.targetrunlevel5.target, graphical.targetrunlevel6.target, reboot.targetemergency.targetsystemctl isolate multi-user.target (OR systemctl isolate runlevel3.target)ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.targetsystemctl get-defaultsystemctl set-default multi-user.target

    Systemd Commands: http://linoxide.com/linux-command/linux-systemd-commands/

    Brought to you by LinOxide Team