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

ubuntu PPA will not work correctly with systemd #145

Closed
samvde opened this issue Mar 12, 2015 · 27 comments
Closed

ubuntu PPA will not work correctly with systemd #145

samvde opened this issue Mar 12, 2015 · 27 comments

Comments

@samvde
Copy link

samvde commented Mar 12, 2015

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
Copy link

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
Copy link

yvess commented Apr 21, 2015

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:

  • '/etc/systemd/system/zed.service'
  • '/etc/systemd/system/zfs-import-cache.service'
  • '/etc/systemd/system/zfs-import-scan.service'
  • '/etc/systemd/system/zfs-mount.service'
  • '/etc/systemd/system/zfs-share.service'
  • '/etc/systemd/system/zfs.target'

I deleted:

  • /etc/init/zpool-import.conf
  • /etc/init/zed.conf

@vlarko
Copy link

vlarko commented Apr 24, 2015

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

I have added files

  • /etc/systemd/system/zed.service
  • /etc/systemd/system/zfs-import-cache.service
  • /etc/systemd/system/zfs-import-scan.service
  • /etc/systemd/system/zfs-mount.service
  • /etc/systemd/system/zfs-mount.service
  • /etc/systemd/system/zfs-share.service
  • /etc/systemd/system/zfs.target

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
Copy link
Contributor

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 added a commit to benley/pkg-zfs that referenced this issue May 24, 2015
For zfsonlinux#145

Change-Id: Ie1993edebac4948ba4fd408b652ec58772f26560
@benley
Copy link

benley commented May 24, 2015

benley@5316d25 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
Copy link
Member

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
Copy link
Member

dajhorn commented May 26, 2015

@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
Copy link

yvess commented May 26, 2015

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

@Clete2
Copy link

Clete2 commented May 26, 2015

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
Copy link
Member

dajhorn commented May 26, 2015

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
Copy link
Member

dajhorn commented May 26, 2015

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

@yvess, regarding that comment:

  • Only kernels supported by Ubuntu are supported by the PPA. (eg: Linux 4.0 dailies are unsupported until they appear in a release series or in the Enablement Stack.)
  • General fixes that are already pending in a ZoL point release are not backported any earlier than the usual release cycle. (eg: Linux 3.18 snapshot glitches.)

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
Copy link

benley commented May 26, 2015

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
Copy link

tomdee commented Jul 6, 2015

@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
Copy link

benley commented Jul 6, 2015

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

@dajhorn
Copy link
Member

dajhorn commented Jul 6, 2015

@benley, yes, please.

benley added a commit to benley/pkg-zfs that referenced this issue Jul 14, 2015
@benley
Copy link

benley commented Jul 14, 2015

At last, a much-delayed pull request.

@dajhorn
Copy link
Member

dajhorn commented Jul 17, 2015

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

@samvde
Copy link
Author

samvde commented Jul 17, 2015

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
#145 (comment).

@dajhorn
Copy link
Member

dajhorn commented Jul 20, 2015

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
Copy link

tomdee commented Jul 25, 2015

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

@samvde
Copy link
Author

samvde commented Aug 3, 2015

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
#145 (comment).

@kheaactua
Copy link

+1

@Clete2
Copy link

Clete2 commented Aug 22, 2015

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
Copy link
Member

dajhorn commented Aug 22, 2015

@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
Copy link

Clete2 commented Aug 22, 2015

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

Edit: Switched to daily. Rebooted. Works!

dajhorn pushed a commit that referenced this issue Sep 12, 2015
Closes: #145

Conflicts:
	debian/rules
dajhorn pushed a commit that referenced this issue Sep 12, 2015
Closes: #145

Conflicts:
	debian/rules
@FransUrbo
Copy link
Contributor

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

@dajhorn
Copy link
Member

dajhorn commented Apr 19, 2016

@FransUrbo, yes, done.

@dajhorn dajhorn closed this as completed Apr 19, 2016
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