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

Mount resource only updated /etc/fstab, did not mount #509

Closed
wdullaer opened this issue Apr 23, 2019 · 5 comments · Fixed by #524
Closed

Mount resource only updated /etc/fstab, did not mount #509

wdullaer opened this issue Apr 23, 2019 · 5 comments · Fixed by #524

Comments

@wdullaer
Copy link
Contributor

Versions:

  • mgmt version (eg: mgmt --version): 0.0.18

  • operating system/distribution (eg: uname -a): Ubuntu 19.04

Description:

Trying to mount a few local ext4 filesystems updated /etc/fstab correctly, but did not mount the disks after mgmt had converged.

The mcl files was simple

file "/mnt/disk1/" {
	state => "exists",
}

mount "/mnt/disk1" {
	state => "exists",
	device => "UUID=8f3b7486-7529-4552-820c-284232c8354d",
	type => "ext4",
	options => {
		"noatime"=>"",
		"defaults"=>"",
	},

	Depend => File["/mnt/disk1/"],
}

The log contained statements like this one, which seems to indicate that the mount logic inside of mgmt did get called

17:54:48 main.go:496: gapi: lang: running interpret...
17:54:48 main.go:414: engine: mount[/mnt/disk4]: CheckApply(true)
17:54:48 main.go:414: engine: mount[/mnt/disk4]: resource: mountCheckApply(true)
@purpleidea
Copy link
Owner

As previously mentioned in IRC, here is one fix for the mount portion of that code:

8f1f5d3

It's in git master now.

If you can confirm that this did not fix the problem, then that would be helpful. If it does not, then perhaps something is wrong with our systemd mount logic.

Can you also confirm:

  1. Are you running mgmt as root?
  2. What is the output of systemd-mount --list and systemd-mount --version on your system?

Lastly, our logic is currently "update fstab, and poke systemd so that it sees the change and mounts it". If that is incorrect on some systems, that something we should know, so that instead of updating fstab we add systemd .mount files instead. @jonathangold any thoughts?

@emmmmygold
Copy link
Contributor

emmmmygold commented Apr 23, 2019 via email

@purpleidea
Copy link
Owner

perhaps the "wait for the systemd job to complete" is now broken

I had that thought, but I hope it is not the case. My other thought is the "systemd load from fstab mechanism" is not working.

@wdullaer
Copy link
Contributor Author

wdullaer commented Apr 24, 2019

  1. Are you running mgmt as root

Yes

  1. What is the output of systemd-mount --list
NODE      PATH                   MODEL                 WWN                TYPE LABEL UUID                                
/dev/sda1 pci-0000:00:14.1-ata-1 KINGSTON_SA400S37240G 0x50026b7782729481 ext4 n/a   7c31fb53-55c8-4606-8e46-501c98c45de1
/dev/sdb1 pci-0000:00:11.0-ata-1 VB0250EAVER           0x5000c5004b42c814 ext4 n/a   8f3b7486-7529-4552-820c-284232c8354d
/dev/sdc1 pci-0000:00:11.0-ata-2 SAMSUNG_HD154UI       0x50024e9003427964 ext4 Data  ba85c14c-173a-4f71-8618-8733a46af67b
/dev/sdd1 pci-0000:00:11.0-ata-3 WDC_WD30EZRX-00D8PB0  0x50014ee2b475997a ext4 n/a   f01ded31-2132-495f-9900-45eda4980e60
/dev/sde1 pci-0000:00:11.0-ata-4 WDC_WD30EZRX-00D8PB0  0x50014ee209cb1945 ext4 n/a   ac0a0d55-8263-4e1b-8912-cc7942762141

Keep in mind that I have mounted them manually in the mean time (at some point this server has to do some work)

  1. What is the output of systemd-mount --version
systemd 240
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

I'll try to recreate the issue here later today

@purpleidea
Copy link
Owner

My understanding is that this should be fixed now. If you can reproduce with git master, please let me know here and I can re-open, or you can open a new issue. Thanks!

ffrank added a commit to ffrank/mgmt that referenced this issue Jun 3, 2019
The Reload method cannot just be invoked on the administrative DBus
object. Make it work by specifying the proper systemd object name, path, and
interface.

Fixes purpleidea#509
ffrank added a commit to ffrank/mgmt that referenced this issue Jun 4, 2019
The Reload method cannot just be invoked on the administrative DBus
object. Just like the method for reloading specific units, it needs
to be invoked on the proper DBus service, addressing the proper object
and using the right interface.

Added an additional constant for the systemd DBus service. Even though
it shares the same value as the interface base name, this is
happenstance and it's technically incorrect to open a connection to an
interface name. The connection needs a service name.

Fixes purpleidea#509
ffrank added a commit to ffrank/mgmt that referenced this issue Jun 4, 2019
The Reload method cannot just be invoked on the administrative DBus
object. Just like the method for reloading specific units, it needs
to be invoked on the proper DBus service, addressing the proper object
and using the right interface.

Added an additional constant for the systemd DBus service. Even though
it shares the same value as the interface base name, this is
happenstance and it's technically incorrect to open a connection to an
interface name. The connection needs a service name.

Fixes purpleidea#509
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

Successfully merging a pull request may close this issue.

3 participants