Re: Printer Daemon (Update)

2009-12-05 Thread Matthew Dillon
:Update
:
:The socket /var/run/printer has permissions rwxrwx---. If I change them 
:to rwxrwxrwx there is no problem printing.
:
:Since no one else is complaining about this I assume I have something 
:set incorrectly but have run out of ideas.
:
:Thanks, Jim Chapman

Hmm.  On my printer box that socket is 770 and I can print fine so
I think changing the perms might just be masking the issue you are
having.

Usually printer daemon problems are due to ownership/group issues
in /var/spool/lpd or /var/spool/output, or path specifications
that are not accessible by group 'daemon'.

backup# ls -la /var/spool/lpd
total 2
drwxr-xr-x   2 root  daemon  512 Sep 12  2005 .
drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..

backup# ls -lRa /var/spool/output
total 4
drwxr-xr-x   3 root  daemon  512 Sep 22 10:57 .
drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..
drwxr-xr-x   2 root  daemon  512 Dec  1 10:23 lpd
-rw-rw-r--   1 root  daemon4 Dec  4 21:53 lpd.lock

/var/spool/output/lpd:
total 5
drwxr-xr-x  2 root  daemon  512 Dec  1 10:23 .
drwxr-xr-x  3 root  daemon  512 Sep 22 10:57 ..
-rw-rx  1 root  daemon4 Sep 22 11:04 .seq
-rw-rw-r--  1 root  daemon   33 Dec  1 10:23 lock
-rw-rw-r--  1 root  daemon   25 Dec  1 10:23 status
backup# 

In particular the lock file in /var/spool/output has to be 664
and the lock and status files in /var/spool/output/lpd have to be
664.  And the group has to be 'daemon'.

-Matt
Matthew Dillon 



Re: Printer Daemon (Update)

2010-03-13 Thread Stephane Russell
I'm getting the same exact problem as described when printing from a
regular user:

le...@alcyone: {102} lpq
alcyone: Warning: no daemon present
Rank   Owner  Job  Files Total Size
1stlette 618  (standard input)  697 bytes

no entries

I've just upgraded from 1.6 to 2.4, and I have this problem since. When
I'm printing from a user that is not in the 'wheel' group, I'm getting this:

le...@alcyone: {101} cat .cshrc | lp
lpr: Unable to connect to /var/run/printer: Permission denied
lpr: Check to see if the master 'lpd' process is running.
jobs queued, but cannot start daemon.

I have a printer named impgal01, and my directories permissions are very
similar to the one you show:

alcyone# ls -la /var/spool/lpd
total 4
drwxr-xr-x   2 root  daemon  512 Dec  4  2007 .
drwxr-xr-x  17 root  wheel   512 Jun 16  2008 ..

alcyone# ls -lRa /var/spool/output
total 10
drwxr-xr-x   4 root  daemon  512 Dec  5  2007 .
drwxr-xr-x  17 root  wheel   512 Jun 16  2008 ..
drwxr-xr-x   2 root  daemon  512 Mar 13 14:19 impgal01
drwxr-xr-x   2 root  daemon  512 Mar 13 12:39 lpd
-rw-rw-r--   1 root  daemon4 Mar 13 15:25 lpd.lock

/var/spool/output/impgal01:
total 10
drwxr-xr-x  2 root  daemon  512 Mar 13 14:19 .
drwxr-xr-x  4 root  daemon  512 Dec  5  2007 ..
-rw-rw---x  1 root  daemon4 Mar 13 14:18 .seq
-rw-rw-r--  1 root  daemon   46 Mar 13 14:01 lock
-rw-rw-r--  1 root  daemon   18 Mar 13 14:01 status

/var/spool/output/lpd:
total 4
drwxr-xr-x  2 root  daemon  512 Mar 13 12:39 .
drwxr-xr-x  4 root  daemon  512 Dec  5  2007 ..

It really seems that something changed in lpd between 1.6 and 2.4. I'll
have no choice than to chmod /var/run/printer if I want users to print.

SR


Matthew Dillon a écrit :
> :Update
> :
> :The socket /var/run/printer has permissions rwxrwx---. If I change them 
> :to rwxrwxrwx there is no problem printing.
> :
> :Since no one else is complaining about this I assume I have something 
> :set incorrectly but have run out of ideas.
> :
> :Thanks, Jim Chapman
> 
> Hmm.  On my printer box that socket is 770 and I can print fine so
> I think changing the perms might just be masking the issue you are
> having.
> 
> Usually printer daemon problems are due to ownership/group issues
> in /var/spool/lpd or /var/spool/output, or path specifications
> that are not accessible by group 'daemon'.
> 
> backup# ls -la /var/spool/lpd
> total 2
> drwxr-xr-x   2 root  daemon  512 Sep 12  2005 .
> drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..
> 
> backup# ls -lRa /var/spool/output
> total 4
> drwxr-xr-x   3 root  daemon  512 Sep 22 10:57 .
> drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..
> drwxr-xr-x   2 root  daemon  512 Dec  1 10:23 lpd
> -rw-rw-r--   1 root  daemon4 Dec  4 21:53 lpd.lock
> 
> /var/spool/output/lpd:
> total 5
> drwxr-xr-x  2 root  daemon  512 Dec  1 10:23 .
> drwxr-xr-x  3 root  daemon  512 Sep 22 10:57 ..
> -rw-rx  1 root  daemon4 Sep 22 11:04 .seq
> -rw-rw-r--  1 root  daemon   33 Dec  1 10:23 lock
> -rw-rw-r--  1 root  daemon   25 Dec  1 10:23 status
> backup# 
> 
> In particular the lock file in /var/spool/output has to be 664
> and the lock and status files in /var/spool/output/lpd have to be
> 664.  And the group has to be 'daemon'.
> 
>   -Matt
>   Matthew Dillon 
>   


Re: Printer Daemon (Update)

2010-11-21 Thread Tim Darby
I'm seeing this exact problem on a 2.8.3 system.  I've done the following
troubleshooting steps:

- Verified that I'm using the lpr that came with the system
- Verified that my spool directory permissions are all correct

When I print locally with lpr as root or as a user in the wheel group, it
works fine.  If I try to print as an unprivileged user, it fails.  I noticed
that changing permissions on the socket file /var/run/printer to 777 solves
the problem, but that doesn't seem like a good answer.  I see that lpr is
suid and in lpr/common_source/startdaemon.c, before it tries to connect to
the socket, it does a seteuid() to root, but I don't know what happens after
that.  Anyone have any insights into this?

Tim


On Sat, Mar 13, 2010 at 1:44 PM, Stephane Russell
wrote:

> I'm getting the same exact problem as described when printing from a
> regular user:
>
> le...@alcyone: {102} lpq
> alcyone: Warning: no daemon present
> Rank   Owner  Job  Files Total Size
> 1stlette 618  (standard input)  697 bytes
>
> no entries
>
> I've just upgraded from 1.6 to 2.4, and I have this problem since. When
> I'm printing from a user that is not in the 'wheel' group, I'm getting
> this:
>
> le...@alcyone: {101} cat .cshrc | lp
> lpr: Unable to connect to /var/run/printer: Permission denied
> lpr: Check to see if the master 'lpd' process is running.
> jobs queued, but cannot start daemon.
>
> I have a printer named impgal01, and my directories permissions are very
> similar to the one you show:
>
> alcyone# ls -la /var/spool/lpd
> total 4
> drwxr-xr-x   2 root  daemon  512 Dec  4  2007 .
> drwxr-xr-x  17 root  wheel   512 Jun 16  2008 ..
>
> alcyone# ls -lRa /var/spool/output
> total 10
> drwxr-xr-x   4 root  daemon  512 Dec  5  2007 .
> drwxr-xr-x  17 root  wheel   512 Jun 16  2008 ..
> drwxr-xr-x   2 root  daemon  512 Mar 13 14:19 impgal01
> drwxr-xr-x   2 root  daemon  512 Mar 13 12:39 lpd
> -rw-rw-r--   1 root  daemon4 Mar 13 15:25 lpd.lock
>
> /var/spool/output/impgal01:
> total 10
> drwxr-xr-x  2 root  daemon  512 Mar 13 14:19 .
> drwxr-xr-x  4 root  daemon  512 Dec  5  2007 ..
> -rw-rw---x  1 root  daemon4 Mar 13 14:18 .seq
> -rw-rw-r--  1 root  daemon   46 Mar 13 14:01 lock
> -rw-rw-r--  1 root  daemon   18 Mar 13 14:01 status
>
> /var/spool/output/lpd:
> total 4
> drwxr-xr-x  2 root  daemon  512 Mar 13 12:39 .
> drwxr-xr-x  4 root  daemon  512 Dec  5  2007 ..
>
> It really seems that something changed in lpd between 1.6 and 2.4. I'll
> have no choice than to chmod /var/run/printer if I want users to print.
>
> SR
>
>
> Matthew Dillon a écrit :
> > :Update
> > :
> > :The socket /var/run/printer has permissions rwxrwx---. If I change them
> > :to rwxrwxrwx there is no problem printing.
> > :
> > :Since no one else is complaining about this I assume I have something
> > :set incorrectly but have run out of ideas.
> > :
> > :Thanks, Jim Chapman
> >
> > Hmm.  On my printer box that socket is 770 and I can print fine so
> > I think changing the perms might just be masking the issue you are
> > having.
> >
> > Usually printer daemon problems are due to ownership/group issues
> > in /var/spool/lpd or /var/spool/output, or path specifications
> > that are not accessible by group 'daemon'.
> >
> > backup# ls -la /var/spool/lpd
> > total 2
> > drwxr-xr-x   2 root  daemon  512 Sep 12  2005 .
> > drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..
> >
> > backup# ls -lRa /var/spool/output
> > total 4
> > drwxr-xr-x   3 root  daemon  512 Sep 22 10:57 .
> > drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..
> > drwxr-xr-x   2 root  daemon  512 Dec  1 10:23 lpd
> > -rw-rw-r--   1 root  daemon4 Dec  4 21:53 lpd.lock
> >
> > /var/spool/output/lpd:
> > total 5
> > drwxr-xr-x  2 root  daemon  512 Dec  1 10:23 .
> > drwxr-xr-x  3 root  daemon  512 Sep 22 10:57 ..
> > -rw-rx  1 root  daemon4 Sep 22 11:04 .seq
> > -rw-rw-r--  1 root  daemon   33 Dec  1 10:23 lock
> > -rw-rw-r--  1 root  daemon   25 Dec  1 10:23 status
> > backup#
> >
> > In particular the lock file in /var/spool/output has to be 664
> > and the lock and status files in /var/spool/output/lpd have to be
> > 664.  And the group has to be 'daemon'.
> >
> >   -Matt
> >   Matthew Dillon
> >   
>


Re: Printer Daemon (Update)

2010-11-21 Thread Tim Darby
Oops, forgot to include printcap:

HPLaser|HPLaser:\
:lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:sh:mx#0:ff=

Tim


On Sun, Nov 21, 2010 at 4:03 PM, Tim Darby

> wrote:

> I'm seeing this exact problem on a 2.8.3 system.  I've done the following
> troubleshooting steps:
>
> - Verified that I'm using the lpr that came with the system
> - Verified that my spool directory permissions are all correct
>
> When I print locally with lpr as root or as a user in the wheel group, it
> works fine.  If I try to print as an unprivileged user, it fails.  I noticed
> that changing permissions on the socket file /var/run/printer to 777 solves
> the problem, but that doesn't seem like a good answer.  I see that lpr is
> suid and in lpr/common_source/startdaemon.c, before it tries to connect to
> the socket, it does a seteuid() to root, but I don't know what happens after
> that.  Anyone have any insights into this?
>
> Tim
>
>
>
> On Sat, Mar 13, 2010 at 1:44 PM, Stephane Russell <
> sruss...@prodigeinfo.com> wrote:
>
>> I'm getting the same exact problem as described when printing from a
>> regular user:
>>
>> le...@alcyone: {102} lpq
>> alcyone: Warning: no daemon present
>> Rank   Owner  Job  Files Total Size
>> 1stlette 618  (standard input)  697 bytes
>>
>> no entries
>>
>> I've just upgraded from 1.6 to 2.4, and I have this problem since. When
>> I'm printing from a user that is not in the 'wheel' group, I'm getting
>> this:
>>
>> le...@alcyone: {101} cat .cshrc | lp
>> lpr: Unable to connect to /var/run/printer: Permission denied
>> lpr: Check to see if the master 'lpd' process is running.
>> jobs queued, but cannot start daemon.
>>
>> I have a printer named impgal01, and my directories permissions are very
>> similar to the one you show:
>>
>> alcyone# ls -la /var/spool/lpd
>> total 4
>> drwxr-xr-x   2 root  daemon  512 Dec  4  2007 .
>> drwxr-xr-x  17 root  wheel   512 Jun 16  2008 ..
>>
>> alcyone# ls -lRa /var/spool/output
>> total 10
>> drwxr-xr-x   4 root  daemon  512 Dec  5  2007 .
>> drwxr-xr-x  17 root  wheel   512 Jun 16  2008 ..
>> drwxr-xr-x   2 root  daemon  512 Mar 13 14:19 impgal01
>> drwxr-xr-x   2 root  daemon  512 Mar 13 12:39 lpd
>> -rw-rw-r--   1 root  daemon4 Mar 13 15:25 lpd.lock
>>
>> /var/spool/output/impgal01:
>> total 10
>> drwxr-xr-x  2 root  daemon  512 Mar 13 14:19 .
>> drwxr-xr-x  4 root  daemon  512 Dec  5  2007 ..
>> -rw-rw---x  1 root  daemon4 Mar 13 14:18 .seq
>> -rw-rw-r--  1 root  daemon   46 Mar 13 14:01 lock
>> -rw-rw-r--  1 root  daemon   18 Mar 13 14:01 status
>>
>> /var/spool/output/lpd:
>> total 4
>> drwxr-xr-x  2 root  daemon  512 Mar 13 12:39 .
>> drwxr-xr-x  4 root  daemon  512 Dec  5  2007 ..
>>
>> It really seems that something changed in lpd between 1.6 and 2.4. I'll
>> have no choice than to chmod /var/run/printer if I want users to print.
>>
>> SR
>>
>>
>> Matthew Dillon a écrit :
>> > :Update
>> > :
>> > :The socket /var/run/printer has permissions rwxrwx---. If I change them
>> > :to rwxrwxrwx there is no problem printing.
>> > :
>> > :Since no one else is complaining about this I assume I have something
>> > :set incorrectly but have run out of ideas.
>> > :
>> > :Thanks, Jim Chapman
>> >
>> > Hmm.  On my printer box that socket is 770 and I can print fine so
>> > I think changing the perms might just be masking the issue you are
>> > having.
>> >
>> > Usually printer daemon problems are due to ownership/group issues
>> > in /var/spool/lpd or /var/spool/output, or path specifications
>> > that are not accessible by group 'daemon'.
>> >
>> > backup# ls -la /var/spool/lpd
>> > total 2
>> > drwxr-xr-x   2 root  daemon  512 Sep 12  2005 .
>> > drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..
>> >
>> > backup# ls -lRa /var/spool/output
>> > total 4
>> > drwxr-xr-x   3 root  daemon  512 Sep 22 10:57 .
>> > drwxr-xr-x  11 root  wheel   512 Apr  2  2008 ..
>> > drwxr-xr-x   2 root  daemon  512 Dec  1 10:23 lpd
>> > -rw-rw-r--   1 root  daemon4 Dec  4 21:53 lpd.lock
>> >
>> > /var/spool/output/lpd:
>> > total 5
>> > drwxr-xr-x  2 root  daemon  512 Dec  1 10:23 .
>> > drwxr-xr-x  3 root  daemon  512 Sep 22 10:57 ..
>> > -rw-rx  1 root  daemon4 Sep 22 11:04 .seq
>> > -rw-rw-r--  1 root  daemon   33 Dec  1 10:23 lock
>> > -rw-rw-r--  1 root  daemon   25 Dec  1 10:23 status
>> > backup#
>> >
>> > In particular the lock file in /var/spool/output has to be 664
>> > and the lock and status files in /var/spool/output/lpd have to be
>> > 664.  And the group has to be 'daemon'.
>> >
>> >   -Matt
>> >   Matthew Dillon
>> >   
>>
>
>


Re: Printer Daemon (Update)

2010-11-21 Thread Matthew Dillon
Hmm.

apollo:/usr/src/sys/vfs/hammer> ls -la /usr/bin/lpr
-r-sr-sr-x  1 root  daemon  26588 Oct 21 21:46 /usr/bin/lpr

Make sure lpr is suid & sgid root:daemon.  I am assuming your
filesystems aren't being mounted with the nosuid or nosgid mount
flags as well.

If lpr can't access the socket it kinda sounds like it isn't running
sgid.

-Matt


Re: Printer Daemon (Update)

2010-11-21 Thread Tim Darby
Yep, lpr looks right:

-r-sr-sr-x  1 root  daemon  26588 Nov 21 12:56 /usr/bin/lpr

and I haven't put nosuid or nosgid on my filesystems.  It's very puzzling.

Tim


On Sun, Nov 21, 2010 at 6:12 PM, Matthew Dillon  wrote:

>Hmm.
>
>apollo:/usr/src/sys/vfs/hammer> ls -la /usr/bin/lpr
>-r-sr-sr-x  1 root  daemon  26588 Oct 21 21:46 /usr/bin/lpr
>
>Make sure lpr is suid & sgid root:daemon.  I am assuming your
>filesystems aren't being mounted with the nosuid or nosgid mount
>flags as well.
>
>If lpr can't access the socket it kinda sounds like it isn't running
>sgid.
>
>-Matt
>


Re: Printer Daemon (Update)

2010-11-22 Thread Chris Turner

Tim Darby wrote:

Anyone have any insights into this?


What FS type is your /var/spool ?

I seem to recall some kind of tmpfs permissions issues of late..

cheers


Re: Printer Daemon (Update)

2010-11-22 Thread Tim Darby
My /var/spool is a hammer pfs, as created by the installer defaults.  This
feels like it has to be a permissions problem somewhere, but I haven't had
any luck finding it yet.

Tim


On Mon, Nov 22, 2010 at 3:32 PM, Chris Turner
wrote:

> Tim Darby wrote:
>
>> Anyone have any insights into this?
>>
>
> What FS type is your /var/spool ?
>
> I seem to recall some kind of tmpfs permissions issues of late..
>
> cheers
>


Re: Printer Daemon (Update)

2010-11-22 Thread Joe Talbott
On Mon, Nov 22, 2010 at 03:50:18PM -0700, Tim Darby wrote:
> My /var/spool is a hammer pfs, as created by the installer defaults.  This
> feels like it has to be a permissions problem somewhere, but I haven't had
> any luck finding it yet.

What is the output of:

ls -al /var/run/printer
id

What are the exact error messages you are receiving?

Thanks,
Joe


Re: Printer Daemon (Update)

2010-11-22 Thread Tim Darby
Here's the output:

srwxrwx---  1 root  wheel  0 Nov 21 23:14 /var/run/printer
uid=1001(tim) gid=1001(tim) groups=1001(tim)

and this is the error I'm seeing:

> /usr/bin/lpr -PHPLaser /home/tim/test
lpr: Unable to connect to /var/run/printer: Permission denied
lpr: Check to see if the master 'lpd' process is running.
jobs queued, but cannot start daemon.

Note that the lpd daemon is definitely running, so that's not an issue.  I
think that error means that it can't fork the daemon to handle this job.
 Also, here's what I see in the spool dir:

> ls -la /var/spool/output/lpd
total 144
drwxr-xr-x  1 rootdaemon   0 Nov 21 23:17 .
drwxr-xr-x  1 rootdaemon   0 Nov 21 22:52 ..
-rw-rw---x  1 rootdaemon   4 Nov 21 23:17 .seq
-rw-rw  1 daemon  daemon 125 Nov 21 23:17
cfA204ocotillo.timdarby.com 
-rw-rw  1 tim daemon  138992 Nov 21 23:17
dfA204ocotillo.timdarby.com 
-rw-rw-r--  1 rootdaemon  32 Nov 21 23:15 lock
-rw-rw-r--  1 rootdaemon  25 Nov 21 23:14 status

That job will stay in the queue forever until I restart the queue or "bump"
it by printing something as root.

Thanks,

Tim


On Mon, Nov 22, 2010 at 6:56 PM, Joe Talbott  wrote:

> On Mon, Nov 22, 2010 at 03:50:18PM -0700, Tim Darby wrote:
> > My /var/spool is a hammer pfs, as created by the installer defaults.
>  This
> > feels like it has to be a permissions problem somewhere, but I haven't
> had
> > any luck finding it yet.
>
> What is the output of:
>
> ls -al /var/run/printer
> id
>
> What are the exact error messages you are receiving?
>
> Thanks,
> Joe
>


Re: Printer Daemon (Update)

2010-11-23 Thread Garance A Drosihn

On 11/22/10 9:41 PM, Tim Darby wrote:
> Here's the output:
>
> srwxrwx---  1 root  wheel  0 Nov 21 23:14 /var/run/printer
> uid=1001(tim) gid=1001(tim) groups=1001(tim)
>
> and this is the error I'm seeing:
>
>>  /usr/bin/lpr -PHPLaser /home/tim/test
> lpr: Unable to connect to /var/run/printer: Permission denied
> lpr: Check to see if the master 'lpd' process is running.
> jobs queued, but cannot start daemon.
>

What is the output from:   ls -ld /var/run
And maybe: ls -ld /var
although I'd be pretty surprised if /var was the problem.

Seems strange that several people are seeing this.  I can't
imagine what's going on, so all I can do is make some wild
guesses at it.

--
Garance
g...@freebsd.org  (lpr/lpd guy for FreeBSD)


Re: Printer Daemon (Update)

2010-11-23 Thread Tim Darby
Here's the output:
~> ls -ld /var/run
drwxr-xr-x  1 root  wheel  0 Nov 21 23:14 /var/run
~>  ls -ld /var
drwxr-xr-x  1 root  wheel  0 Aug 21 22:44 /var

I agree; this is really bizarre-o.

One other data point, fwiw:  This machine, I'm pretty sure, started out with
a fresh install of DF 2.6, which was then upgraded via source to 2.8 and
this is the first time I've used it to print.  If I can find a spare
machine, I'll try a fresh install.  Would a vkernel make a good test?

Thanks,
Tim


On Tue, Nov 23, 2010 at 9:23 PM, Garance A Drosihn  wrote:

> On 11/22/10 9:41 PM, Tim Darby wrote:
> > Here's the output:
> >
> > srwxrwx---  1 root  wheel  0 Nov 21 23:14 /var/run/printer
> > uid=1001(tim) gid=1001(tim) groups=1001(tim)
> >
> > and this is the error I'm seeing:
> >
> >>  /usr/bin/lpr -PHPLaser /home/tim/test
> > lpr: Unable to connect to /var/run/printer: Permission denied
> > lpr: Check to see if the master 'lpd' process is running.
> > jobs queued, but cannot start daemon.
> >
>
> What is the output from:   ls -ld /var/run
> And maybe: ls -ld /var
> although I'd be pretty surprised if /var was the problem.
>
> Seems strange that several people are seeing this.  I can't
> imagine what's going on, so all I can do is make some wild
> guesses at it.
>
> --
> Garance
> g...@freebsd.org  (lpr/lpd guy for FreeBSD)
>


Re: Printer Daemon (Update)

2010-11-24 Thread Joe Talbott
On Tue, Nov 23, 2010 at 09:57:06PM -0700, Tim Darby wrote:
> Here's the output:
> ~> ls -ld /var/run
> drwxr-xr-x  1 root  wheel  0 Nov 21 23:14 /var/run
> ~>  ls -ld /var
> drwxr-xr-x  1 root  wheel  0 Aug 21 22:44 /var
> 
> I agree; this is really bizarre-o.
> 
> One other data point, fwiw:  This machine, I'm pretty sure, started out with
> a fresh install of DF 2.6, which was then upgraded via source to 2.8 and
> this is the first time I've used it to print.  If I can find a spare
> machine, I'll try a fresh install.  Would a vkernel make a good test?

This issue is in HEAD as well.  I'm working on a fix.  In the mean
time you can add yourself to the wheel group to get printing working.

Thanks,
Joe
> 
> Thanks,
> Tim
> 
> 
> On Tue, Nov 23, 2010 at 9:23 PM, Garance A Drosihn  wrote:
> 
> > On 11/22/10 9:41 PM, Tim Darby wrote:
> > > Here's the output:
> > >
> > > srwxrwx---  1 root  wheel  0 Nov 21 23:14 /var/run/printer
> > > uid=1001(tim) gid=1001(tim) groups=1001(tim)
> > >
> > > and this is the error I'm seeing:
> > >
> > >>  /usr/bin/lpr -PHPLaser /home/tim/test
> > > lpr: Unable to connect to /var/run/printer: Permission denied
> > > lpr: Check to see if the master 'lpd' process is running.
> > > jobs queued, but cannot start daemon.
> > >
> >
> > What is the output from:   ls -ld /var/run
> > And maybe: ls -ld /var
> > although I'd be pretty surprised if /var was the problem.
> >
> > Seems strange that several people are seeing this.  I can't
> > imagine what's going on, so all I can do is make some wild
> > guesses at it.
> >
> > --
> > Garance
> > g...@freebsd.org  (lpr/lpd guy for FreeBSD)
> >


Re: Printer Daemon (Update)

2010-11-24 Thread Joe Talbott
On Tue, Nov 23, 2010 at 09:57:06PM -0700, Tim Darby wrote:
> Here's the output:
> ~> ls -ld /var/run
> drwxr-xr-x  1 root  wheel  0 Nov 21 23:14 /var/run
> ~>  ls -ld /var
> drwxr-xr-x  1 root  wheel  0 Aug 21 22:44 /var
> 
> I agree; this is really bizarre-o.
> 
> One other data point, fwiw:  This machine, I'm pretty sure, started out with
> a fresh install of DF 2.6, which was then upgraded via source to 2.8 and
> this is the first time I've used it to print.  If I can find a spare
> machine, I'll try a fresh install.  Would a vkernel make a good test?

Please try the attached patch.  There's a slight possibility of a
panic on boot so make a backup copy of /boot/kernel before
installkernel.

Make sure to remove yourself from wheel if you added yourself and
logout and log back in before testing.

Thanks,
Joe
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 3421e0c..b3c9986 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -868,7 +868,7 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
 		error = ENOTSOCK;
 		goto bad;
 	}
-	error = VOP_ACCESS(vp, VWRITE, p->p_ucred);
+	error = VOP_EACCESS(vp, VWRITE, p->p_ucred);
 	if (error)
 		goto bad;
 	so2 = vp->v_socket;


Re: Printer Daemon (Update)

2010-11-24 Thread Tim Darby
Thanks, Joe.  I'll try this later when I'm at the machine's location.
 Doesn't sound like a smart thing to try remotely. ;-)

Tim


On Wed, Nov 24, 2010 at 9:04 AM, Joe Talbott  wrote:

> On Tue, Nov 23, 2010 at 09:57:06PM -0700, Tim Darby wrote:
> > Here's the output:
> > ~> ls -ld /var/run
> > drwxr-xr-x  1 root  wheel  0 Nov 21 23:14 /var/run
> > ~>  ls -ld /var
> > drwxr-xr-x  1 root  wheel  0 Aug 21 22:44 /var
> >
> > I agree; this is really bizarre-o.
> >
> > One other data point, fwiw:  This machine, I'm pretty sure, started out
> with
> > a fresh install of DF 2.6, which was then upgraded via source to 2.8 and
> > this is the first time I've used it to print.  If I can find a spare
> > machine, I'll try a fresh install.  Would a vkernel make a good test?
>
> Please try the attached patch.  There's a slight possibility of a
> panic on boot so make a backup copy of /boot/kernel before
> installkernel.
>
> Make sure to remove yourself from wheel if you added yourself and
> logout and log back in before testing.
>
> Thanks,
> Joe
>


Re: Printer Daemon (Update)

2010-11-25 Thread Tim Darby
Success, thanks!  Just a few comments:

- When I look at the commit history, it appears that the part you changed
has been like that all the way back to the beginning of the project?
- When I rebuilt kernel and world, I went ahead threw in all the recent
MFC'ed things.  Now, when I print to lpt0, I'm seeing these messages, which
I assume are harmless:

Nov 25 08:58:34 ocotillo kernel: sched_ithd: stray interrupt 7 on cpu 0
Nov 25 08:58:34 ocotillo kernel: sched_ithd: stray interrupt 7 on cpu 0
Nov 25 08:58:34 ocotillo kernel: sched_ithd: 10 stray interrupts 7 on cpu 0
- there will be no further reports

- Just to satisfy my own curiosity about the code:  how does lpr.c
eventually get to unp_connect()?  I followed it as far as connect() in
startdaemon.c and then lost the trail.

Thanks,
Tim


On Wed, Nov 24, 2010 at 9:04 AM, Joe Talbott  wrote:

> On Tue, Nov 23, 2010 at 09:57:06PM -0700, Tim Darby wrote:
> > Here's the output:
> > ~> ls -ld /var/run
> > drwxr-xr-x  1 root  wheel  0 Nov 21 23:14 /var/run
> > ~>  ls -ld /var
> > drwxr-xr-x  1 root  wheel  0 Aug 21 22:44 /var
> >
> > I agree; this is really bizarre-o.
> >
> > One other data point, fwiw:  This machine, I'm pretty sure, started out
> with
> > a fresh install of DF 2.6, which was then upgraded via source to 2.8 and
> > this is the first time I've used it to print.  If I can find a spare
> > machine, I'll try a fresh install.  Would a vkernel make a good test?
>
> Please try the attached patch.  There's a slight possibility of a
> panic on boot so make a backup copy of /boot/kernel before
> installkernel.
>
> Make sure to remove yourself from wheel if you added yourself and
> logout and log back in before testing.
>
> Thanks,
> Joe
>


Re: Printer Daemon (Update)

2010-11-25 Thread Alex Hornung

On 25/11/2010 16:35, Tim Darby wrote:
- Just to satisfy my own curiosity about the code:  how does lpr.c 
eventually get to unp_connect()?  I followed it as far as connect() in 
startdaemon.c and then lost the trail.
I haven't really followed this thread, but to answer this question: 
connect -> sys_connect -> ... -> some routine eventually sends an lwkt 
message to the protocol handler for connect, which for this case will be 
unp_connect()


Cheers,
Alex Hornung


Re: Printer Daemon (Update)

2010-11-29 Thread Joe Talbott
On Thu, Nov 25, 2010 at 09:35:23AM -0700, Tim Darby wrote:
> Success, thanks!  Just a few comments:

Great.  I committed the patch.

> 
> - When I look at the commit history, it appears that the part you changed
> has been like that all the way back to the beginning of the project?

I don't know if this issue has been here all along as I almost always
add myself to the wheel group.  Do you know that this worked in the
past?  If so, do you know what time frame.

> - When I rebuilt kernel and world, I went ahead threw in all the recent
> MFC'ed things.  Now, when I print to lpt0, I'm seeing these messages, which
> I assume are harmless:
> 
> Nov 25 08:58:34 ocotillo kernel: sched_ithd: stray interrupt 7 on cpu 0
> Nov 25 08:58:34 ocotillo kernel: sched_ithd: stray interrupt 7 on cpu 0
> Nov 25 08:58:34 ocotillo kernel: sched_ithd: 10 stray interrupts 7 on cpu 0
> - there will be no further reports

I think you can ignore these if printing is working for you.

Thanks,
Joe


Re: Printer Daemon (Update)

2010-11-29 Thread Tim Darby
I think I've always added myself to wheel too and just recently stopped
doing that, so I can't say if printing as an unprivileged user ever worked
in the past.  Thanks again for the fix.

Tim


On Mon, Nov 29, 2010 at 7:18 PM, Joe Talbott  wrote:

> On Thu, Nov 25, 2010 at 09:35:23AM -0700, Tim Darby wrote:
> > Success, thanks!  Just a few comments:
>
> Great.  I committed the patch.
>
> >
> > - When I look at the commit history, it appears that the part you changed
> > has been like that all the way back to the beginning of the project?
>
> I don't know if this issue has been here all along as I almost always
> add myself to the wheel group.  Do you know that this worked in the
> past?  If so, do you know what time frame.
>
> > - When I rebuilt kernel and world, I went ahead threw in all the recent
> > MFC'ed things.  Now, when I print to lpt0, I'm seeing these messages,
> which
> > I assume are harmless:
> >
> > Nov 25 08:58:34 ocotillo kernel: sched_ithd: stray interrupt 7 on cpu 0
> > Nov 25 08:58:34 ocotillo kernel: sched_ithd: stray interrupt 7 on cpu 0
> > Nov 25 08:58:34 ocotillo kernel: sched_ithd: 10 stray interrupts 7 on cpu
> 0
> > - there will be no further reports
>
> I think you can ignore these if printing is working for you.
>
> Thanks,
> Joe
>