<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>146624</bug_id>
          
          <creation_ts>2006-09-06 17:50 0000</creation_ts>
          <short_desc>net-nds/portmap needs RDEPEND debianutils</short_desc>
          <delta_ts>2006-09-09 05:34:02 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>stefan@the2masters.de</reporter>
          <assigned_to>net-fs@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>stefan@the2masters.de</who>
            <bug_when>2006-09-06 17:50:53 0000</bug_when>
            <thetext>/etc/init.d/portmap uses the tool mktemp in restart(). mktemp is provided by sys-apps/debianutils, but debianutils isn&apos;t in the RDEPDENDS of portmap (debianutils is part of system, maybe it&apos;s not needed?). I don&apos;t know how important the mktemp-stuff in /etc/init.d/portmap is, maybe it can be omitted?

debianutils provides useless things for a embedded system, I searched for occurrences on the whole system, so that I can eventually unmerge it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2006-09-07 00:21:37 0000</bug_when>
            <thetext>Well, as said, sys-apps/debianutils is already part of system... There&apos;s sys-apps/mktemp but it depends on debianutils (unstable version) so it won&apos;t help you much w/ cleaning up your system. :P
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stefan@the2masters.de</who>
            <bug_when>2006-09-07 04:20:00 0000</bug_when>
            <thetext>But is the mktemp even needed? It saves the portmapper&apos;s table, but when you restart portmap, every user of portmap is stopped and restarted again (unless you&apos;re running proprietary software without init.d scripts). So I would say it&apos;s not needed to save and restore the table state, or it could be done optionally with a conf.d/portmap variable?

Here&apos;s my solution doing it optional:

# diff -u init.d/portmap.old init.d/portmap
--- init.d/portmap.old  2006-09-07 13:07:06.000000000 +0200
+++ init.d/portmap      2006-09-07 13:13:16.000000000 +0200
@@ -27,19 +27,21 @@
 }

 restart() {
-       # Dump the portmapper&apos;s table before stopping
-       ebegin &quot;Saving portmap table&quot;
-       local tmpfile=`mktemp /tmp/pmap_table.XXXXXX`
-       [ -n &quot;$tmpfile&quot; ] &amp;&amp; pmap_dump &gt;$tmpfile
-       eend $? &quot;Error saving portmap table.&quot;
+       if [[ ${SAVE_ON_RESTART} == &quot;yes&quot; ]] ; then
+               # Dump the portmapper&apos;s table before stopping
+               ebegin &quot;Saving portmap table&quot;
+               local tmpfile=`mktemp /tmp/pmap_table.XXXXXX`
+               [ -n &quot;$tmpfile&quot; ] &amp;&amp; pmap_dump &gt;$tmpfile
+               eend $? &quot;Error saving portmap table.&quot;
+       fi

        # Stop and restart portmapper
        svc_stop
        sleep 1
        svc_start

-       # Reload the portmapper&apos;s table
-       if [ -n &quot;$tmpfile&quot; ]; then
+       if [[ ${SAVE_ON_RESTART} == &quot;yes&quot; &amp;&amp; -n &quot;$tmpfile&quot; ]] ; then
+               # Reload the portmapper&apos;s table
                ebegin &quot;Reloading portmap table&quot;
                pmap_set &lt;$tmpfile
                eend $? &quot;Error reloading portmap table.&quot;

# diff -u conf.d/portmap.old conf.d/portmap
--- conf.d/portmap.old  2006-09-07 13:07:54.000000000 +0200
+++ conf.d/portmap      2006-09-07 13:09:35.000000000 +0200
@@ -4,3 +4,6 @@

 # Listen on localhost only by default
 #PORTMAP_OPTS=&quot;-l&quot;
+
+# Save the portmapper&apos;s table during restarts?
+SAVE_ON_RESTART=&quot;no&quot;
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-09-09 01:28:01 0000</bug_when>
            <thetext>fixed by not using mktemp nor any tempfile ;)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stefan@the2masters.de</who>
            <bug_when>2006-09-09 05:34:02 0000</bug_when>
            <thetext>Haven&apos;t thought about such a simple solution! Thanks a lot!</thetext>
          </long_desc>
      
    </bug>

</bugzilla>