Harry Putnam wrote: > Bob Proulx writes: > > Harry Putnam wrote: > >> I'm still not getting the whole picture of what is supposed to happen > >> on a machine with both anacron and cron installed. > > > > And you might be tired of having me respond about it. :-) > > Not on your life! I have a certain fondness for descriptive and very > helpful posts here.
Thank you for the kind words! They make my day. > > > Ok, it tests for the presence of /usr/sbin/anacron, checks that > > > it is executable and sees to it that this user has permission to > > > run it. > > > > Yes. The "this user" part is part that you trimmed off. It runs as > > the root user. The root user will always have permission. Let me > > show the part you trimmed off. (Times might be different.) > > I was trying to say... I 'got' all that. But I think your formulation > is a bit off. test -x doesn't care who is running what... it checks > to see that the soul calling test -x has permission to run the app it > is called against... at least, that was my reading of `man test'. True. But it is important to know that the user is root or not. Since root is the superuser it makes a difference. I agree completely with the exact words above. But... > But yes, in our subject case it is expected to be root.. > -x FILE > FILE exists and execute (or search) permission is granted Correct. And the superuser always has execute permission if any execute permission exists. And for reading and writing the superuser always has write permission even if no 'r' or 'w' bits are set. That last also tends to trip people. Test always returns true for the superuser for -r and -w. The particular part I was pedantically talking about was your comment that said "checks that it is executable", yes, all good, and then you go on to say "*and* sees to it that this user has permission". It was that last part, the second part of the _and_ that I was pedantically commenting upon. Because while true for non-root for root if it is root there isn't any user test. For the root user it is purely a check to see if there is at least one 'x' bit set. The user part does not matter. So the description really stops at the "checks that it is executable" part. Full stop there. Yes, I am being very pedantic. But the smallest of details can sometimes make very big differences. :-) > And just a small supplement to help you understand why I didn't quite > follow the setup... On the first sign of trouble with logs not getting > processed, I checked what state anacron was in with > `/etc/init.d/anacron status', which gave a blank <no reply> which made > me assume, (apparently wrongly) that anacron was not running. Well look at that. I think that is certainly a bug. Or at least a mis-feature. case $1 in status) exit 4 ;; That does not seem right. Anyone on the list care to look up the policy for init scripts and see what they should do if they do not have a daemon? (I have no time at the moment.) > So, I started thinking it was not getting called. I can see that happening! It didn't say anything. That isn't nice. > > "/etc/init.d/anacron start". Why invoke-rc.d? Because the local > > admin may have set up a policy-rc.d configuration that disables it. > > I was just wondering why `invoke-rc.d', now I get that too, thanks. I think that is too convoluted. The invoke-rc.d was originally intended to be called by dpkg and so policy-rc.d allowed a way to install a chroot'd system but not start daemons that were running in the parent. In the chroot you can install a full system but not have daemons started. Sure it is a general purpose interface and can be used here too but it isn't needed there and I think IMNHO that it just adds confusion by using it there. > And about needing anacron. Yes, I guess I'm just the type of user that > anacron was designed for. My machine is shut off nearly every day, and > sometimes isn't started for a day or two. When it is, there is no > rigid pattern time wise. Then it should be perfect for you! :-) > Seems like, if not anacron then I'd need to be a lot more trick and > careful with cron scheduling or do some scripting or the like. Yes. And since so many people have needed to do it then anacron is better because it is shared among everyone now. > Oh, and I hope you do not tire of answering my often poorly worded > queries. Not at all. It is fun! Keep them coming. Bob
signature.asc
Description: Digital signature