initial commit

This commit is contained in:
Malin Freeborn
2020-01-02 01:04:35 +01:00
commit 6befc5d3c1
162 changed files with 19086 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
> systemctl list-units
> sudo systemctl status mpd
> sudo systemctl daemon-reload
> sudo systemctl taskd.service start
> sudo systemctl status taskd.service

View File

@@ -0,0 +1,8 @@
Find errors since November
> journalctl --since=2018-11-01 --grep="EXT4-fs error"
Limit size to 2G.
> journalctl --vacuum-size=2G

View File

@@ -0,0 +1,34 @@
# Basics
A service can consist of two files - the .sh script to run, and the .service file which describes its run conditions.
The .service file goes in /etc/systemd/system. The scripts themselves might be best placed in $HOME/.local/bin.
# Example - tracker.service
```
[Unit]
Description=Tracker
[Service]
Type=simple
ExecStart=/path/to/script
[Install]
WantedBy=multi-user.target
```
After making the new service, systemd requires reloading:
> sudo systemctl daemon-reload
# Types
* simple - the service cannot be called on by others. It runs on repeat.
* oneshot - the service executes once, then stops.

View File

@@ -0,0 +1,23 @@
[Unit]
Description=Test
[Service]
ExecStart=/home/ghost/.local/bin/test
Restart=always
Type=simple
User=ghost
Group=ghost
[Install]
WantedBy=multi-user.target
Alias=test.service

23
system/systemd/users.md Normal file
View File

@@ -0,0 +1,23 @@
# Automatic Login
> cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty1@.service
Modify the lines to look like these:
`ExecStart=-/sbin/agetty --autologin <username> --noclear %I 38400 linux`
`Type=oneshot`
`Restart=no`
In the `[Install]` section:
`Alias=getty.target.wants/getty@tty1.service`
Then enable the service:
> ln -sf /etc/systemd/system/getty1@.service /etc/systemd/system/getty.target.wants/getty@tty9.service
> systemctl start getty@tty9.service