logs archiveIRC Archive / Freenode / #centos / 2015 / August / 25 / 1
Dan0maN
the reason i ask, is that it seems that the default route seems to have been set via the ifcfg scripts, as i can't find the setting anywhere in nmcli
Ussat
I always use the scripts myself
Dan0maN
well, another fun part is that i renamed the nmcli connection id's a couple of times, and one of the scripts got renamed to an intermediate name, and the other didn't ever change
Ussat
Yea..I dont do NM
midgaze
Dan0maN: default route is /etc/sysconfig/network , not in network-scripte/ifcfg-*
Dan0maN: mine simply contains GATEWAY="10.0.0.1"
pj
midgaze: it can go in either place
belak
sdgathman: I've had conversations with random people in here... I have 3 binaries which I need to move into place atomically. They can go one at a time as long as the file moves are atomic.
sdgathman: which really just means I can't just do the simple extraction
pj
belak: last time I checked, mv was atomic
midgaze
belak: cp the file to a place in the same directory (on the same filesystem is the key part) as filename.tmp and then mv filename.tmp filename
mv is only atomic if it is a relink and not a file copy, so only if operating on a destination on the same filesystem
         

pj
well, mv is atomic so long as the source and destination are on the same fs.
belak
pj: mv is atomic, but installing from RPMs doesn't use mv
pj
belak: what problem are you trying to resolve here?
midgaze
he wants somebody to do his job for him
Ussat
dont we all ? while we get paid.....
midgaze
here, let me take a source rpm and make the necessary modifications to make sure the files get put into place atomically
just kidding
belak
I have a binary which is called fairly often. Many times per second. So, I'm trying to find a way to make the rpm install the binaries so that it will never be in a state where those binaries are broken.
ikonia
so you don't want to compile the binary as part of the package
you just want to use it as a blob distribution pacakge
package ?
belak
ikonia: I mean, when you install rpms, that's a part of it... there are files that get copied into place...
ikonia
right, so you either want to a.) compile the binary as part of the packaging process b.) want to drop a pre-compiled binary in place from an rpm
belak
yes, b is what I was doing
I have the binaries compiled and in an rpm
ikonia
ok, so what's the problem ?
midgaze
haha, soldier on
belak
Never mind. I'm going to look through the docs and maybe be back if I run out of ideas.
ikonia
errrr "ok"
deryni-work
What does RPM do to install the files? cp?
ikonia
depends, you tell it what to do
deryni-work
ikonia: Not during the build. During the RPM install itself.
ikonia
depends what you tell it to do
deryni-work
You don't tell it what to do there. You just list things in %files.
         

ikonia
no thats not what %files is for
deryni-work
Unless you do things manually in %post.
ikonia
%files is the manifest
deryni-work
Of files in the RPM that RPM installs for you, yes.
Files that you have already placed into the buildroot. A buildroot which is not under discussion.
belak
So, you use %files to specify which files this rpm installs, but you can use other things to install them however you want?
Dan0maN
you can drop the file onto the system, and copy them into place via post scriptlet
midgaze: also, my /etc/sysconfig/network is empty
well, other than '# Created by anaconda'
midgaze
one could strace an RPM install and see what system calls happen when the file is put into place. It wouldn't surprise me if it's a two step copy/move by default
if the inode of the target binary changes that's further evidence that it places the new file and then moves it into place
deryni-work
Indeed. I'd sort of expect copy/move would be the default but then again a straight copy wouldn't be unreasonable either.
midgaze
I doubt that something as basic as not leaving a window with an incomplete binary has gone overlooked, on a system that's meant to be updated live
RPM wasn't born yesterday
belak
Is there a way to view all the parts of a .rpm?
deryni-work
Define "all the parts"?
belak
I'd like to see things like the %post script and the files which are embedded
deryni-work
rpm -qp --xml <rpm> will show you all sorts of information about the rpm. You can get more easily readable lists of files from '-qpl' and just the scritps from '--scripts', etc.
belak
That'll be a big help
pj
belak: that said, it's probably easier to view various sections of the spec file if you grab the .src.rpm and actually look at the spec file.
belak
pj: it's an rpm which was created with fpm
pj
I've heard of that, fpm somehow spits out a spec file in the rpm creation process, but I'm not sure how to get it to just generate the spec.
belak
pj: https://github.com/jordansissel/fpm/blob/master/templates/rpm.erb
pj
belak: and I'm supposed to do what with that?
this is not fpm support
sdgathman
belak: get the SRPM
If you don't have the SRPM, you don't have the source to the rpm.
trying to do what you want with the binary is only somewhat removed from disassembly
You can however, get the file list with rpm -qp and the scripts with rpm -q --scripts
belak
I just don't understand why rpm wouldn't use atomic operations when installing from the cpio archive portion of the rpm
sdgathman
Since you don't know exactly how the RPM was built, you can't be sure it doesn't
midgaze
it's possible that they do, doing a cp/mv to avoid race conditions is basic stuff
Zathrus
neither cp nor mv are atomic.
belak
sdgathman: I know it uses cpio
midgaze
mv is atomic
Zathrus
midgaze: not for multiple files it's not.
belak
Zathrus: mv is if you're on the same filesystem
Well, no, not for multiple files
Zathrus
which is the think belak asked for when he first asked about this, 2 weeks ago
s/think/thing/
sdgathman
Assuming RPM is actually broken as you say, you will be unable to submit a useful bug report without a SRPM to reproduce it.
Although RedHat probably would be interested in a binary to reproduce it - especially with a script to run the test case.
Zathrus
RPM isn't broken... the way he's going about this is.
belak
I seem to recall that the simplest way to work around this would be to make sure the servers don't get new traffic while the binaries are replaced
sdgathman
I submitted a test case where RPM was broken when there was an I/O error on the filesystem.
belak
But I was hoping to aboid that
*avoid
midgaze
when src and dst are on the same filesystem mv uses rename(2) which is atomic.. the gnu coreutils mv manpage doesn't give details, but freebsd manpage spells it out
Zathrus
midgaze: yes, but, again, it's not atomic for MULTIPLE files at once. Which is part of his requirements. He doesn't want a file system, he wants a database.
belak
Zathrus: that's not part of my requirements
midgaze
it is if you mv a directory into place
sdgathman
(Action) starts daydreaming about a filesystem with multifile transactions
belak
Zathrus: I don't care if they're moved in one at a time
As long as they aren't copied into place
Zathrus
midgaze: except you cannot do rename() on a directory -- or, more specifically, it either must not exist or must be empty (c.f. -- man 2 rename)
belak: Ok, I thought you said that was a requirement before. Have you looked at how the glibc or perhaps even bash rpms do it then? They are certainly doing things atomically for individual files. Having a partially written glibc would be a... problem. Note, however, the sane thing remains to ensure that they won't be called during upgrade time. If you don't have a plan for handling this, then what are you going to do when there's a system failure?
sdgathman
belak: RPM extracts the cpio archive to a temporary location - and then does something to install the files.
belak
I'll take a look at those RPMs
Zathrus
sdgathman: which should be a mv; I'd be surprised if it's not. But that temp location could also be on a different FS, invalidating the atomicity
midgaze
Zathrus: yeah, you're right, the only way I can find to atomically switch from one directory to another is by moving a new symlink over an old symlink
Zathrus
midgaze: if the oldpath doesn't exist then rename() of a directory should be atomic as well, but expecting rpm to rm -rf a subdir is probably a REALLY bad idea :)
midgaze
Zathrus: Yeah, I'm not talking about RPM anymore, this got theoretical :)
Zathrus
nod
midgaze: we'd previously suggested that he look at using a symlink to do all of this in a pseudo-atomic fashion. It's hacky, but so is the entire thing.
« prev 1 2 3 4 5 6 7 8 next »