-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fix directory usage #207
Fix directory usage #207
Conversation
2064fb9
to
b03fb1e
Compare
package/rmt-server.spec
Outdated
@@ -218,11 +224,25 @@ getent passwd %{rmt_user} >/dev/null || \ | |||
%post | |||
%service_add_post rmt-server.target rmt-server.service rmt-server-migration.service rmt-server-mirror.service rmt-server-sync.service | |||
cd %{_datadir}/rmt && runuser -u %{rmt_user} -g %{rmt_group} -- bin/rails secrets:setup >/dev/null | |||
cd %{_datadir}/rmt && runuser -u %{rmt_user} -g %{rmt_group} -- bin/rails runner -e production "Rails::Secrets.write({'production' => {'secret_key_base' => SecureRandom.hex(64)}}.to_yaml)" >/dev/null | |||
if [ $1 -eq 1 ] ; then | |||
cd %{_datadir}/rmt && runuser -u %{rmt_user} -g %{rmt_group} -- bin/rails runner -e production "Rails::Secrets.write({'production' => {'secret_key_base' => SecureRandom.hex(64)}}.to_yaml)" >/dev/nulla |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>/dev/nulla
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whaa good catch!
5d4d40f
to
b711294
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Tested on a fresh SLE 15 VM.
Update from 1.0.0 to this 1.0.6 moved the files and everything.
Only one comment about the changelog entry. See inline.
And one question: Is the current behavior of doing a zypper in --oldpackage rmt-server-1.0.0
afterwards good enough? Since it does not move the files back to the old place, but it creates rpmsave file in the new place (since the old package version does not have these files) and creates new config files in the old place. So you basically loose your config and there is no RPM output about it.
Since I don't know if we should/must support downgrading as-well, I'm not yet approving this PR.
@ikapelyukhin Can you provide an answer to my question?
package/rmt-server.changes
Outdated
Thu Aug 2 16:19:35 UTC 2018 - fschnizlein@suse.com | ||
|
||
- Version 1.0.6 | ||
- Change file paths to new locations to make read-only rmt servers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Change file paths to new locations to make RMT work with read-only rootfs
would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes true I will change it. Regarding downgrading, good question!
b711294
to
b246c77
Compare
@thutterer But the data is not really lost after the package is removed, it's just in a new location? You are supposed to upgrade, not downgrade! |
Haha, totally fine with me 😃 |
b246c77
to
bd93260
Compare
Change configuration, ssl and uuid path to make sure rmt also works on a read-only installation
yast/yast-rmt#26
Path changes:
/usr/share/rmt/ssl
->/etc/rmt/ssl
/usr/share/rmt/config/system_uuid
->/var/lib/rmt/system_uuid
/etc/rmt.conf
->/etc/rmt/rmt.conf