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

iox-#625 set file lock directory to /tmp/ #626

Merged

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Mar 22, 2021

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Branch follows the naming format (iox-#123-this-is-a-branch)
  4. Commits messages are according to this guideline
    • Commit messages have the issue ID (iox-#123 commit text)
    • Commit messages are signed (git commit -s)
    • Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  5. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  6. Relevant issues are linked
  7. Add sensible notes for the reviewer
  8. All checks have passed (except task-list-completed)
  9. Assign PR to reviewer

Notes for Reviewer

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #626 (afec953) into master (5995747) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #626      +/-   ##
==========================================
- Coverage   72.89%   72.86%   -0.03%     
==========================================
  Files         312      312              
  Lines       10819    10819              
  Branches     1941     1941              
==========================================
- Hits         7886     7883       -3     
- Misses       2170     2172       +2     
- Partials      763      764       +1     
Flag Coverage Δ
unittests 72.86% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
iceoryx_utils/source/posix_wrapper/timer.cpp 59.64% <0.00%> (-0.88%) ⬇️
...nternal/roudi/introspection/port_introspection.inl 71.89% <0.00%> (-0.73%) ⬇️
...ils/include/iceoryx_utils/internal/cxx/smart_c.inl 89.06% <0.00%> (+1.56%) ⬆️

Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to unblock developers who are not using ubuntu but we need to check the impact of this on QNX

@elfenpiff elfenpiff merged commit aa162c6 into eclipse-iceoryx:master Mar 22, 2021
@@ -45,7 +45,7 @@ enum class FileLockError
INTERNAL_LOGIC_ERROR,
};

constexpr char PATH_PREFIX[] = "/var/lock/";
constexpr char PATH_PREFIX[] = "/tmp/";
Copy link
Contributor

@mossmaurice mossmaurice Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the file system hierarchy standard defined by the Linux foundation, lock files shall be placed under /var/lock. Seems like your distribution decided to choose another location. Mac OS prefers /var/tmp/, this will be available with #598

QNX advises to use /var/lock, but in our experience so far, it depends to the image, that is created.

Could you please add this with an #ifdef for common platforms? installation.md#QNX currently states that /var/locks is used, in case you change it please update it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mossmaurice sorry I read your comment after I merged the pull request :( ... but I will handle this comment nevertheless.

According to the file system hierarchy standard defined by the Linux foundation, lock files shall be placed under /var/locks

This is correct but the access rights of /var/lock is in Gentoo, ArchLinux and OpenSuSe like the following:

drwxrwxr-x  5 root root    120 Mar 22 15:26 lock
# /var

This means the user which is starting RouDi has to be at least in the root group. On the other hand /tmp/ is for all users always read and writable and since the applications and roudi has started as an arbitrary user it is the perfect spot for the lock file in QNX, Mac OS and Linux. If you insist in using /var/lock for the lock file we have to do the following things.

  1. Write #ifdef for the platforms, instead of using /tmp which works for every platform (except Windows of course).
  2. Add a chapter in the installation.md on howto add the user which is executing roudi to the lock management group of Linux, Mac OS (this will be a pain) and QNX.

If you do not object I would let the directory be /tmp and would add this to the installation.md since the file system hierarchy standard states the directory structure of a linux system and not where an application has to store the files. I admit it would be best to use the folders accordingly but it seems that on some linux systems we do not have access to /var/lock but we will always have access to /tmp.

By the way this also goes for QNX. The QNX boards of the past where also exactly in this way configured that everything was read only and we only had write access to /tmp.

@elfenpiff elfenpiff deleted the iox-#625-fix-file-lock-directory branch March 23, 2021 09:02
marthtz pushed a commit to boschglobal/iceoryx that referenced this pull request May 12, 2021
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

Successfully merging this pull request may close these issues.

FileLock requires write access to root owned directory /var/lock/
4 participants