Clarify systemd integartion with logging -- running via systemd is discouraged

Hugo Barrera 2020-06-09 14:05:09 +00:00
parent 5b549f4572
commit e23ef47dd0

@ -19,7 +19,7 @@ After=graphical-session-pre.target
In order for the unit file to work properly, add the following lines to either `/etc/sway/config.d/10-systemd` which will include it in the default config, or add them to the end of the user's config file:
```
```bash
exec "systemctl --user import-environment; systemctl --user start sway-session.target"
```
@ -32,8 +32,18 @@ To walkthrough the stages of how this works:
- When sway is run, it will import the environment variables into the systemd user manager and start the sway session target.
- The systemd user manager will then start all the services that depend on that target, and will provide them access to the imported env variables.
## Sway logging and journalctl
If you'd like sway's output to be handled by journald (like a systemd service), you can used `systemd-cat` for this:
```bash
exec systemd-cat --identifier=sway sway
```
## Running sway itself as a --user service
It is not recommended that you run `sway` as a systemd service.
See #5160 for finer details on some discussion around this.
Place the following unit file either at `~/.config/systemd/user/sway.service` or `/etc/systemd/user/sway.service`:
```