mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Only run swapon/swapoff if they exist
To silence warnings at startup/shutdown, check for existance of swapon and swapoff before calling them. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+2
-1
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user