Thread View: news.software.nntp
14 messages
14 total messages
Started by Tony
Fri, 05 Jul 2013 12:50
pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Tony
Date: Fri, 05 Jul 2013 12:50
Date: Fri, 05 Jul 2013 12:50
37 lines
2508 bytes
2508 bytes
I've used pullnews in the past on Debian Squeeze, and had a reason to use it again today, which is the first time since upgrading to Wheezy (and replacing inn2 with inn2-lfs). When I try and use pullnews, as a regular user, the script believes it's running as 'news', and so fails, because a) it can't create locks in /usr/lib/news, and it can't find the .pullnews file (because it's looking in /usr/lib/news, not /home/user). I copied the file to my own home directory, removed all references to the INN perl modules, INN::Config and INN::Utils::Shlock; and it runs fine (obviously, without any locking). Has something changed intentionally since the Squeeze release of INN, or is this broken behaviour? I wouldn't expect to have to run pullnews as the news user only? FYI, here's the failure, tony@matrix:~$ /usr/lib/news/bin/pullnews -k 100 -r uk.net -g uk.net Use of uninitialized value $opt_H in lc at /usr/lib/news/bin/pullnews line 212. shlock: shlock: Can't open "shlock26783", Permission denied: Permission denied cannot create lockfile /usr/lib/news/.pullnews.pid I'm sure I've run pullnews as a non-news user in Squeeze, but maybe that was working by luck rather than design? -- Tony Evans Saving trees and wasting electrons since 1993 blog -> http://perceptionistruth.com/ books -> http://www.bookthing.co.uk/ [ anything below this line wasn't written by me ]
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Julien ÉLIE
Date: Fri, 05 Jul 2013 21:14
Date: Fri, 05 Jul 2013 21:14
49 lines
2948 bytes
2948 bytes
Hi Tony,
> When I try and use pullnews, as a regular user, the script believes it's
> running as 'news', and so fails, because a) it can't create locks in
> /usr/lib/news, and it can't find the .pullnews file (because it's
> looking in /usr/lib/news, not /home/user).
http://www.eyrie.org/~eagle/software/inn/docs-2.5/pullnews.html
This is what the "-c" flag is for.
> Has something changed intentionally since the Squeeze release of INN, or
> is this broken behaviour? I wouldn't expect to have to run pullnews as
> the news user only?
Maybe it is linked to the change of how $HOME is dealt with in INN
2.5.3. Note that innshellvars*.local files are now possible.
Please also have a look at:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584234
> tony@matrix:~$ /usr/lib/news/bin/pullnews -k 100 -r uk.net -g uk.net
You should add "-c /path/to/pullnews.marks".
> Use of uninitialized value $opt_H in lc at /usr/lib/news/bin/pullnews line 212.
> shlock: shlock: Can't open "shlock26783", Permission denied: Permission denied
> cannot create lockfile /usr/lib/news/.pullnews.pid
Probably a new warning in the latest version of Perl. I will have a look.
> I'm sure I've run pullnews as a non-news user in Squeeze, but maybe that
> was working by luck rather than design?
$ENV{HOME} is where pullnews looks at, in INN 2.5.x.
This behaviour will change to <pathdb> in INN 2.6.0.
--
Julien ÉLIE
« Et vous allez reprendre votre bateau… Et, mergitur ou pas,
fluctuat ! Compris ! Fluctuat ! » (Goudurix)
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Tony
Date: Fri, 05 Jul 2013 22:04
Date: Fri, 05 Jul 2013 22:04
53 lines
3572 bytes
3572 bytes
In news.software.nntp, Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
wrote:
>Hi Tony,
>
>> When I try and use pullnews, as a regular user, the script believes it's
>> running as 'news', and so fails, because a) it can't create locks in
>> /usr/lib/news, and it can't find the .pullnews file (because it's
>> looking in /usr/lib/news, not /home/user).
>
> http://www.eyrie.org/~eagle/software/inn/docs-2.5/pullnews.html
>
>This is what the "-c" flag is for.
Not really, and it didn't used to be necessary.
>> tony@matrix:~$ /usr/lib/news/bin/pullnews -k 100 -r uk.net -g uk.net
>
>You should add "-c /path/to/pullnews.marks".
That won't fix the issue with locks.
>> Use of uninitialized value $opt_H in lc at /usr/lib/news/bin/pullnews line 212.
>> shlock: shlock: Can't open "shlock26783", Permission denied: Permission denied
>> cannot create lockfile /usr/lib/news/.pullnews.pid
>
>Probably a new warning in the latest version of Perl. I will have a look.
No, it's not a new warning, it's a failure because the user 'tony' can't
write locks in /usr/lib/news/ which is the home dir for 'news', which
pullnews now assumes you're running everything as.
>> I'm sure I've run pullnews as a non-news user in Squeeze, but maybe that
>> was working by luck rather than design?
>
>$ENV{HOME} is where pullnews looks at, in INN 2.5.x.
>This behaviour will change to <pathdb> in INN 2.6.0.
$ENV{HOME} when I run pullnews is /home/tony, but pullnews tries to use
/usr/lib/news - it's picking up the 'news' user home directory, and
overriding the user running pullnews.
That's new in Wheezy, and it's broken, IMO, unless pullnews is never
intended to be run as a non-news user (which it used to be in the past).
You can test this simply by having pullnews print $ENV{HOME}, it's always
/usr/lib/news on Debian, not the home directory of the actual executing
user.
--
Tony Evans
Seeking archives for uk.* from 1998 and older. Especially interested
in uk.net.news.* and any groups which preceded uk.net.news.* for
hierarchy management (uk.misc? uk.net?).
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Julien ÉLIE
Date: Sat, 06 Jul 2013 16:33
Date: Sat, 06 Jul 2013 16:33
65 lines
4109 bytes
4109 bytes
Hi Tony,
>>> tony@matrix:~$ /usr/lib/news/bin/pullnews -k 100 -r uk.net -g uk.net
>>
>> You should add "-c /path/to/pullnews.marks".
>
> That won't fix the issue with locks.
Why won't it be fixing it?
If you use "-c /path/to/pullnews.marks", the lock will be written in the
file /path/to/pullnews.marks.pid so your user "tony" should be able to
access it.
>>> Use of uninitialized value $opt_H in lc at /usr/lib/news/bin/pullnews line 212.
>>
>> Probably a new warning in the latest version of Perl. I will have a look.
>
> No, it's not a new warning, it's a failure because the user 'tony' can't
> write locks in /usr/lib/news/ which is the home dir for 'news', which
> pullnews now assumes you're running everything as.
I was speaking about the "use of uninitialized value $opt_H in lc" warning.
> $ENV{HOME} when I run pullnews is /home/tony, but pullnews tries to use
> /usr/lib/news - it's picking up the 'news' user home directory, and
> overriding the user running pullnews.
>
> That's new in Wheezy, and it's broken, IMO, unless pullnews is never
> intended to be run as a non-news user (which it used to be in the past).
OK, I understand what happened.
The behaviour has changed in Wheezy because pullnews uses INN::Config
(to properly handle locks) whereas it previously did not.
As innshellvars* & INN::Config are setting $HOME to the home of the news
user in INN 2.4.x (and probably before) and 2.5.x, the path changed. It
therefore generates the unfortunate behaviour you are seeing. I did not
see it when testing the addition of INN::Config to pullnews because I am
using the news user... Sorry.
One solution would be to remove the line
$ENV{'HOME'} = ${pathnews};
from the file Config.pm shipped with INN.
Another solution would be to add "-c /home/tony" to the pullnews you are
running. Did you test that? I do not understand why you would have an
error for the lock file if you use "-c /home/tony"; the lock file is
written in your home directory.
I suggest to use "-c /home/tony" because it will work with Wheezy, and
also with future INN versions.
Starting from INN 2.6.0, $ENV{'HOME'} is no longer overriden by
innshellvars* & INN::Config but pullnews will still need "-c /home/tony"
when run as another user than the news user. The new default value is
<pathdb> (where the active and history files are) instead of $HOME. And
the file is <pathdb>/pullnews.marks (instead of .pullnews, a "hidden" file).
--
Julien ÉLIE
« Et vous allez reprendre votre bateau… Et, mergitur ou pas,
fluctuat ! Compris ! Fluctuat ! » (Goudurix)
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Julien ÉLIE
Date: Sat, 06 Jul 2013 16:40
Date: Sat, 06 Jul 2013 16:40
27 lines
2586 bytes
2586 bytes
Hi all, > The behaviour has changed in Wheezy because pullnews uses INN::Config > (to properly handle locks) whereas it previously did not. > As innshellvars* & INN::Config are setting $HOME to the home of the news > user in INN 2.4.x (and probably before) and 2.5.x, the path changed. It > therefore generates the unfortunate behaviour you are seeing. I did not > see it when testing the addition of INN::Config to pullnews because I am > using the news user... Sorry. For INN 2.5.4, what would be better? -> revert pullnews to its previous 2.5.2 behaviour (no INN::Config, legacy lock handling, .pullnews in the home directory of the user running the script) -> keep the 2.5.3 behaviour (.pullnews is now in the home directory of the news user) and update the documentation of pullnews accordingly Maybe keeping the 2.5.3 behaviour would be better for people running pullnews with another user than the news user because they will otherwise have another change in 2.5.4... -- Julien ÉLIE « Et vous allez reprendre votre bateau… Et, mergitur ou pas, fluctuat ! Compris ! Fluctuat ! » (Goudurix)
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Tony
Date: Sat, 06 Jul 2013 17:51
Date: Sat, 06 Jul 2013 17:51
64 lines
4127 bytes
4127 bytes
In news.software.nntp, Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
wrote:
>Hi Tony,
>
>>>> tony@matrix:~$ /usr/lib/news/bin/pullnews -k 100 -r uk.net -g uk.net
>>>
>>> You should add "-c /path/to/pullnews.marks".
>>
>> That won't fix the issue with locks.
>
>Why won't it be fixing it?
>If you use "-c /path/to/pullnews.marks", the lock will be written in the
>file /path/to/pullnews.marks.pid so your user "tony" should be able to
>access it.
Then the man page needs to be re-written.
>OK, I understand what happened.
>
>The behaviour has changed in Wheezy because pullnews uses INN::Config
>(to properly handle locks) whereas it previously did not.
>As innshellvars* & INN::Config are setting $HOME to the home of the news
>user in INN 2.4.x (and probably before) and 2.5.x, the path changed. It
>therefore generates the unfortunate behaviour you are seeing. I did not
>see it when testing the addition of INN::Config to pullnews because I am
>using the news user... Sorry.
>One solution would be to remove the line
>$ENV{'HOME'} = ${pathnews};
>from the file Config.pm shipped with INN.
I've already got a solution which works, but anyone running pullnews from
crontab on a non-news user on Debian has had a broken config since Wheezy.
Maybe no one is.
>Another solution would be to add "-c /home/tony" to the pullnews you are
>running. Did you test that? I do not understand why you would have an
>error for the lock file if you use "-c /home/tony"; the lock file is
>written in your home directory.
It's not -c /home/tony though, it's -c /home/tony/.pullnews. And if that
has to be present, then the man page needs to be fixed. It would also be
the only tool I know which looks in the wrong home directory by default.
>I suggest to use "-c /home/tony" because it will work with Wheezy, and
>also with future INN versions.
I guess the manpage needs to be updated then.
>Starting from INN 2.6.0, $ENV{'HOME'} is no longer overriden by
>innshellvars* & INN::Config but pullnews will still need "-c /home/tony"
>when run as another user than the news user. The new default value is
><pathdb> (where the active and history files are) instead of $HOME. And
>the file is <pathdb>/pullnews.marks (instead of .pullnews, a "hidden" file).
I don't understand why the tool is being changed so that essentially, only
the news user can run it. It used to be a nice general purpose tool that
would run with sane defaults for any user?
--
Tony Evans
Seeking archives for uk.* from 1998 and older. Especially interested
in uk.net.news.* and any groups which preceded uk.net.news.* for
hierarchy management (uk.misc? uk.net?).
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Tony
Date: Sat, 06 Jul 2013 17:53
Date: Sat, 06 Jul 2013 17:53
39 lines
3028 bytes
3028 bytes
In news.software.nntp, Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> wrote: >Hi all, > >> The behaviour has changed in Wheezy because pullnews uses INN::Config >> (to properly handle locks) whereas it previously did not. >> As innshellvars* & INN::Config are setting $HOME to the home of the news >> user in INN 2.4.x (and probably before) and 2.5.x, the path changed. It >> therefore generates the unfortunate behaviour you are seeing. I did not >> see it when testing the addition of INN::Config to pullnews because I am >> using the news user... Sorry. > >For INN 2.5.4, what would be better? If you want my opinion, then this one, >-> revert pullnews to its previous 2.5.2 behaviour (no INN::Config, >legacy lock handling, .pullnews in the home directory of the user >running the script) because it's a nice general purpose tool useable with sane defaults by anyone on a machine. Feels to me like a lot of developers now develop on their own workstations and forget about Linux servers with multiple users. >-> keep the 2.5.3 behaviour (.pullnews is now in the home directory of >the news user) and update the documentation of pullnews accordingly I don't like this because it breaks existing behaviour for no obvious overall benefit. However, it's moot for me, I'll just keep the modified version in the path and stop using the version that comes with INN, because I can't trust it to keep working. -- Tony Evans Seeking archives for uk.* from 1998 and older. Especially interested in uk.net.news.* and any groups which preceded uk.net.news.* for hierarchy management (uk.misc? uk.net?).
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Tony
Date: Sat, 06 Jul 2013 17:54
Date: Sat, 06 Jul 2013 17:54
7 lines
1653 bytes
1653 bytes
Thank you for your responses, btw, they are appreciated (even if I seem grumpy). -- Tony Evans Seeking archives for uk.* from 1998 and older. Especially interested in uk.net.news.* and any groups which preceded uk.net.news.* for hierarchy management (uk.misc? uk.net?).
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Julien ÉLIE
Date: Sat, 06 Jul 2013 18:27
Date: Sat, 06 Jul 2013 18:27
59 lines
3751 bytes
3751 bytes
Hi Tony,
>> Another solution would be to add "-c /home/tony" to the pullnews you are
>> running. Did you test that? I do not understand why you would have an
>> error for the lock file if you use "-c /home/tony"; the lock file is
>> written in your home directory.
>
> It's not -c /home/tony though, it's -c /home/tony/.pullnews.
Yes, it is "-c /home/tony/.pullnews" (with the name of the config file).
> And if that has to be present, then the man page needs to be fixed.
Of course! At least for INN 2.5.3 (and perhaps INN 2.5.4 depending on
what we do for the next release).
> I don't understand why the tool is being changed so that essentially, only
> the news user can run it. It used to be a nice general purpose tool that
> would run with sane defaults for any user?
Another question is whether pullnews should be usable outside an INN
environment. The version of pullnews shipped with INN 2.5.3 expects the
usability of the Perl INN::Utils::Shlock package. So basically,
pullnews currently needs INN.
It could be possible to use the legacy shlock() function if
INN::Utils::Shlock is not found, which would therefore allow to use
pullnews as a standalone script (like suck).
I do not know whether people expect that for pullnews and use it outside
INN (though it is only shipped with INN!).
Anyway, all the users can use it, not only the news user.
The following documentation is extracted from the version in development
(2.6.0 yet not released):
http://www.eyrie.org/~eagle/software/inn/docs/pullnews.html
-c config
Normally, the config file is stored in pullnews.marks in pathdb. If -c
is given, config will be used as the config file instead. This is useful
if you're running pullnews as a system user on an automated basis out of
cron or as an individual user, rather than the news user.
A possibility would be to check whether the running user is the one
mentioned in the runasuser parameter in inn.conf. If that is the case,
we use <pathdb>. Otherwise, $ENV{HOME} would be used.
Would it be an acceptable behaviour?
--
Julien ÉLIE
« Et vous allez reprendre votre bateau… Et, mergitur ou pas,
fluctuat ! Compris ! Fluctuat ! » (Goudurix)
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Julien ÉLIE
Date: Sat, 06 Jul 2013 18:32
Date: Sat, 06 Jul 2013 18:32
29 lines
2819 bytes
2819 bytes
Hi Tony, >> -> revert pullnews to its previous 2.5.2 behaviour (no INN::Config, >> legacy lock handling, .pullnews in the home directory of the user >> running the script) > > because it's a nice general purpose tool useable with sane defaults by > anyone on a machine. Feels to me like a lot of developers now develop on > their own workstations and forget about Linux servers with multiple users. I understand your point, and I am glad you initiated this thread. We can go into that direction for INN 2.5.4 and revert to the previous behaviour. (Please have a look at my other response for INN 2.6.0.) > However, it's moot for me, I'll just keep the modified version in the path > and stop using the version that comes with INN, because I can't trust it to > keep working. You're right that the pullnews script shipped with INN 2.5.3 has the unfortunate bug you reported (thanks again for it). But it does not mean that future versions cannot be trusted to work! :-) -- Julien ÉLIE « Et vous allez reprendre votre bateau… Et, mergitur ou pas, fluctuat ! Compris ! Fluctuat ! » (Goudurix)
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Tony
Date: Sat, 06 Jul 2013 19:32
Date: Sat, 06 Jul 2013 19:32
24 lines
2674 bytes
2674 bytes
In news.software.nntp, Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
wrote:
>A possibility would be to check whether the running user is the one
>mentioned in the runasuser parameter in inn.conf. If that is the case,
>we use <pathdb>. Otherwise, $ENV{HOME} would be used.
>Would it be an acceptable behaviour?
I obviously don't understand why it needs to be changed to <pathdb> instead
of just using the home dir of the running user?
If you stopped it using <pathdb>, and just kept it using $ENV{HOME} without
overriding it, what would the problem be?
However, if there's a pressing, actual desire for it to use <pathdb> then
yes, I'd prefer it to only use if that if it's run by the runasuser value.
But I guess I'm just one person, and perhaps I've been using pullnews
incorrectly for the past few years?
--
Tony Evans
Seeking archives for uk.* from 1998 and older. Especially interested
in uk.net.news.* and any groups which preceded uk.net.news.* for
hierarchy management (uk.misc? uk.net?).
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Julien ÉLIE
Date: Sat, 06 Jul 2013 20:03
Date: Sat, 06 Jul 2013 20:03
41 lines
3349 bytes
3349 bytes
Hi Tony,
>> A possibility would be to check whether the running user is the one
>> mentioned in the runasuser parameter in inn.conf. If that is the case,
>> we use <pathdb>. Otherwise, $ENV{HOME} would be used.
>> Would it be an acceptable behaviour?
>
> I obviously don't understand why it needs to be changed to <pathdb> instead
> of just using the home dir of the running user?
>
> If you stopped it using <pathdb>, and just kept it using $ENV{HOME} without
> overriding it, what would the problem be?
It is for better integration with the "news" environment. States (like
what ".pullnews" stores) are not meant to be at the root of the home
directory of the news user but in the directory where similar states are
(<pathdb>).
The change is essentially done to rationalize the files used by INN.
A second foreseen step is to separate state and configuration in this
file, which would lead to <pathdb>/pullnews.marks (state) and
<pathetc>/pullnews.conf (configuration).
The current ".pullnews" file is not a best practise at all!
> But I guess I'm just one person, and perhaps I've been using pullnews
> incorrectly for the past few years?
You are using pullnews correctly. It just happens that there is a bug
in the version shipped with INN 2.5.3, and that the next major release
of INN (2.6.0) will change the location of the file for the news user
only (so no change for you, in your use case, except for the fact that
".pullnews" is renamed to "pullnews.marks" -- and maybe split into
"pullnews.conf" if done for INN 2.6.0).
--
Julien ÉLIE
« Et vous allez reprendre votre bateau… Et, mergitur ou pas,
fluctuat ! Compris ! Fluctuat ! » (Goudurix)
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Julien ÉLIE
Date: Mon, 08 Jul 2013 19:37
Date: Mon, 08 Jul 2013 19:37
34 lines
2709 bytes
2709 bytes
Hi Tony,
> I understand your point, and I am glad you initiated this thread. We
> can go into that direction for INN 2.5.4 and revert to the previous
> behaviour.
I believe the bugs you reported are now solved.
-> Perl warning because of an uninitialized variable:
http://inn.eyrie.org/trac/changeset/9505
-> wrong running user's home directory
http://inn.eyrie.org/trac/changeset/9504
> You're right that the pullnews script shipped with INN 2.5.3 has the
> unfortunate bug you reported (thanks again for it). But it does not
> mean that future versions cannot be trusted to work! :-)
Could you please give a try to the new script?
http://inn.eyrie.org/trac/browser/branches/2.5/frontends/pullnews.in
It can be easily downloaded (link at the bottom of the page).
pullnews can now run again outside INN (it will then use its legacy
flock() function instead of the INN::Utils::Shlock Perl package).
And the running user's home directory is now properly used!
--
Julien ÉLIE
« Et vous allez reprendre votre bateau… Et, mergitur ou pas,
fluctuat ! Compris ! Fluctuat ! » (Goudurix)
Re: pullnews (Debian Wheezy, inn2-lfs) broken?
Author: Tony
Date: Mon, 08 Jul 2013 22:18
Date: Mon, 08 Jul 2013 22:18
23 lines
2201 bytes
2201 bytes
Hi Julien, >I believe the bugs you reported are now solved. > >-> Perl warning because of an uninitialized variable: > http://inn.eyrie.org/trac/changeset/9505 > >-> wrong running user's home directory > http://inn.eyrie.org/trac/changeset/9504 Thank you. >Could you please give a try to the new script? > http://inn.eyrie.org/trac/browser/branches/2.5/frontends/pullnews.in > >It can be easily downloaded (link at the bottom of the page). Yep, it works (using just -r and -g), thank you again. -- Tony Evans Seeking archives for uk.* from 1998 and older. Especially interested in uk.net.news.* and any groups which preceded uk.net.news.* for hierarchy management (uk.misc? uk.net?).
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads