Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tenforward/6339037 to your computer and use it in GitHub Desktop.
Save tenforward/6339037 to your computer and use it in GitHub Desktop.
Slackware/Plamo で vagrant を使った場合,きちんと NFS 共有がなされるようにするパッチ https://github.com/mitchellh/vagrant/pull/2077 の マージリクエストのパッチを当てたものに対するパッチです.
From 48f5bda71e8bb8124cf8f0f7b4372ec3d79d9e51 Mon Sep 17 00:00:00 2001
From: KATOH Yasufumi <[email protected]>
Date: Mon, 26 Aug 2013 16:56:12 +0900
Subject: [PATCH] improve slackware/plamo detection and change nfs_check_command
* On Slackware, /etc/rc.d/rc.nfsd has no "status" argument, so the check command change to pidof command.
* On Plamo Linux, there is no /etc/slackware-release file, so use "/usr/lib/setup/Plamo-*" instead.
---
plugins/hosts/slackware/host.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/hosts/slackware/host.rb b/plugins/hosts/slackware/host.rb
index 365625f..6534528 100644
--- a/plugins/hosts/slackware/host.rb
+++ b/plugins/hosts/slackware/host.rb
@@ -6,7 +6,7 @@ module VagrantPlugins
module HostSlackware
class Host < VagrantPlugins::HostLinux::Host
def self.match?
- return File.exists?("/etc/slackware-release")
+ return File.exists?("/etc/slackware-release") || Dir.glob("/usr/lib/setup/Plamo-*").length > 0
end
# Normal, mid-range precedence.
@@ -18,7 +18,7 @@ module VagrantPlugins
super
@nfs_apply_command = "/usr/sbin/exportfs -r"
- @nfs_check_command = "/etc/rc.d/rc.nfsd status"
+ @nfs_check_command = "pidof nfsd > /dev/null"
@nfs_start_command = "/etc/rc.d/rc.nfsd start"
end
end
--
1.8.1.4
@tenforward
Copy link
Author

実は Plamo は /etc/rc.d/rc.nfsd もなくて,昔の Slackware 風に /etc/rc.d/rc.inet2 から直接関連デーモンを起動してるのですが,普通にインストールしていれば nfsd 起動しているので,nfs_start_command は使われないだろうと思い,そこは無視ww

@tenforward
Copy link
Author

Plamoはマイナーなdistributionだし,vagrant に Plamo の検出コードを入れるよりは,Plamo 側で /etc/plamo-release ファイルを作って slackware-release ファイルにリンクするとか,そういう事をしたほうが良いような気もしている.別件でも release ファイルみたいなの欲しいよね,という話あったし.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment