summaryrefslogtreecommitdiff
path: root/meta/recipes-connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity')
-rwxr-xr-xmeta/recipes-connectivity/portmap/portmap/portmap.init18
1 files changed, 13 insertions, 5 deletions
diff --git a/meta/recipes-connectivity/portmap/portmap/portmap.init b/meta/recipes-connectivity/portmap/portmap/portmap.init
index e46513e115..621aa171ae 100755
--- a/meta/recipes-connectivity/portmap/portmap/portmap.init
+++ b/meta/recipes-connectivity/portmap/portmap/portmap.init
@@ -40,14 +40,22 @@ case "$1" in
$0 restart
;;
restart)
- pmap_dump >/var/run/portmap.state
+ # pmap_dump and pmap_set may be in a different package and not installed...
+ if [ -f /sbin/pmap_dump -a -f /sbin/pmap_set ]; then
+ do_state=1
+ else
+ do_state=0
+ fi
+ [ $do_state -eq 1 ] && pmap_dump >/var/run/portmap.state
$0 stop
$0 start
- if [ ! -f /var/run/portmap.upgrade-state ]; then
- sleep 1
- pmap_set </var/run/portmap.state
+ if [ $do_state -eq 1 ]; then
+ if [ ! -f /var/run/portmap.upgrade-state ]; then
+ sleep 1
+ pmap_set </var/run/portmap.state
+ fi
+ rm -f /var/run/portmap.state
fi
- rm -f /var/run/portmap.state
;;
*)
echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}"