-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Request/Question: Linux service #144
Comments
maybe try to set the variables in a small shell script like then its easy to add other variables if necessary |
That's the weirder part, $HOME is already defined prior to attempting to run the service, it's just not capturing it. So I'm not sure where it's looking. I've pulled through the source code for opengist, but I can't seem to find a reason. Think it has something to do with Go in particular. And I've tried running systemctl without sudo to ensure it uses the correct user home dir. However, if I edit the service and use one of the two options Option 1
Option 2
It then works fine.
Or attempting to run as
But I've seen very few users utilize that method. |
Well, unless the developer has some other method, I created an postinst script for a deb package. Everything runs out of box after the .deb is installed and the service works. Only downside is obviously since it needs a home directory path, the service needs to be executed via a user instead of system. Once the deb is installed, opengist service starts right away, but to stop / check status, they'll have to utilize
But it works And with minimal effort from the user. And then there's the dumbed down way with the installed desktop shortcut |
Just an addition in case anyone finds this ticket. I feel dumb. The developer also provided quick instructions via the docs. Would have been easier to find, but luckily I pretty much set the systemd service up exactly like this minus the ease of having the doc to reference. I went back today to find a few vars and noticed the systemd file. |
The |
Can you confirm if this is a Go standard error? Or specific to Opengist? I looked through the Opengist code and I couldn't find any matching strings. And what are the repercussions of this $home not being defined? I ended up going with the same method you utilized in your doc to create an opengist user and setting the home to When I start the opengist.service, it seems to create the DB in the correct directory. Only after I went through the pain of testing all this did I find the docs you provided even though I swear I originally looked a first time, it was just buried. I ended up even picking the same paths that you did. I also went through this morning and created the arm64 package and tested that out and it seems to work out of box with the correct directories and users since the debian |
This is indeed a stdlib error coming from There are a few solutions, one could be to fall back to The error happens above the config parsing at opengist/internal/config/config.go Line 55 in aec7ee2
Depending on how "severe" of an error you consider it to be ("it" being having no HOME env var), you could forego this part opengist/internal/config/config.go Line 62 in aec7ee2
homeDir is empty, then further down in checks you could validate and ensure that there is a value.
|
Would creating a flag for Opengist be the easiest way? It's more of a "are you up for adding this" question. Because creating a .deb every time you release a new version isn't a big deal, but having a script which starts auto injecting changes and then building on the user's end may start getting a tad bit complicated. |
I have numerous users who utilize my own repository, one asked for an easier way to install opengist (personally, it's easy enough, but you know, there's always one).
I looked through the docs and came across the mentioning of defining the home directory by prefixing
However, I attempted to do that via a service by utilizing
Which doesn't seem to get recognized, as I get the following error below:
Am I using the wrong syntax for this?
I was able to package up Opengist and implement a opengist.desktop, but the user has to right click and select "Allow Launch", but I can promise there's going to be someone out there completely oblivious to that fact.
And it's actually puzzling, because even if I manually add a path to
/etc/opengist/config.yml
:It still seems to throw the error. So I'm not sure what my options are. Would just be a benefit.
Right now with the .deb, the opengist bin gets installed to
/usr/bin/opengist
so all they have to do is just edit the config and away they go, but being able to attach it to a service would be a bonus.Also, if you ever plan to create a .deb for whatever reason, I added the licensing, all your contributors and made a man page for it, so you're welcome to it. Man pages are a pain.
It's all in
/usr/share/man
and/usr/share/doc
The text was updated successfully, but these errors were encountered: