RE: [Samba] start of print file spool to samba
oh. that's what you meant. i was thinking that a jni/rmi call would be much, much faster. but this is easiest to code. i'll do it. thanks for helping me see the forest. i was concentrating on the trees. Regards, Floyd Shackelford 4 Peaks Technology Group, Inc. http://www.4peakstech.com/ VOICE: 334.735.9428 FAX: 916.404.7125 EMAIL: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] acta non verba -Original Message- From: Gerald Carter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 8:02 PM To: Floyd Shackelford Cc: [EMAIL PROTECTED] Subject: RE: [Samba] start of print file spool to samba On Wed, 24 Apr 2002, Floyd Shackelford wrote: i found the following two files with the string print command: ./param/loadparm.c: {print command, P_STRING, P_LOCAL, sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, loadparm.c is for declaring parameters and parsing smb.conf. ./printing/print_generic.c: run a given print command as best as i can tell, it's NOT loadparm.c. so that leaves print_generic.c That's what I was thinking of. if (strcmp(syscmd,print command) == 0) { // do my thing } ret = smbrun(syscmd,outfd); DEBUG(3,(Running the command `%s' gave %d\n,syscmd,ret)); Why not just make your command a wrapper that executes the lpr command? Something like #!/bin/sh my_command $1 lpr -P$2 $3 /bin/rm -f $3 and add a print command = some_script.sh %I %p %s No code changes necessary. cheers, jerry - Hewlett-Packard http://www.hp.com SAMBA Team http://www.samba.org --http://www.plainjoe.org Sam's Teach Yourself Samba in 24 Hours 2ed. ISBN 0-672-32269-2 --I never saved anything for the swim back. Ethan Hawk in Gattaca-- --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
RE: [Samba] start of print file spool to samba
oops. on second thought, i take it all back. this won't do at all. i want to get control at the very beginning of spooling the print job from the client machine to samba, not when samba is ready to print the job. i want to hook into samba as close to the point when samba realizes that it is going to receive a print job from the client machine as i can. and, at that hook location, i need to be able to easily get the client machine's ip address. Regards, Floyd Shackelford 4 Peaks Technology Group, Inc. http://www.4peakstech.com/ VOICE: 334.735.9428 FAX: 916.404.7125 EMAIL: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] acta non verba -Original Message- From: Floyd Shackelford [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 7:46 AM To: Gerald Carter Cc: [EMAIL PROTECTED] Subject: RE: [Samba] start of print file spool to samba oh. that's what you meant. i was thinking that a jni/rmi call would be much, much faster. but this is easiest to code. i'll do it. thanks for helping me see the forest. i was concentrating on the trees. Regards, Floyd Shackelford 4 Peaks Technology Group, Inc. http://www.4peakstech.com/ VOICE: 334.735.9428 FAX: 916.404.7125 EMAIL: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] acta non verba -Original Message- From: Gerald Carter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 8:02 PM To: Floyd Shackelford Cc: [EMAIL PROTECTED] Subject: RE: [Samba] start of print file spool to samba On Wed, 24 Apr 2002, Floyd Shackelford wrote: i found the following two files with the string print command: ./param/loadparm.c: {print command, P_STRING, P_LOCAL, sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, loadparm.c is for declaring parameters and parsing smb.conf. ./printing/print_generic.c: run a given print command as best as i can tell, it's NOT loadparm.c. so that leaves print_generic.c That's what I was thinking of. if (strcmp(syscmd,print command) == 0) { // do my thing } ret = smbrun(syscmd,outfd); DEBUG(3,(Running the command `%s' gave %d\n,syscmd,ret)); Why not just make your command a wrapper that executes the lpr command? Something like #!/bin/sh my_command $1 lpr -P$2 $3 /bin/rm -f $3 and add a print command = some_script.sh %I %p %s No code changes necessary. cheers, jerry - Hewlett-Packard http://www.hp.com SAMBA Team http://www.samba.org --http://www.plainjoe.org Sam's Teach Yourself Samba in 24 Hours 2ed. ISBN 0-672-32269-2 --I never saved anything for the swim back. Ethan Hawk in Gattaca-- --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002 -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
RE: [Samba] samba and JNI
i'm using redhat v7.2 as it comes right out of the box. here's what comes up at boot: Linux version 2.4.7-10 ([EMAIL PROTECTED]) (gcc version 2.96 2731 (Red Hat Linux 7.1 2.96-98)) #1 Thu Sep 6 17:27:27 EDT 2001 Regards, Floyd Shackelford 4 Peaks Technology Group, Inc. http://www.4peakstech.com/ VOICE: 334.735.9428 FAX: 916.404.7125 EMAIL: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] acta non verba -Original Message- From: Gerald Carter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 5:46 PM To: Floyd Shackelford Cc: [EMAIL PROTECTED] Subject: Re: [Samba] samba and JNI On Thu, 11 Apr 2002, Floyd Shackelford wrote: i am using a linux/samba box as a print server. whenever a user submits a print job, i want to notify the user that samba is receiving the print job. i have a java service running on each client machine that pops up a gui to that effect when notified. i am trying to integrate java JNI into samba to tell the java server on the client to display the gui. however, just adding the JNI initialization code to smbd/server.c main causes samba to get the following error whenever a print job is submitted. also, the print job fails to spool. (debug level 3) [2002/04/11 11:34:11, 0] smbd/oplock_linux.c:linux_init_kernel_oplocks(284) Failed to setup RT_SIGNAL_LEASE handler [2002/04/11 11:34:11, 3] smbd/oplock.c:init_oplocks(1214) open_oplock ipc: pid = 15010, global_oplock_port = 32775 [2002/04/11 11:34:11, 0] smbd/notify_kernel.c:kernel_notify_init(190) Failed to setup RT_SIGNAL_NOTIFY handler What linux kernel is this? Someone else posted a similar message to samba-technical wrt to Oracle Samba Strange... chau, jerry - Hewlett-Packard http://www.hp.com SAMBA Team http://www.samba.org --http://www.plainjoe.org Sam's Teach Yourself Samba in 24 Hours 2ed. ISBN 0-672-32269-2 --I never saved anything for the swim back. Ethan Hawk in Gattaca-- --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.342 / Virus Database: 189 - Release Date: 3/14/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.342 / Virus Database: 189 - Release Date: 3/14/2002 -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
RE: [Samba] start of print file spool to samba
i found the following two files with the string print command: ./param/loadparm.c: {print command, P_STRING, P_LOCAL, sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, ./printing/print_generic.c: run a given print command as best as i can tell, it's NOT loadparm.c. so that leaves print_generic.c it looks like this routine is the place? see my comments in the routine body. /*** * run a given print command a null terminated list of value/substitute pairs is provided for local substitution strings / static int print_run_command(int snum,char *command, int *outfd, ...) { pstring syscmd; char *p, *arg; int ret; va_list ap; va_start(ap, outfd); if (!command || !*command) return -1; if (!VALID_SNUM(snum)) { DEBUG(0,(Invalid snum %d for command %s\n, snum, command)); return -1; } pstrcpy(syscmd, command); while ((arg = va_arg(ap, char *))) { char *value = va_arg(ap,char *); pstring_sub(syscmd, arg, value); } va_end(ap); p = PRINTERNAME(snum); pstring_sub(syscmd, %p, p); standard_sub_snum(snum,syscmd); /* Convert script args to unix-codepage */ dos_to_unix(syscmd, True); /* fws: this appears to be right before the command gets run. so i would add something like: if (strcmp(syscmd,print command) == 0) { // do my thing } */ ret = smbrun(syscmd,outfd); DEBUG(3,(Running the command `%s' gave %d\n,syscmd,ret)); return ret; } does this look right to you? now the problem is: i need the ip address of the client that submitted the print job. how do i get that? Regards, Floyd Shackelford 4 Peaks Technology Group, Inc. http://www.4peakstech.com/ VOICE: 334.735.9428 FAX: 916.404.7125 EMAIL: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] acta non verba -Original Message- From: Gerald Carter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 4:34 PM To: Floyd Shackelford Cc: [EMAIL PROTECTED] Subject: Re: [Samba] start of print file spool to samba On Wed, 3 Apr 2002, Floyd Shackelford wrote: The problem is that JobStart.sh gets called about 5 times with every job. Obviously, i have my code in the wrong place. Can anyone suggest a better place to put it? Look for where we execute the print command. cheers, jerry - Hewlett-Packard http://www.hp.com SAMBA Team http://www.samba.org --http://www.plainjoe.org Sam's Teach Yourself Samba in 24 Hours 2ed. ISBN 0-672-32269-2 --I never saved anything for the swim back. Ethan Hawk in Gattaca-- --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.342 / Virus Database: 189 - Release Date: 3/14/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.342 / Virus Database: 189 - Release Date: 3/14/2002 -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
[Samba] samba and JNI
i am using a linux/sambabox as a print server. whenever a user submits a print job, i want to notify the user that samba is receiving the print job. i have a java service running on each client machine that pops up a gui to that effect when notified. i am trying to integrate java JNI into samba to tell the java server on the client to display the gui. however, just adding the JNI initialization code to "smbd/server.c main" causes samba to get the following error whenever a print job is submitted. also, the print job fails to spool. (debug level 3) [2002/04/11 11:34:11, 0] smbd/oplock_linux.c:linux_init_kernel_oplocks(284) Failed to setup RT_SIGNAL_LEASE handler[2002/04/11 11:34:11, 3] smbd/oplock.c:init_oplocks(1214) open_oplock ipc: pid = 15010, global_oplock_port = 32775[2002/04/11 11:34:11, 0] smbd/notify_kernel.c:kernel_notify_init(190) Failed to setup RT_SIGNAL_NOTIFY handler has anyone been successful in getting samba and JNI to work? alternatively, can anyone suggest why JNI might be causing samba to fail in this manner and how i can make it work? Regards,Floyd Shackelford4 Peaks Technology Group, Inc.VOICE: 334.735.9428FAX: 916.404.7125EMAIL: [EMAIL PROTECTED] acta non verba