Skip to content

It doesn't open file if I run my script from systemctl #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vsile opened this issue May 31, 2018 · 1 comment
Open

It doesn't open file if I run my script from systemctl #14

vsile opened this issue May 31, 2018 · 1 comment

Comments

@vsile
Copy link

vsile commented May 31, 2018

I use next service file;

[Unit]
Description=Goserver

[Service]
Type=simple
Restart=always
RestartSec=3

Environment=GOPATH=/home/user/goserver/
Environment=BROWSER=gvfs-open
WorkingDirectory=/home/user
ExecStart=/usr/bin/go run /home/user/goserver/totalmanager.go

[Install]
WantedBy=multi-user.target

The script with open-golang is inside totalmanager.go

If I run my script "go run goserver/totalmanager.go" it works!

But if I use "sudo systemctl start totalmanager.service" it doesn't work!
May be something wrong with Environment?

@xiegeo
Copy link

xiegeo commented May 31, 2018

I have not tried this myself, but try:

[Service]
User=user

to start the service as your user, so it knows who to open the link for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants