> From [EMAIL PROTECTED] Fri Aug 24 05:15:36 2001
> Date: Thu, 23 Aug 2001 01:02:39 -0400 (EDT)
> From: Ryan Novosielski <[EMAIL PROTECTED]>
> To: LPRng Mailing List <[EMAIL PROTECTED]>
> Subject: LPRng: Accounting script -- exit with nonzero status but not ABORT?
>
> Is it possible to have the accounting script exit with something other
> than zero, so it is apparent that the accounting portion of the script
> failed (someone around here is big on non-zero codes for abnormal
> termination), but allow the jobs to print anyway (ie. it's our problem,
> not the users')? All non-zero codes I use so far either bomb out the
> printjob, or stop the job from being printed in some way.
>
> ---- _ _ _ _ ___ _ _ _
> |Y#| | | |\/| | \ |\ | | | Ryan Novosielski - Jr. UNIX Systems Admin
> |$&| |__| | | |__/ | \| _| | [EMAIL PROTECTED] - 973/972.0922 (2-0922)
> \__/ Univ. of Med. and Dent. | IST/ACS - New Jersey Medical School - C630
Sure. Just edit the code in LPRng/src/common/lpd_jobs.c:
if( Accounting_remote_DYN && Accounting_file_DYN ){
if( Accounting_start_DYN ){
status = Do_accounting( 0,
Accounting_start_DYN, job, Send_job_rw_timeout_DYN );
}
DEBUG1("Remote_job: accounting status %s", Server_status(status) );
if( status ){
SNPRINTF(buffer,sizeof(buffer))
"accounting check failed '%s'", Server_status(status));
SETSTATUS(job)"%s", buffer );
switch(status){
case JFAIL: break;
case JHOLD: Set_flag_value(&job->info,HOLD_TIME,time((void *)0)); break;
case JREMOVE: Set_flag_value(&job->info,REMOVE_TIME,time((void *)0)); break;
>>>> and you add yours here:
case 10: Print_nasty_message; status = 0; break;
>>>>
default: Set_str_value(&job->info,ERROR,buffer); break;
}
Set_hold_file(job, 0 );
goto exit;
}
}
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------