zfsonlinux / pkg-zfs

Native ZFS packaging for Debian and Ubuntu
https://launchpad.net/~zfs-native/+archive/daily
308 stars 55 forks source link

ubuntu PPA will not work correctly with systemd #145

Closed samvde closed 8 years ago

samvde commented 9 years ago

I am testdriving systemd on Ubuntu 15.04 with zfs as root filesystem. The system works great, however it seems the systemd initscripts are not installed on my system, leaving one zpool exported and a few filesystems unmounted at boot. This worked fine with upstart.

Mountall systemd service file is masked and can't be unmasked.

When looking at the dkms folders I can see the scripts were pulled correctly from git (at least I assume that's why the're there): ll /var/lib/dkms/zfs/0.6.3.0/build/etc/systemd/system total 58 drwxr-xr-x 2 root root 11 mrt 10 22:32 ./ drwxr-xr-x 3 root root 5 mrt 10 22:32 ../ -rw-r--r-- 1 root root 6 mrt 10 22:30 50-zfs.preset.in -rw-r--r-- 1 root root 6 mrt 10 22:32 Makefile -rw-r--r-- 1 root root 6 mrt 10 22:30 Makefile.in -rw-r--r-- 1 root root 6 mrt 10 22:30 zed.service.in -rw-r--r-- 1 root root 6 mrt 10 22:30 zfs-import-cache.service.in -rw-r--r-- 1 root root 6 mrt 10 22:30 zfs-import-scan.service.in -rw-r--r-- 1 root root 6 mrt 10 22:30 zfs-mount.service.in -rw-r--r-- 1 root root 6 mrt 10 22:30 zfs-share.service.in -rw-r--r-- 1 root root 6 mrt 10 22:30 zfs.target.in

I can test things to help out, however I have no developer skills (automake/make/autoconfigure/...). E.g. I have no idea if I could deploy those files manually to test.

edit: logged launchpad systemd: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1431523 edit2: downstream bugreport now closed (out of scope)

martinpitt commented 9 years ago

Forwarding downstream comment https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1431523/comments/2 :

Just ran into this exact same issuse. It looks like the files DO NOT match what's in git at all. (In fact, all of the are the same 6-byte file).

I manually fixed my system by creating files in /etc/systemd/system based off of the templates here:

https://github.com/zfsonlinux/zfs/tree/master/etc/systemd/system

(Create a file zfs-target based of zfs-target.in, zfs-share-service based off of zfs-share-service.in, and so on. You'll need to manually replace the variables that would normally be replaced by the build process -- @bindir@ becomes /bin and so forth.)

yvess commented 9 years ago

I had the same problem. Thanks to @martinpitt for the tip where to get the files. After I have done that, it it doesn't started up on ubuntu vivid. I need to do systemctl enable zfs.target to enable it on boot (systemd newbie).

The files I copied where:

I deleted:

vlarko commented 9 years ago

Thanks to @martinpitt and @yvess, my zpool on Ubuntu 15.04 (Vivid) now mounts on restart automatically!

I have added files

and deleted /etc/init/zpool-import.conf (it seems to be useless with systemd).

As I'm new to systemd and ZFS, I tried to copy and paste templates referenced above, replacing @sysconfdir@ and @sbindir@ witch /etc and /sbin respectively, as systemd complained in syslog

...
Apr 24 21:42:48 fido kernel: [    1.884852] systemd[1]: [/etc/systemd/system/zfs-import-cache.service:7] Path in condition not absolute, ignoring: @sysconfdir@/zfs/zpool.cache
Apr 24 21:42:48 fido kernel: [    1.884861] systemd[1]: [/etc/systemd/system/zfs-import-cache.service:12] Executable path is not absolute, ignoring: @sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN
...

(Maybe all this is not really necessary and it has been already fixed in PPA, thanks for correcting me, I'm still learning.)

FransUrbo commented 9 years ago

The correct way to solve this (which I've done in my Wheezy packages), is to build-depend on dh-systemd and then call dh_systemd_enable and dh_systemd_start in the debian/rules file. That will install the systemd files in the correct place, in the correct package AND create the correct stanzas in the post/pre inst/rm files.

benley commented 9 years ago

https://github.com/benley/pkg-zfs/commit/5316d252d66e29fd8778b0e41aa7dce470b8a81e is my attempt at implementing the full fix, if anyone wants to take a look. Comments/corrections would be appreciated. And, should I send a pull request for this or is it already handled upstream somewhere?

behlendorf commented 9 years ago

I don't know much about apt-style packaging but is there a reason you couldn't using the --with-systemd* configure options to install the existing systemd unit files in the right places? @dajhorn might have some thoughts about this as well.

dajhorn commented 9 years ago

@benley, if a dual-mode package tests well, then this might go out in a mid-series upgrade. Open a pull request against zfsonlinux/pkg-zfs in the master/ubuntu/vivid branch if you want commit credit.

Ubuntu broke release freeze to promote systemd, which cramped planning for Vivid. I am unwilling to disrupt planned deployments, and there have been zero complaints from such users, so the word on Ubuntu 15.04 could remain "use upstart mode or do a local installation".

I appreciate that this is annoying for people that are keen to use systemd, but the PPA has a reputation for production quality in part because it is paced and conservative.

yvess commented 9 years ago

just as a side note, for me zfs on vivid is unusable at the moment, see https://github.com/zfsonlinux/zfs/issues/3257#issuecomment-105219249 kernel panic

Clete2 commented 9 years ago

Upstart mode didn't work for me. It tried to hit mountall and mountall couldn't find upstart. Is that what you're referring to?

dajhorn commented 9 years ago

Upstart mode didn't work for me. It tried to hit mountall and mountall couldn't find upstart. Is that what you're referring to?

@clete2, follow these instructions to get upstart mode:

Anything that uses upstart events, like the enhanced /sbin/mountall utility in the PPA, breaks if upstart is not running.

dajhorn commented 9 years ago

just as a side note, for me zfs on vivid is unusable at the moment, see zfsonlinux/zfs#3257 (comment) kernel panic

@yvess, regarding that comment:

Automatic ppa:zfs-native/daily and ppa:zfs-native/nightly builds can be restarted if somebody with a deep understanding of Launchpad can create a working bzr recipe for the ZoL mainline.

benley commented 9 years ago

I haven't done any testing of my package variant on a 15.04 system in upstart mode - that would obviously be wise before merging my changes. If I have some time later today I'll do that, and then open a pull request. Thanks!

tomdee commented 9 years ago

@benley I can't see that you opened a PR? @dajhorn Any plans to get a fix in for this without an external PR?

benley commented 9 years ago

Ack, I forgot all about this. What branch should I do a pull request against? master/ubuntu/TRUNK?

dajhorn commented 9 years ago

@benley, yes, please.

benley commented 9 years ago

At last, a much-delayed pull request.

dajhorn commented 9 years ago

@benley, thanks. I will bench it this weekend.

samvde commented 9 years ago

Many thanks for all your efforts guys. As a non-developer it's impressive to see this stuff come together.

Krgds Sam

On Fri, Jul 17, 2015 at 3:23 AM, Darik Horn notifications@github.com wrote:

@benley https://github.com/benley, thanks. I will bench it this weekend.

— Reply to this email directly or view it on GitHub https://github.com/zfsonlinux/pkg-zfs/issues/145#issuecomment-122143251.

dajhorn commented 9 years ago

Snapshot builds for Vivid and Wily are published to ppa:zfs-native/daily.

Note that this PR does not preserve legacy upstart or mountall behavior, nor the ordering required for interleaving mount points, so the latest packages will glitch on a some larger systems.

Dunno whether it will be worthwhile to supplement or supersede the basic systemd units with the RedHat fstab.d implementation.

tomdee commented 8 years ago

Just tested this (by switching my PPA from stable to daily) and it seems to be working. Thanks guys!

samvde commented 8 years ago

Confirmed working, using fresh install of 15.04 with the daily ppa.

On Sun, Jul 26, 2015 at 12:29 AM, Tom Denham notifications@github.com wrote:

Just tested this (by switching my PPA from stable to daily) and it seems to be working. Thanks guys!

— Reply to this email directly or view it on GitHub https://github.com/zfsonlinux/pkg-zfs/issues/145#issuecomment-124907130.

kheaactua commented 8 years ago

+1

Clete2 commented 8 years ago

How long until this releases to stable? I'm trying to determine if I should switch over to daily, or just wait for release.

dajhorn commented 8 years ago

@Clete2, with the next point release. Track this page if you're interested:

The release tag usually happens soon after all milestone tickets are closed, and the promotion to ppa:zfs-native/stable approximately two weeks after that.

Clete2 commented 8 years ago

Thanks! Very informative. I appreciate all of the hard work that goes on here.

Edit: Switched to daily. Rebooted. Works!

FransUrbo commented 8 years ago

@dajhorn I see a couple of (old) commits that's supposed to fixed this. Can we close this as "done"?

dajhorn commented 8 years ago

@FransUrbo, yes, done.