Skip to content
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

Setting sheldon config file is not enough #156

Closed
rossmacarthur opened this issue Oct 29, 2022 Discussed in #155 · 3 comments
Closed

Setting sheldon config file is not enough #156

rossmacarthur opened this issue Oct 29, 2022 Discussed in #155 · 3 comments
Labels
bug Something isn't working

Comments

@rossmacarthur
Copy link
Owner

Discussed in #155

Originally posted by seqizz October 28, 2022
Hi there 👋

I've upgraded to 0.7.0, and apart from a small change I needed to do in config.toml, sheldon failed to start because of non-existent config dir:

error: failed to acquire lock on config directory
  due to: failed to open `/home/gurkan/.config/sheldon`
  due to: No such file or directory (os error 2)

Just wanted to ask if this is intended, or it's because my setup is manual? Initially it didn't make sense to need a config dir while SHELDON_CONFIG_FILE already given, but for locking need I created the mentioned folder and it works ok now.

This looks like it could benefit a new parameter like "SHELDON_LOCK_FILE" which is mutually exclusive with config dir, for clarity.

@rossmacarthur rossmacarthur added the bug Something isn't working label Oct 29, 2022
@rossmacarthur
Copy link
Owner Author

Fixed in a632fc5

@seqizz
Copy link

seqizz commented Nov 16, 2022

I'm not sure if I understand the solution correctly. My global config is on /etc/sheldon.toml which made user shell lock up with the following message:

Blocking waiting for file lock on /etc

I suppose it's because my user doesn't have write rights to /etc.

@rossmacarthur
Copy link
Owner Author

rossmacarthur commented Nov 16, 2022

@seqizz Interesting, the purpose of the file mutex (it uses flock(2)) is so that two instances of sheldon do not run at the same time. E.g. you open two terminals at the same time.

There are two constraints here

  • The directory must exist already.
  • The directory must be writable by the user, I figured the directory where the config file lives would usually be writable.

The fix was made because the directory didn't exist so I changed it to use a directory that definitely would exist. I don't think its critical that the file mutex be acquired, I think we can make sheldon handle the permission case more gracefully. I've opened an issue for this

#159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants