Archiv der Kategorie: IT

IT Stuff

systemd services

Enabling and disabling systemd services

Publication Date: 18 Jan 2024 on https://documentation.suse.com/smart/systems-management/html/reference-systemctl-enable-disable-services/index.html

1 Environment

 

This document applies to the following products and product versions:

  • SUSE Linux Enterprise Server 15 SP5, 15 SP4, 15 SP3, 15 SP2, 12 SP5
  • SUSE Linux Enterprise Server for SAP Applications 15 SP5, 15 SP4, 15 SP3, 15 SP2, 12 SP5
  • SUSE Linux Enterprise High Availability 15 SP5, 15 SP4, 15 SP3, 15 SP2, 12 SP5
  • SUSE Linux Enterprise High Performance Computing 15 SP5, 15 SP4, 15 SP3, 15 SP2
  • SUSE Linux Enterprise Desktop 15 SP5
  • SUSE Linux Enterprise Real Time 15 SP5

2 Enabling and disabling services with systemctl

 

systemctl is the systemd command for controlling how services start on a Linux system. A service can be enabled, disabled, or masked, and it can be configured to start at boot, on demand, manually, or prevented from starting under any circumstances.

Enabling a service means it will start at boot. Disabling a service means it will not start at boot, but can be started manually, or as a dependency of another service. Enabling or disabling a running service does not automatically change its current state; if it is running, it will continue to run, and if it is not running, it will not start. When you enable or disable a service, you have the option to stop or start the service with a separate command, or to enable/disable and start/stop with a single command.

A masked service cannot be started by any means, and must be unmasked to be usable.

3 systemctl commands to enable, disable, and mask services

 systemctl is-enabled SERVICE-NAME

Check if a service is enabled or disabled. systemctl status SERVICE-NAME

Check if a service is running, stopped, enabled, or masked, and display the most recent log entries. systemctl enable SERVICE-NAME

Enable a service, without starting it. It will start automatically at the next system restart, or it can be started manually, or as a dependency of another service. systemctl enable --now SERVICE-NAME

Enable a service and start it immediately. systemctl disable SERVICE-NAME

Disable a service. If it is running, it will continue to run until it is stopped manually. It will not start at the next system restart, but can be started manually, or as a dependency of another service. systemctl disable --now SERVICE-NAME

Disable a service and stop it immediately. systemctl re-enable SERVICE-NAME

Stop and restart a service, and restore its default start behavior. systemctl mask SERVICE-NAME

Mask the service so that it cannot be started by any means. It must be stopped manually, or it will continue to run, possibly in an inconsistent state. The mask command does not take the --now option. systemctl unmask SERVICE-NAME

Unmask the service. It will start after a system restart, or start it manually. The unmask command does not take the --now option.

Git Cheat Sheet

Mein Git Cheat Sheet

 

Befehle für und Parameter Git die ich mir nie so richtig merken kann

  • rebase
  • amend
  • Alle remote branches zum lokalen Repository transferieren
    hierfür brauchen wir ein kleines Script.

    for remote in `git branch -r`; do
    git branch --track ${remote#origin/} $remote;
    done

Docker Cheat Sheet

Mein Docker Cheat Sheet

Befehle und Parameter für Docker die ich häufiger brauche und mir nie ganz richtig merken kann

Alle container die nicht mehr laufen entfernen
docker rm $(docker ps -aq)

Alle images entfernen
docker rmi $(docker images -q)

To only stop exited containers and delete only non-tagged images
docker ps --filter 'status=Exited' -a | xargs docker stop docker images --filter "dangling=true" -q | xargs docker rmi

Container starten
docker run -name XXX imagename command

shell innerhalb des containers ausführen
docker exec -ti XXX bash

kostenlos Windows 10

Ein Trick:
Bei Heise Online gibt es einen Artikel zum Thema
http://www.heise.de/newsticker/meldung/Und-noch-ein-Trick-weiterhin-kostenlos-an-Windows-10-zu-kommen-3288425.html?wt_mc=rss.ho.beitrag.atom

PDF Dateien zusammenfügen

Die einfache Variante

pdfunite in-1.pdf in-2.pdf in-n.pdf out.pdf

mit Ghostscript:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pd
gs         starts the Ghostscript program.
-dBATCH    once Ghostscript processes the PDF files, it should exit.
           If you don't include this option, Ghostscript will just keep running.
-dNOPAUSE  forces Ghostscript to process each page without pausing for user interaction.
-q         stops Ghostscript from displaying messages while it works
-sDEVICE=pdfwrite 
           tells Ghostscript to use its built-in PDF writer to process the files.
-sOutputFile=finished.pdf
           tells Ghostscript to save the combined PDF file with the specified name.

Mein neuer Favorit

pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf