Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 146624 - net-nds/portmap needs RDEPEND debianutils
Summary: net-nds/portmap needs RDEPEND debianutils
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Other
: High minor (vote)
Assignee: Network Filesystems
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-06 17:50 UTC by Stefan Hellermann
Modified: 2006-09-09 05:34 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Hellermann 2006-09-06 17:50:53 UTC
/etc/init.d/portmap uses the tool mktemp in restart(). mktemp is provided by sys-apps/debianutils, but debianutils isn't in the RDEPDENDS of portmap (debianutils is part of system, maybe it's not needed?). I don'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.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-07 00:21:37 UTC
Well, as said, sys-apps/debianutils is already part of system... There's sys-apps/mktemp but it depends on debianutils (unstable version) so it won't help you much w/ cleaning up your system. :P
Comment 2 Stefan Hellermann 2006-09-07 04:20:00 UTC
But is the mktemp even needed? It saves the portmapper's table, but when you restart portmap, every user of portmap is stopped and restarted again (unless you're running proprietary software without init.d scripts). So I would say it's not needed to save and restore the table state, or it could be done optionally with a conf.d/portmap variable?

Here'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's table before stopping
-       ebegin "Saving portmap table"
-       local tmpfile=`mktemp /tmp/pmap_table.XXXXXX`
-       [ -n "$tmpfile" ] && pmap_dump >$tmpfile
-       eend $? "Error saving portmap table."
+       if [[ ${SAVE_ON_RESTART} == "yes" ]] ; then
+               # Dump the portmapper's table before stopping
+               ebegin "Saving portmap table"
+               local tmpfile=`mktemp /tmp/pmap_table.XXXXXX`
+               [ -n "$tmpfile" ] && pmap_dump >$tmpfile
+               eend $? "Error saving portmap table."
+       fi

        # Stop and restart portmapper
        svc_stop
        sleep 1
        svc_start

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

# 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="-l"
+
+# Save the portmapper's table during restarts?
+SAVE_ON_RESTART="no"
Comment 3 SpanKY gentoo-dev 2006-09-09 01:28:01 UTC
fixed by not using mktemp nor any tempfile ;)
Comment 4 Stefan Hellermann 2006-09-09 05:34:02 UTC
Haven't thought about such a simple solution! Thanks a lot!