Newsgroups: comp.unix.sco.misc From: Bela Lubkin <belal@sco.com> Subject: Re: acctcom, at, OSR507 by mail.ut.sco.com with SMTP; 2 Oct 2004 21:39:01 -0000 Date: Sat, 2 Oct 2004 21:38:45 GMT Message-ID: <20041002213845.GU23239@sco.com> X-Nntp-Posting-Host: enigma.xenitec.on.ca References: <415F16FE.4E38C1C5@tenzing.org> Roger Cornelius wrote:
> On OSR507 with MP3 and UP3, why does acctcom produce no output when run > by at? This took a little longer to diagnose I thought you meant it was new behavior in MP3/UP3. I finally tried the same on an OSR505 system and got the same results. `acctcom` makes a guess about whether you mean to process stdin or the default file, /usr/adm/pacct. If stdin is a tty or /dev/null, it assumes you want /usr/adm/pacct; otherwise, you want stdin. stdin of a process run by `at` is the shell script containing the commands you told it to run. `acctcom` attempts to process that as accounting records, doesn't see anything sensible, and produces no output. Workaround: tell it either `acctcom /usr/adm/pacct` or `acctcom < /dev/null`. Hmmm, now that I've written this, I see that acctcom(ADM) itself says the same thing: " If no files are specified, and if the standard input is " associated with a terminal or /dev/null (as is the case when " using ``&'' in the shell), acctcom reads /usr/adm/pacct; " otherwise, it reads the standard input.
Another way to look at this problem is that when you run `acctcom` from the command line, with no arguments, you're really committing a semantic error. You are actually telling it that you intend to manually type in accounting records (binary gibberish). Someone long ago noticed that this wasn't a useful behavior, so they made the program guess your real intentions. So `acctcom` abets your semantic error. Everything's fine until you present it with different conditions where the sematic error becomes significant. The heuristic could probably be improved. e.g. if stdin is a file, but either its total size or its current seek offset isn't a multiple of the accounting record size, it could guess that you didn't mean stdin. But that would only work _most_ of the time; occasionally you would again hit the conditions (e.g. you'd submit an `at` job whose resulting script was an exact multiple of 32 bytes -- a 1-in-32 chance), and it would misbehave again. Only now it would be 32x more mysterious. The real chance is more like 1-in-32^2, so now it would screw up one in a thousand runs. I would rather have it fail consistently, so you immediately notice the problem and deal with it... >Bela<
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar