/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.
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
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"
fixed by not using mktemp nor any tempfile ;)
Haven't thought about such a simple solution! Thanks a lot!