Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

under debian, nfs::server doesn't start the service, so nfs::export can't reload it #46

Open
dw-thomast opened this issue Jul 29, 2015 · 2 comments

Comments

@dw-thomast
Copy link

Hi,

We are using your module under debian 7.

When you installed the package nfs-kernel-server, a empty file /etc/exports is created (not really empty but there is only comments).

Just after the installation, Debian tried to start the service but it failed :

[ ok ] Starting NFS common utilities: statd idmapd.
[warn] Not starting NFS kernel daemon: no exports. ... (warning).

If the file /etc/exports is empty it can't start the process.

Now with puppet.

This is a part of the code we are using :

include nfs::server

nfs::export { 'share':
  guest => '192.168.1.0/24',
  share => '/path/to/my/share',
  options => 'rw,async,no_root_squash',
}

and you can read below a part of the report

# grep -E '(nfs-kernel-server|reload_nfs_srv)' report.txt
==> vagrant: Debug: /Package[nfs-kernel-server]: Provider apt does not support features virtual_packages; not managing attribute allow_virtual
==> vagrant: Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/require: requires Package[nfs-kernel-server]
==> vagrant: Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/notify: subscribes to Exec[reload_nfs_srv]
==> vagrant: Debug: Executing '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n' nfs-kernel-server'
==> vagrant: Debug: Executing '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install nfs-kernel-server'
==> vagrant: Notice: /Stage[main]/Nfs::Server::Debian/Package[nfs-kernel-server]/ensure: ensure changed 'purged' to 'present'
==> vagrant: Debug: /Package[nfs-kernel-server]: The container Class[Nfs::Server::Debian] will propagate my refresh event
==> vagrant: Debug: Executing '/etc/init.d/nfs-kernel-server status'
==> vagrant: Debug: Executing '/etc/init.d/nfs-kernel-server start'
==> vagrant: Notice: /Stage[main]/Nfs::Server::Debian/Service[nfs-kernel-server]/ensure: ensure changed 'stopped' to 'running'
==> vagrant: Debug: /Stage[main]/Nfs::Server::Debian/Service[nfs-kernel-server]: The container Class[Nfs::Server::Debian] will propagate my refresh event
==> vagrant: Info: /Stage[main]/Nfs::Server::Debian/Service[nfs-kernel-server]: Unscheduling refresh on Service[nfs-kernel-server]
==> vagrant: Info: Concat[/etc/exports]: Scheduling refresh of Exec[reload_nfs_srv]
==> vagrant: Debug: Exec[reload_nfs_srv](provider=posix): Executing check '/etc/init.d/nfs-kernel-server status'
==> vagrant: Debug: Executing '/etc/init.d/nfs-kernel-server status'
==> vagrant: Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif: nfsd not running
==> vagrant: Notice: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]: Triggered 'refresh' from 1 events
==> vagrant: Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]: The container Class[Nfs::Server::Debian] will propagate my refresh event

With words, the Package is installed, the service tried to start without success, then the Service tried to start again, then we pushed a Config file and we tried to Reload a service not started. Finally, the service is never started with the right config file.

This patch solve my problem :

--- manifests/server/debian.pp.orig 2015-07-29 12:28:59.218034199 +0200
+++ manifests/server/debian.pp  2015-07-29 12:29:57.370164880 +0200
@@ -5,24 +5,18 @@
     ensure => present,
   }

-  exec {'reload_nfs_srv':
-    command     => '/etc/init.d/nfs-kernel-server reload',
-    onlyif      => '/etc/init.d/nfs-kernel-server status',
-    refreshonly => true,
-    require     => Package['nfs-kernel-server'],
-  }
-
   service {'nfs-kernel-server':
     ensure  => $nfs::server::service_running,
     enable  => $nfs::server::service_enable,
     pattern => 'nfsd',
+    require => Package['nfs-kernel-server'],
   }

   @concat {'/etc/exports':
     owner  => root,
     group  => root,
     mode   => '0644',
-    notify => Exec['reload_nfs_srv'],
+    notify => Service['nfs-kernel-server'],
   }

 }

Before creating a pull request, i would like to check with you if I didn't forget anything.

Thomas

@intrigeri
Copy link
Contributor

Can you please try to reproduce with 0.4.0?

@raphink
Copy link
Contributor

raphink commented Oct 19, 2018

Like @intrigeri yes, does this still fail with 0.4.0 or 0.4.1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants