Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
linux_commands [2020/04/09 14:33] – created misaka00251 | linux_commands [2020/04/18 17:48] – Add systemd misaka00251 | ||
---|---|---|---|
Line 11: | Line 11: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | |||
+ | ===== Systemd ===== | ||
+ | |||
+ | A sample service file: | ||
+ | |||
+ | <code - gitea.service> | ||
+ | [Unit] | ||
+ | Description=Gitea (Git with a cup of tea) | ||
+ | After=syslog.target | ||
+ | After=network.target | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | [Service] | ||
+ | # | ||
+ | # | ||
+ | RestartSec=2s | ||
+ | Type=simple | ||
+ | User=git | ||
+ | Group=git | ||
+ | WorkingDirectory=/ | ||
+ | ExecStart=/ | ||
+ | Restart=always | ||
+ | # | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | So, the right way to implement '' | ||
+ | |||
+ | In normal installations this will create a directory ''/ | ||
+ | |||
+ | For instance, in a file / | ||
+ | |||
+ | < | ||
+ | [Service] | ||
+ | Environment=" | ||
+ | Environment=" | ||
+ | Environment=" | ||
+ | </ | ||
+ | |||
+ | Also note that if the directory exists and is empty, your service will be disabled! If you don't intend to put something in the directory, ensure that it does not exist. | ||
+ | |||
+ | [[https:// |