Update 'wiki/pages/user-units.md' #94

Closed
Ghost wants to merge 2 commits from (deleted):master into master
1 changed files with 7 additions and 2 deletions

View File

@ -24,12 +24,17 @@ you're creating)
Description=foo
[Service]
ExecStart=/bin/bash -c "while true do; echo hi; done"
ExecStart=/bin/bash -c "while true; do echo hi; sleep 1; done"
[Install]
WantedBy=default.target
1. enable it
1. set the `XDG_RUNTIME_DIR` and `DBUS_SESSION_BUS_ADDRESS` environment variables if [they were missing](https://unix.stackexchange.com/questions/245768/managing-another-users-systemd-units)
export XDG_RUNTIME_DIR="/run/user/$UID"
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
1. enable and start it
systemctl --user enable --now my-new-service.service