First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 146624
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Network Filesystems <net-fs@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Stefan Hellermann <stefan@the2masters.de>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 146624 depends on: Show dependency tree
Show dependency graph
Bug 146624 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-09-06 17:50 0000
/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 From Jakub Moc (RETIRED) 2006-09-07 00:21:37 0000 -------
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 From Stefan Hellermann 2006-09-07 04:20:00 0000 -------
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 From SpanKY 2006-09-09 01:28:01 0000 -------
fixed by not using mktemp nor any tempfile ;)

------- Comment #4 From Stefan Hellermann 2006-09-09 05:34:02 0000 -------
Haven't thought about such a simple solution! Thanks a lot!

First Last Prev Next    No search results available      Search page      Enter new bug