diff --git a/8.html b/8.html index 195f902..c86314b 100644 --- a/8.html +++ b/8.html @@ -120,6 +120,7 @@
Das initramfs ist ein komprimiertes Archiv, das für den Systemstart benötigte Dateien enthält. +
systemd ist organisiert mit
systemctl status
systemctl --failed
systemctl list-unit-files
systemctl
systemctl start DIENST
systemctl restart DIENST
systemctl status DIENST
systemctl get-default
systemctl list-units --type target
systemctl enable DIENST
systemctl enable --now DIENST
[Unit]
-Description=OpenBSD Secure Shell server
-After=network.target auditd.service
-ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
-
-[Service]
-EnvironmentFile=-/etc/default/ssh
-ExecStartPre=/usr/sbin/sshd -t
-ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
-ExecReload=/usr/sbin/sshd -t
-ExecReload=/bin/kill -HUP $MAINPID
-KillMode=process
-Restart=on-failure
-RestartPreventExitStatus=255
-Type=notify
-RuntimeDirectory=sshd
-RuntimeDirectoryMode=0755
-
-[Install]
-WantedBy=multi-user.target
-Alias=sshd.service
-
- /etc/systemd/system/simple-webserver.service
- [Unit]
-Description=Simple Web Server
-
-[Service]
-Type=simple
-ExecStart=/home/USERNAME-HIER-EINSETZEN/hello-web.sh
-
-[Install]
-WantedBy=multi-user.target
-
-
- ~/hello-web.sh
- #!/bin/bash
-cd /home/
-python3 -m http.server 8082
- systemctl start simple-webserver.service
- systemctl status simple-webserver.service
- Wenn das gescheitert sein sollte:
- journalctl -xe
- journalctl --unit=simple-webserver.service
- http://localhost:8082/BENUTZERNAME
systemctl edit unit
/etc/systemd/system/unit.d/override.conf
systemctl revert unit
systemctl
systemctl start DIENST
systemctl restart DIENST
systemctl status DIENST
systemctl enable DIENST
systemctl enable --now DIENST
systemctl disable DIENST
/lib/systemd/system/ssh.service
+ [Unit]
+Description=OpenBSD Secure Shell server
+After=network.target auditd.service
+ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
+
+[Service]
+EnvironmentFile=-/etc/default/ssh
+ExecStartPre=/usr/sbin/sshd -t
+ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
+ExecReload=/usr/sbin/sshd -t
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=on-failure
+RestartPreventExitStatus=255
+Type=notify
+RuntimeDirectory=sshd
+RuntimeDirectoryMode=0755
+
+[Install]
+WantedBy=multi-user.target
+Alias=sshd.service
+
+ + https://wiki.archlinux.org/index.php/Systemd#Writing_unit_files +
/etc/systemd/system/simple-webserver.service
+ [Unit]
+Description=Simple Web Server
+
+[Service]
+Type=simple
+ExecStart=/home/USERNAME-HIER-EINSETZEN/hello-web.sh
+
+[Install]
+WantedBy=multi-user.target
+
+
+ ~/hello-web.sh
+ #!/bin/bash
+cd /home/
+python3 -m http.server 8082
+ systemctl start simple-webserver.service
+ systemctl status simple-webserver.service
+ Wenn das gescheitert sein sollte:
+ journalctl -xe
+ journalctl --unit=simple-webserver.service
+ http://localhost:8082/BENUTZERNAME
systemctl edit unit
/etc/systemd/system/unit.d/override.conf
systemctl daemon-reload
systemctl revert unit
systemctl list-timers --all
+ toller-dienst.service
toller-dienst.timer
/etc/systemd/system/backup.timer
+
+[Unit]
+Description=Run backup.sh weekly
+
+[Timer]
+OnCalendar=weekly
+Persistent=true
+
+[Install]
+WantedBy=timers.target
+
+ Das initramfs ist ein komprimiertes Archiv, das für den Systemstart benötigte Dateien enthält.
+ /etc/systemd/system/backup.service
+
+[Unit]
+Description=Backup 2000
+
+[Service]
+Type=simple
+ExecStart=/home/USERNAME-HIER-EINSETZEN/bin/backup.sh
+
+[Install]
+WantedBy=multi-user.target
+
~/bin/backup.sh
+ #!/bin/bash
+tar -czf "/home/USERNAME/archiv/backup-`date +%d-%m-%Y`.tar.gz" /home/USERNAME/arbeit/
+
+ journalctl
+ journalctl -xe
+ journalctl --unit=backup.service
+
+ https://wiki.ubuntuusers.de/Systemzeit/ + +
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-targets +