Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 558372 - net-analyzer/check_mk-1.2.4_p5 remove all sudoers actions in setup.sh
Summary: net-analyzer/check_mk-1.2.4_p5 remove all sudoers actions in setup.sh
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Timo Eissler
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-21 22:48 UTC by Stanislav Nikitin
Modified: 2015-12-23 08:23 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Disabling writing to sudoers in setup.sh (check_mk-1.2.4p5-setup.sh.patch,1.05 KB, patch)
2015-08-21 22:48 UTC, Stanislav Nikitin
Details | Diff
check_mk-1.2.4_p5-r1.ebuild (check_mk-1.2.4_p5-r1.ebuild,9.55 KB, text/plain)
2015-08-28 11:35 UTC, Timo Eissler
Details
check_mk-1.2.4p5-setup.sh.patch (check_mk-1.2.4p5-setup.sh.patch,2.07 KB, patch)
2015-08-28 11:36 UTC, Timo Eissler
Details | Diff
check_mk-1.2.4_p5-r1.ebuild (check_mk-1.2.4_p5-r1.ebuild,9.56 KB, text/plain)
2015-09-08 07:14 UTC, Timo Eissler
Details
check_mk-1.2.4_p5-r1.ebuild (check_mk-1.2.4_p5-r1.ebuild,9.53 KB, text/plain)
2015-09-25 17:27 UTC, Timo Eissler
Details
check_mk-1.2.4_p5-r1.ebuild (check_mk-1.2.4_p5-r1.ebuild,10.10 KB, text/plain)
2015-12-16 21:18 UTC, Timo Eissler
Details
check_mk-1.2.4_p5-r1.ebuild (check_mk-1.2.4_p5-r1.ebuild,10.10 KB, text/plain)
2015-12-22 13:34 UTC, Timo Eissler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Nikitin 2015-08-21 22:48:22 UTC
Created attachment 409790 [details, diff]
Disabling writing to sudoers in setup.sh

Due to nature of setup.sh script, it tries to write something outside of sandbox (e.g. directly in /etc/sudoers). This patch removes check_mk's setup.sh writes to sudoers, as portage will do all the job.
Comment 1 Timo Eissler 2015-08-28 11:35:46 UTC
Created attachment 410512 [details]
check_mk-1.2.4_p5-r1.ebuild

New check_mk-1.2.4_p5-r1 ebuild
Comment 2 Timo Eissler 2015-08-28 11:36:37 UTC
Created attachment 410514 [details, diff]
check_mk-1.2.4p5-setup.sh.patch

New patch for setup.sh from check_mk 1.2.4_p5
Comment 3 Timo Eissler 2015-08-28 11:40:11 UTC
Hello,

please add the new ebuild and the new patch to portage.
I successfully tested the ebuild and the patch on three amd64 systems and one x86 system.

@Stanislav: Thank you for make me aware of this! I didn't use your patch as i prefer to disable the call of the "create_sudo_configuration" function instead of changing multiple lines in the function itself.

Kind regards,

Timo
Comment 4 Timo Eissler 2015-08-28 11:45:04 UTC
Sorry i made an mistake! Attachment #410512 [details] is NOT obsolete!
Comment 5 Stanislav Nikitin 2015-08-28 18:22:17 UTC
@Timo no problems :) Glad it will be useful.
Comment 6 Ian Delaney (RETIRED) gentoo-dev 2015-09-05 03:13:07 UTC
On runtesting I get;


Compiling with normal gcc...
Fine. Typing 'make install' as root now will install into /usr/bin
>>> Source compiled.
>>> Test phase [not enabled]: net-analyzer/check_mk-1.2.4_p5-r1

>>> Install check_mk-1.2.4_p5-r1 into /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/ category net-analyzer
chown: invalid user: ‘icinga:apache’
 * ERROR: net-analyzer/check_mk-1.2.4_p5-r1::gentoo failed (install phase):
 *   fowners failed
 * 
 * If you need support, post the output of `emerge --info '=net-analyzer/check_mk-1.2.4_p5-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-analyzer/check_mk-1.2.4_p5-r1::gentoo'`.
 * The complete build log is located at '/mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/temp/build.log'.
 * The ebuild environment file is located at '/mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/temp/environment'.
 * Working directory: '/mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/work/check_mk-1.2.4p5'
Comment 7 Brendan Horan 2015-09-05 03:15:20 UTC
(In reply to Ian Delaney from comment #6)
> On runtesting I get;
> 
> 
> Compiling with normal gcc...
> Fine. Typing 'make install' as root now will install into /usr/bin
> >>> Source compiled.
> >>> Test phase [not enabled]: net-analyzer/check_mk-1.2.4_p5-r1
> 
> >>> Install check_mk-1.2.4_p5-r1 into /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/ category net-analyzer
> chown: invalid user: ‘icinga:apache’
>  * ERROR: net-analyzer/check_mk-1.2.4_p5-r1::gentoo failed (install phase):
>  *   fowners failed
>  * 
>  * If you need support, post the output of `emerge --info
> '=net-analyzer/check_mk-1.2.4_p5-r1::gentoo'`,
>  * the complete build log and the output of `emerge -pqv
> '=net-analyzer/check_mk-1.2.4_p5-r1::gentoo'`.
>  * The complete build log is located at
> '/mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/temp/build.log'.
>  * The ebuild environment file is located at
> '/mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/temp/
> environment'.
>  * Working directory:
> '/mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/work/check_mk-1.
> 2.4p5'

I can confirm the above.
I have tested the patch and ebuild and also receive the exact same outcome.
Comment 8 Ian Delaney (RETIRED) gentoo-dev 2015-09-05 04:54:28 UTC
I'm presuming here you have manually added this user to your system while working the package. It needs to build / install as is, and if required it can add a user via the ebuild. See enweuser in user.eclass.
Comment 9 Timo Eissler 2015-09-08 07:14:00 UTC
Argh. Sorry! I fixed the ebuild. It was an issue with the depend rules, as the user and or groups will be created by the dependent packages.

Thanks for pointing this out!
Comment 10 Timo Eissler 2015-09-08 07:14:35 UTC
Created attachment 411322 [details]
check_mk-1.2.4_p5-r1.ebuild
Comment 11 Ian Delaney (RETIRED) gentoo-dev 2015-09-13 02:39:11 UTC
# emerge -1 check_mk
of this revbump succeeded.

A couple of points to refine the ebuild

( || ( dev-lang/python:2.6 dev-lang/python:2.7 ) )
looks like a relic from the past.  There is no py2.6 to choose from now.  If you want to make this py2.7 only you could be using python-r1 eclass & PYTHON_COMPAT. The ebuilds have no python eclass inherited at all which gives me the impression there is no need for stipulating a system python version at all. It's something you can look into. So on switching to system python 3.3 or 3.4, does it fail to build?

repoman full now yields

 dependency.unknown            3
   net-analyzer/check_mk/check_mk-1.2.4_p5.ebuild: RDEPEND: dev-lang/python:2.6

IUSE="agent-only apache_status dmi_sysinfo livestatus logwatch mysql
nfsexports oracle postgres smart wato xinetd zypper"
 ->
IUSE="agent-only apache_status dmi_sysinfo livestatus logwatch mysql \
(/t space) nfsexports oracle postgres smart wato xinetd zypper"

wato? ( !agent-only )" can also do with a tab space to indent wato?
Comment 12 Timo Eissler 2015-09-25 17:27:37 UTC
Created attachment 412890 [details]
check_mk-1.2.4_p5-r1.ebuild

It will build, but check_mk still needs python 2.7 to run.

repoman full doesn't comply about anything now.

Sorry for the late answer, but i had a lot other things to do.
Comment 13 Ian Delaney (RETIRED) gentoo-dev 2015-10-03 13:23:26 UTC
~/github/gentoo/net-analyzer/check_mk $ sudo ebuild check_mk-1.2.4_p5-r1.ebuild clean install

yields

>>> Install check_mk-1.2.4_p5-r1 into /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/ category net-analyzer
>>> Completed installing check_mk-1.2.4_p5-r1 into /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/

 * QA Notice: broken .png files found:
 *    /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/usr/share/check_mk/web/htdocs/images/icons/bookcase.png: broken IDAT window length
 *    /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/usr/share/check_mk/web/htdocs/images/icon_auditlog.png: broken IDAT window length
 *    /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/usr/share/check_mk/web/htdocs/images/button_auditlog_lo.png: broken IDAT window length


by co-incidence this issue came up in the last package I added for another user which I've added to See Also:  This is fixable. The bug supplies you with the deps and the code to fix the broken .png file in source.

(In reply to Timo Eissler from comment #12)
 
> It will build, but check_mk still needs python 2.7 to run.
> 


The use of dev-lang/python:2.7 is rather antiquated now with the python-r1 eclasses.  Edit the revbumped ebuild to inherit python-r1 and set PYTHON_COMPAT to py2.7 and take out the above. The eclass also works with EAPI="5".
Comment 14 Timo Eissler 2015-12-16 21:18:19 UTC
Created attachment 419412 [details]
check_mk-1.2.4_p5-r1.ebuild

I have switched to python-r1 eclass and added a fix for the broken png's-

I had to add the fix for the broken png's into src_install and not into src_prepare, because the check_mk setup.sh script extracts the png's in the src_install section.
Comment 15 Ian Delaney (RETIRED) gentoo-dev 2015-12-20 13:06:05 UTC
Minot points of finction & style:
1. # $Header: $   -> # $Id$
2. Shift MY_P, MY_PV -> prior to Description (convention)
3. Shift REQUIRED_USE to follow RDEPEND (convention)
4. S="${WORKDIR}/${MY_P}" -> last thing prior to src_prepare() {   (convention)


On runtesting.

/net-analyzer/check_mk $ sudo ebuild check_mk-1.2.4_p5-r1.ebuild clean install

yields

>>> Source compiled.
>>> Test phase [not enabled]: net-analyzer/check_mk-1.2.4_p5-r1

>>> Install check_mk-1.2.4_p5-r1 into /mnt/gen2/TmpDir/portage/net-analyzer/check_mk-1.2.4_p5-r1/image/ category net-analyzer
chown: invalid user: ‘icinga:apache’
 * ERROR: net-analyzer/check_mk-1.2.4_p5-r1::gentoo failed (install phase):
 *   fowners failed


Looks familiar, like a regression of sorts.
Comment 16 Timo Eissler 2015-12-22 13:34:59 UTC
Created attachment 420232 [details]
check_mk-1.2.4_p5-r1.ebuild

Next try :-)

Is there anywhere a list of those conventions?

I didn't find something about this sort order on devmanual.gentoo.org.
Comment 17 Ian Delaney (RETIRED) gentoo-dev 2015-12-23 08:23:13 UTC
runtests fine

net-analyzer/check_mk $ sudo ebuild check_mk-1.2.4_p5-r1.ebuild clean install

>>> Install check_mk-1.2.4_p5-r1 into .....
>>> Completed installing check_mk-1.2.4_p5-r1 into .....

about the $Id$,https://devmanual.gentoo.org/ebuild-writing/file-format/index.html

The order is mostly convention by use. Just observe other ebuilds and you'll find these are merely convention.  They still function well enough, but more for the sake of uniformity with other ebuilds.


commit 8e66ec9059c89757ad49935208d6f0e3703dac2b
Author: Ian Delaney <idella4@gentoo.org>
Date:   Wed Dec 23 16:16:24 2015 +0800

    net-analyzer/check_mk: revbump to vn. 1.2.4_p5-r1
    
    tidy positioning of various vars, switched to inherit of python-r1 eclass,
    update install phase re the creation of users and or groups,
    add patch to address sudoers actions in setup.sh,
    thx to OP (S. Nikitin) for submitting patch disabling writing to sudoers
    in setup.sh, other patches and fixes supplied by proxy maintainer via
    the gentoo bug, fixes the bug.
    
    Gentoo bug: #5583721