• 0 Posts
  • 3 Comments
Joined 3Y ago
cake
Cake day: Sep 14, 2021

help-circle
rss

You can set your service to start after the graphical session starts by adding this line to the [unit] section:

After=graphical-session.target

You can also add a require with same target.

If you still need a value for an environment variable, you can set it with “Environment=”.

Also as others said, you don’t nedd sudo. Systems should manage all of that. Starting, stopping, reload, environment, dependencies and user context.



In stead of a script try the command directly in execstart. Systems should take care of keeping the process running without you having to do nohop and disown.

If you insist on using a script you should use a full path to sh or bash with the path to your script as an argument like ExecStart=/use/bin/bash /path/to/sctioy.sh.