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

[JENKINS-42846] - Fix regressions in images after slave.jar => agent.jar renaming with improper symlink #82

Merged

Conversation

oleg-nenashev
Copy link
Member

@oleg-nenashev oleg-nenashev commented Sep 20, 2019

Fixes agents. 3.35-1 is completely broken, and emergency reviews will be appreciated

@oleg-nenashev oleg-nenashev requested review from a team and stopalopa September 20, 2019 11:13
&& chmod 755 /usr/share/jenkins \
&& chmod 644 /usr/share/jenkins/slave.jar \
&& chmod 644 /usr/share/jenkins/agent.jar \
&& ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar \
Copy link
Member Author

Choose a reason for hiding this comment

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

-f flag here was a bad idea, yes

Copy link

@jimklimov jimklimov Sep 20, 2019

Choose a reason for hiding this comment

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

I think you don't really want full pathnames here, if you reference an agent.jar located in same directory as the slave.jar symlink. Full names make work with alternate root FSes (backups, look into containers from hosts, etc.) problematic, relative symlinks ease this pain a lot.

With GNU tooling, ln -sr trims the original absolute or relative path to required relative minimum, and sets that into the value of symlink.

Copy link
Member Author

Choose a reason for hiding this comment

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

I suggest doing it as a follow-up. Just fixing the images now so that they do not fall apart

Choose a reason for hiding this comment

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

Yes, sure, this nit is not urgent :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I now can't remember why I added the -f flag, but maybe it does something different than what I originally thought. Why is it a bad idea?

@oleg-nenashev oleg-nenashev merged commit f58fdfb into jenkinsci:master Sep 20, 2019
@oleg-nenashev oleg-nenashev deleted the JENKINS-42846-regressions branch September 20, 2019 11:39
@oleg-nenashev
Copy link
Member Author

oleg-nenashev commented Sep 20, 2019 via email

@stopalopa
Copy link
Contributor

ln works differently in Mac and Linux? When I check the man pages on my Mac it says the following for -f: If the target file already exists, then unlink it so that the link may occur. (The -f option overrides any previous -i options.)

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

Successfully merging this pull request may close these issues.

5 participants