Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
popfile: Why not file in init.d
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Horus107
Apprentice
Apprentice


Joined: 29 Mar 2004
Posts: 230

PostPosted: Fri Jul 28, 2006 6:44 pm    Post subject: popfile: Why not file in init.d Reply with quote

Hello,
is there any reason that no startup file for popfile is placed in init.d? I would really appreciate such a file...

Thanks,

Florian
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1403
Location: Adelaide/Australia

PostPosted: Wed Dec 13, 2006 7:06 am    Post subject: What I did to solve the problem... Reply with quote

/etc/init.d/popfile
Code:

#!/sbin/runscript
# Copyright 1999-2004 Lyall Pearce
# Distributed under the terms of the GNU General Public License v2
# Constructed by Lyall Pearce, 2004

# Note: You need to start popfile on boot

depend() {
        need net
}

start() {
        ebegin "Starting popfile"
        start-stop-daemon --start --quiet --background --env POPFILE_ROOT="${POPFILE_ROOT}" --exec "${POPFILE_ROOT}/popfile.pl"
        eend $?
}

stop() {
        ebegin "Stopping popfile"
        start-stop-daemon --stop --verbose --name ${POPFILE_ROOT}/popfile.pl
        eend $?
}


Requires a patch to /usr/share/popfile/POPFile/Configuration.pm

This overcomes the start-stop-daemon program not allowing more than one --env option
in the /etc/init.d/popfile script
from
Code:

    # Local copies of POPFILE_ROOT and POPFILE_USER

    $self->{popfile_root__} = $ENV{POPFILE_ROOT} || './';
    $self->{popfile_user__} = $ENV{POPFILE_USER} || './';

to
Code:

    # Local copies of POPFILE_ROOT and POPFILE_USER
    # Hacked by Lyall Pearce to make POPFILE_USER default to POPFILE_ROOT if not found

    $self->{popfile_root__} = $ENV{POPFILE_ROOT} || './';
    $self->{popfile_user__} = $ENV{POPFILE_USER} || $ENV{POPFILE_ROOT} || './';

_________________
...Lyall
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 488
Location: Connecticut, USA

PostPosted: Thu Oct 04, 2007 10:26 pm    Post subject: Reply with quote

Thanks for the script. I'm sorry I didn't find it months ago...

One question, though - where should POPFILE_ROOT be set? I've just added
Code:
POPFILE_ROOT=/usr/share/popfile
to the beginning of the script, but somehow, that doesn't feel right.

EDIT: Oops - just one more search and I fouind https://forums.gentoo.org/viewtopic-t-490909-highlight-.html which says to put that line in /etc/conf.d/popfile.
That worked like a charm.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1403
Location: Adelaide/Australia

PostPosted: Fri Oct 05, 2007 8:22 am    Post subject: Reply with quote

Glad someone found it useful.
_________________
...Lyall
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 488
Location: Connecticut, USA

PostPosted: Tue Feb 03, 2009 12:26 am    Post subject: Reply with quote

After several more versions, I still have a problem with the next reboot after an upgrade, since my manual edit to /usr/share/popfile/POPFile/Configuration.pm gets overwritten. For me, the main issue is the reversion to putting the database in / instead of /usr/share/popfile. I'm willing to log a bug to get the changes incorporated into the ebuild, unless someone has a reason that shouldn't be done.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1403
Location: Adelaide/Australia

PostPosted: Tue Feb 03, 2009 6:26 am    Post subject: Reply with quote

I had the same issue, each upgrade, I have to re-apply my changes.

Feel free to post a bug report. I guess a gentoo patch would do the job for this, but I think the polling interval should be addressed by popfile devs themselves.
_________________
...Lyall
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 488
Location: Connecticut, USA

PostPosted: Mon May 10, 2010 7:49 pm    Post subject: Reply with quote

Arghhh!!!! Just did my first reboot after updating to popfile 1.1.1, and had to go through all this (both this post and 707572) again. I thought I had filed a bug, but obviously not. I have now filed bug 319201

edit:corrected bug reference.
Back to top
View user's profile Send private message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1403
Location: Adelaide/Australia

PostPosted: Tue May 11, 2010 4:46 am    Post subject: Reply with quote

Another 'patch' to Popfile.

Popfile uses excessive CPU.

If you, like me, dislike watching processes chew CPU, then you may like to patch /usr/share/popfile/POPFile/Loader.pm, at roughly line 765, to increase the select delay from a measly 0.05 to 1 second.

Code:
select(undef, undef, undef, 0.05) if !$nowait;

to
Code:
select(undef, undef, undef, 1) if !$nowait;


This will stop Popfile from appearing in your 'top' display, constantly.
_________________
...Lyall
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum