From: Jeremy Allison on
On Tue, Jun 22, 2010 at 02:49:13PM -0700, Jeremy Allison wrote:
> On Tue, Jun 22, 2010 at 05:37:08PM -0400, Eric Rowell wrote:
> > Tried the following after poking around:
> >
> > rpcclient -c "setjob printer 1340 job_control_cancel" -U username PrinterServer
> >
> > rpcclient -c "setjob printer 1340 job_control_delete" -U username PrinterServer
> >
> > It doesn't error but it didn't cancel or delete the job.
>
> The "setjob" function uses a numeric job control code
> (which sucks, I know :-).
>
> So you need to do the following :
>
> SPOOLSS_JOB_CONTROL_PAUSE=(int)(1),
> SPOOLSS_JOB_CONTROL_RESUME=(int)(2),
> SPOOLSS_JOB_CONTROL_CANCEL=(int)(3),
> SPOOLSS_JOB_CONTROL_RESTART=(int)(4),
> SPOOLSS_JOB_CONTROL_DELETE=(int)(5),
> SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER=(int)(6),
> SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED=(int)(7),
> SPOOLSS_JOB_CONTROL_RETAIN=(int)(8),
> SPOOLSS_JOB_CONTROL_RELEASE=(int)(9)
>
> rpcclient -c "setjob printer 1340 5" -U username PrinterServer
>
> for job control delete.

Here's a patch (that applies to 3.5.x) that
makes this a little nicer to use.

Jeremy.
From: Eric Rowell on
I would agree with the thoughts on the suggests changes. But I also
understand the limited resources on making these changes. At least if
we can get these in the "net" command so they are in one common place.

I would suggest that the cancel should also go into the "net" command.
Just to have a common set of tools compared to the windows "net"
command. Makes it easier to have people find. But if it is in the
rpcclient command I'm OK with that too.

Eric

On Tue, Jun 22, 2010 at 5:37 PM, Jeremy Allison <jra(a)samba.org> wrote:
> On Tue, Jun 22, 2010 at 05:21:22PM -0400, Eric Rowell wrote:
>> Jeremy,
>>     WoW.  It worked just as expected;
>>             rpcclient -c "enumjobs printer" -U user printserver
>>
>>    This worked great to get the list of the jobs on the print queue.
>> (too bad the "net" command doesn't support this)
>
> Ok, I should fix the smbclient and net binaries to use
> this instead.. Internally it's the cli_print_queue()
> function. Maybe I should add a cli_print_queue2()
> to keep backwards compatibility with old servers
> that only support RAP printing, and change smbclient
> and net to use cli_print_queue2() by default, and
> then fall back to cli_print_queue() if that fails...
>
>
>>    Now if I could just get the delete/cancel job command I would be
>> golden.  I didn't see a command equivalent on the list of options for
>> the rpcclient command.  Since the option from "net" and smbclient
>> don't work for the same reason.
>
> Adding delete and cancel to rpcclient shouldn't
> be too hard. We have all the infrastructure
> for this. Probably will be in 3.6.0 and above though.
>
> Jeremy.
>



--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Eric Rowell on
Jeremy,
Thank you so much for your time on this. This is great, it worked.
I now can do what is currently required for listing and canceling
print jobs.

I'm good with using numeric job control codes. I'm going to be
embedding these program calls into a set of programs which will be
running these commands for the users. This will allows the values for
that field to be whatever is required. Man I have spent way too much
time trying to get the RAP versions working, guess I should have
posted more details a few weeks ago.

I hope the people who have asked me if anyone has got it this
working are reading. You have provided me and some other people out
there a great set of solutions. May not be where we expected but it
is solved. I never even looked at the rpcclient and it is very
powerful.

Eric B. Rowell

On Tue, Jun 22, 2010 at 5:49 PM, Jeremy Allison <jra(a)samba.org> wrote:
> On Tue, Jun 22, 2010 at 05:37:08PM -0400, Eric Rowell wrote:
>> Tried the following after poking around:
>>
>> rpcclient -c "setjob printer  1340 job_control_cancel" -U username PrinterServer
>>
>> rpcclient -c "setjob printer  1340 job_control_delete" -U username PrinterServer
>>
>> It doesn't error but it didn't cancel or delete the job.
>
> The "setjob" function uses a numeric job control code
> (which sucks, I know :-).
>
> So you need to do the following :
>
>        SPOOLSS_JOB_CONTROL_PAUSE=(int)(1),
>        SPOOLSS_JOB_CONTROL_RESUME=(int)(2),
>        SPOOLSS_JOB_CONTROL_CANCEL=(int)(3),
>        SPOOLSS_JOB_CONTROL_RESTART=(int)(4),
>        SPOOLSS_JOB_CONTROL_DELETE=(int)(5),
>        SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER=(int)(6),
>        SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED=(int)(7),
>        SPOOLSS_JOB_CONTROL_RETAIN=(int)(8),
>        SPOOLSS_JOB_CONTROL_RELEASE=(int)(9)
>
> rpcclient -c "setjob printer  1340 5" -U username PrinterServer
>
> for job control delete.
>



--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Eric Rowell on
Thank you for the patch. This will help make it easier for others to
use this command set. Is there anything I can do to help get it into
the documentation for the man page for future people looking to use
this?

Eric B. Rowell

On Tue, Jun 22, 2010 at 6:09 PM, Jeremy Allison <jra(a)samba.org> wrote:
> On Tue, Jun 22, 2010 at 02:49:13PM -0700, Jeremy Allison wrote:
>> On Tue, Jun 22, 2010 at 05:37:08PM -0400, Eric Rowell wrote:
>> > Tried the following after poking around:
>> >
>> > rpcclient -c "setjob printer  1340 job_control_cancel" -U username PrinterServer
>> >
>> > rpcclient -c "setjob printer  1340 job_control_delete" -U username PrinterServer
>> >
>> > It doesn't error but it didn't cancel or delete the job.
>>
>> The "setjob" function uses a numeric job control code
>> (which sucks, I know :-).
>>
>> So you need to do the following :
>>
>>         SPOOLSS_JOB_CONTROL_PAUSE=(int)(1),
>>         SPOOLSS_JOB_CONTROL_RESUME=(int)(2),
>>         SPOOLSS_JOB_CONTROL_CANCEL=(int)(3),
>>         SPOOLSS_JOB_CONTROL_RESTART=(int)(4),
>>         SPOOLSS_JOB_CONTROL_DELETE=(int)(5),
>>         SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER=(int)(6),
>>         SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED=(int)(7),
>>         SPOOLSS_JOB_CONTROL_RETAIN=(int)(8),
>>         SPOOLSS_JOB_CONTROL_RELEASE=(int)(9)
>>
>> rpcclient -c "setjob printer  1340 5" -U username PrinterServer
>>
>> for job control delete.
>
> Here's a patch (that applies to 3.5.x) that
> makes this a little nicer to use.
>
> Jeremy.
>



--
Eric B. Rowell
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Jeremy Allison on
On Wed, Jun 23, 2010 at 07:50:57AM -0400, Eric Rowell wrote:
> Thank you for the patch. This will help make it easier for others to
> use this command set. Is there anything I can do to help get it into
> the documentation for the man page for future people looking to use
> this?

Err, yes. You could write the documentation for the "setjob"
command (which is missing right now).

Jeremy.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba