diff --git a/src/finit.c b/src/finit.c index ffa9dd99..11bd1a42 100644 --- a/src/finit.c +++ b/src/finit.c @@ -333,7 +333,8 @@ static void fs_mount_all(void) _d("Calling extra mount hook, after mount -a ..."); plugin_run_hooks(HOOK_MOUNT_POST); - run("swapon -ea", "swapon"); + if (whichp("swapon")) + run("swapon -ea", "swapon"); _d("Finalize, ensure common file systems are available ..."); fs_finalize(); diff --git a/src/sig.c b/src/sig.c index a12393e7..9d44f07d 100644 --- a/src/sig.c +++ b/src/sig.c @@ -321,7 +321,8 @@ void do_shutdown(shutop_t op) /* Unmount any tmpfs before unmounting swap ... */ unmount_tmpfs(); - run("swapoff -e -a", "swapoff"); + if (whichp("swapoff")) + run("swapoff -e -a", "swapoff"); /* ... unmount remaining regular file systems. */ unmount_regular();