-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Add a systemd service file #1864
Comments
Sounds good to me! I'd also really appreciate it if you could update the docs with information on how to use this 🙏 |
I tried to do that for Arch Linux package and had issues with atuin server searching for configuration in hardcoded $HOME variable and wanted write access to it. Also it would be nice for DB_URI to support (passwordless) socket in linux - couldnt' figure out how to set this up in sqlx. For reference my work in progress files:
|
@inglor Wouldn't it be fine to give it ReadWrite access to its own home, then? It has its own user anyway. My question is though: What is actually stored there, given that all data should be put into the DB? |
I opened up drafts in both repos. Happy for reviews/tests/contributions. |
I think when the server starts if the
I mean sure, it should have ReadWrite access to Generally reading through the code it seems to me that it was not considered to be executed as a systemd daemon and all my attempts above feels a bit like hacks to make it work, but could be wrong :) |
As another data point, I'm currently running a server like this: # /etc/systemd/system/atuin.service
[Unit]
Description=Atuin shell history server
Requires=postgresql.service
After=postgresql.service
[Service]
User=atuin
WorkingDirectory=/srv/atuin
ExecStart=/usr/bin/atuin server start
Environment=ATUIN_CONFIG_DIR=. TZ=UTC RUST_LOG=atuin::api=info
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target # /etc/sysusers.d/atuin.conf
u atuin - "Atuin shell history server" /srv/atuin # /etc/tmpfiles.d/atuin.conf
d /srv/atuin 0770 atuin atuin # /srv/atuin/server.toml
host = "::"
port = 585
open_registration = false
db_uri = "postgres://?host=/run/postgresql&dbname=atuin&user=atuin" |
This comment was marked as outdated.
This comment was marked as outdated.
Neither of the above are quite true. If you look at what @heftig has shared, the docs, or the code, you'll see This can be set to something other than $HOME, to solve exactly the problems you raise. The only time it writes to that directory is to set the default config file. I guess we could have an option to disable this, though it won't do it if the file already exists. |
Ah, I missed that, even though I read the docs. I hid my previous comment, since it doesn't add any useful info. Thanks for letting me know about the I'll update the guide on the forum accodingly, or better yet a note. It does not matter whether |
I changed my PRs according to the suggestions in this thread and I think they should now be good to go. I opted to remove the systemd env file and went with letting atuin create its own default config in |
Hey, I think it would make sense to have a systemd service file upstream. It should source environment variables from
/etc/default/atuin
.I think something like this could work:
If you like this, I could make an MR for this along with a sysusers file to create the
atuin
user.The text was updated successfully, but these errors were encountered: