[Bug 783152] New: zfs-fuse wont start at boot time but starts properly if started manually
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c0 Summary: zfs-fuse wont start at boot time but starts properly if started manually Classification: openSUSE Product: openSUSE 12.2 Version: Final Platform: x86-64 OS/Version: openSUSE 12.2 Status: NEW Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: kaspernasebaer@gmx.de QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Opera/9.80 (Windows NT 6.1; WOW64; U; en) Presto/2.10.289 Version/12.02 My system has 3.2GHz and a ssd drive holding all system partitions. There is a zfs pool consisting of four normad HDs. zfs-fuse is set active fpr runlevel 2,3,5 in yast runlevel editor. After booting zfs filesystem is not available because the zfs-fuse daemon is not started. If started manually by "# rczfs-fuse start" no errors occur an the daemon starts up correctly Reproducible: Always Steps to Reproduce: 1. Install zfs-fuse package 2. create a pool on a physical device, e.g. /dev/sdb 3. enable service in runlevel editor 4. reboot twice Actual Results: Service does not start automatically at boot. All zfs-fuse related data is not available. Expected Results: service starts at boot The problem is related to the system init process and the zfs-fuse initscript. The /etc/init.d/zfs-fuse is writing its pidfile into /var/run... before the tmpfs. Later, the pidfile is hidden. The system log shows this messages: WARNING: /var/run/zfs/zfs-fuse.pid already exists; aborting. Changing the pidfile to "/run/zfs-fuse.pid" inside the initscript gets me a bit further, but startup still does not work: Starting zfs-fuse daemonconnect: No such file or directory Please make sure that the zfs-fuse daemon is running. internal error: failed to initialize ZFS library ..done Adding $local_fs and $time to the "# Required-Start:" line is a workarround which works for me but appears not to be the ultimate solution. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c Christian Boltz <suse-beta@cboltz.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |suse-beta@cboltz.de AssignedTo|bnc-team-screening@forge.pr |gber@opensuse.org |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c1 Guido Berhörster <gber@opensuse.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fcrozat@suse.com --- Comment #1 from Guido Berhörster <gber@opensuse.org> 2012-10-07 12:12:44 UTC --- (In reply to comment #0)
Service does not start automatically at boot. All zfs-fuse related data is not available.
Expected Results: service starts at boot
The problem is related to the system init process and the zfs-fuse initscript.
The /etc/init.d/zfs-fuse is writing its pidfile into /var/run... before the tmpfs. Later, the pidfile is hidden.
The system log shows this messages:
WARNING: /var/run/zfs/zfs-fuse.pid already exists; aborting.
I can reproduce this when using systemd but it seems to work fine with sysvinit, so this seems to be some systemd quirk and looks indeed like a problem with the /var/run tmpfs.
Changing the pidfile to "/run/zfs-fuse.pid" inside the initscript gets me a bit further, but startup still does not work:
Starting zfs-fuse daemonconnect: No such file or directory Please make sure that the zfs-fuse daemon is running. internal error: failed to initialize ZFS library ..done
This error seems to come from the "zfs mount -a" in the init script when no fuse daemon is running. That can only get executed though if startproc returned success and the pidfile was successfully read, have you changed the PIDFILE= line or just modified the startproc argument in the script?
Adding $local_fs and $time to the "# Required-Start:" line is a workarround which works for me but appears not to be the ultimate solution.
I don't see anything wrong with the dependencies, the $remote_fs facility implies $local_fs and that should mean that all filesystems need to be mounted before zfs-fuse can be started. CC'in the systemd maintainer for clarification. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c2 Christian Hoffmann <kaspernasebaer@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kaspernasebaer@gmx.de --- Comment #2 from Christian Hoffmann <kaspernasebaer@gmx.de> 2012-10-08 06:24:19 UTC --- (In reply to comment #1)
(In reply to comment #0)
This error seems to come from the "zfs mount -a" in the init script when no fuse daemon is running. That can only get executed though if startproc returned success and the pidfile was successfully read, have you changed the PIDFILE= line or just modified the startproc argument in the script?
I have changed the PIDFILE= line inside the startup script. My impression is that tmpfs actually just gets mounted during zfs-fuse startup and therefore sometimes a pidfile was written to the mountpoint directory and later "overmounted" which sometimes leaded to the confusing error message that a "pidfile already exists" at startup.
Adding $local_fs and $time to the "# Required-Start:" line is a workarround which works for me but appears not to be the ultimate solution.
I don't see anything wrong with the dependencies, the $remote_fs facility implies $local_fs and that should mean that all filesystems need to be mounted before zfs-fuse can be started. CC'in the systemd maintainer for clarification.
Maybe zfs-fuse is considered as part of $local_fs and the argument is therefore ignored? (Sorry, I am not very familiar with systemd...) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c3 --- Comment #3 from Frederic Crozat <fcrozat@suse.com> 2012-10-09 14:12:36 UTC --- could you attach the output of "systemctl show zfs-fuse.service" ? in openSUSE 12.3, /var/run will be a symlink to /run which is mounted as tmpfs in initrd, so it shouldn't be a problem (in the future). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c4 --- Comment #4 from Christian Hoffmann <kaspernasebaer@gmx.de> 2012-10-10 09:17:44 UTC --- Created an attachment (id=508893) --> (http://bugzilla.novell.com/attachment.cgi?id=508893) Output of systemctl show zfs-fuse -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c5 --- Comment #5 from Frederic Crozat <fcrozat@suse.com> 2012-10-10 12:42:40 UTC --- After some tests, zfs-fuse init script is using S runlevel by default, which is not supported under systemd (which is why, enabling it with YaST tool or chkconfig doesn't really enable it). The runlevel should probably be changed to S 0 3 in the initscript. Moreover, after this fix, zfs-fuse doesn't start, because /var/run/zfs doesn't exist (since /var/run is a tmpfs, so /var/run/zfs doesn't exist at boot). Either initscript should create the file or (preferably), a tmpfile should be shipped in the package in /usr/lib/tmpfiles.d (see man tmpfiles.d for the syntax) to create /var/run/zfs at startup. You might want to integrate the work done by Fedora people to properly integrate zfs-fuse into systemd (.service and so one) : http://pkgs.fedoraproject.org/cgit/zfs-fuse.git/tree/ -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c6 --- Comment #6 from Guido Berhörster <gber@opensuse.org> 2012-10-11 09:57:36 UTC --- (In reply to comment #5)
After some tests, zfs-fuse init script is using S runlevel by default, which is not supported under systemd (which is why, enabling it with YaST tool or chkconfig doesn't really enable it). The runlevel should probably be changed to S 0 3 in the initscript.
Yes, that should be rather S 1 2 3 4 5, it must never get stopped on runlevel changes, I'll fix that.
Moreover, after this fix, zfs-fuse doesn't start, because /var/run/zfs doesn't exist (since /var/run is a tmpfs, so /var/run/zfs doesn't exist at boot). Either initscript should create the file or (preferably), a tmpfile should be shipped in the package in /usr/lib/tmpfiles.d (see man tmpfiles.d for the syntax) to create /var/run/zfs at startup.
No, the zfs-fuse daemon will create /var/run/zfs itself when it tries to create a socket there before writing the pidfile and as a matter of fact it works fine with sysvinit where /var/run is also a tmpfs. I even tried an explicit mkdir in the init script but it still fails.
You might want to integrate the work done by Fedora people to properly integrate zfs-fuse into systemd (.service and so one) : http://pkgs.fedoraproject.org/cgit/zfs-fuse.git/tree/
Actually all it does is calling the renamed sysv init script so there's no advantage copying that. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c7 --- Comment #7 from Christian Boltz <suse-beta@cboltz.de> 2012-10-11 15:04:50 CEST --- (In reply to comment #6)
Yes, that should be rather S 1 2 3 4 5, it must never get stopped on runlevel changes, I'll fix that.
Please do not include runlevel 4 - this runlevel is never used, and adding it will probably cause warnings from insserv -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c8 --- Comment #8 from Frederic Crozat <fcrozat@suse.com> 2012-10-11 14:56:52 UTC --- I would suggest to add "# PIDFile: /var/run/zfs/zfs-fuse.pid" in the initscript header. This will help systemd to correctly detect if daemon is running. It looks like startproc is finishing before /var/run/zfs/zfs-fuse.pid is written, which is breaking the initscript. You should add "-w" option to startproc, which will ensure it will wait for zfs-fuse parent process to terminate (and therefore PID is written) before the rest of initscript is executed. With my test, it seems to fix the issue. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c9 --- Comment #9 from Guido Berhörster <gber@opensuse.org> 2012-10-11 21:16:20 UTC --- (In reply to comment #8)
I would suggest to add "# PIDFile: /var/run/zfs/zfs-fuse.pid" in the initscript header. This will help systemd to correctly detect if daemon is running.
It looks like startproc is finishing before /var/run/zfs/zfs-fuse.pid is written, which is breaking the initscript. You should add "-w" option to startproc, which will ensure it will wait for zfs-fuse parent process to terminate (and therefore PID is written) before the rest of initscript is executed. With my test, it seems to fix the issue.
Thanks, I've added both and done some testing, the latter indeed makes startup reliable with systemd. I'll push updates for 12.1/12.2 soon. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c10 --- Comment #10 from Bernhard Wiedemann <bwiedemann@suse.com> 2012-10-12 00:00:07 CEST --- This is an autogenerated message for OBS integration: This bug (783152) was mentioned in https://build.opensuse.org/request/show/137911 Factory / zfs-fuse -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c11 Benjamin Brunner <bbrunner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #11 from Benjamin Brunner <bbrunner@suse.com> 2012-10-17 14:21:32 CEST --- Update released for 12.1 and 12.2. Resolved fixed. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=783152 https://bugzilla.novell.com/show_bug.cgi?id=783152#c12 --- Comment #12 from Swamp Workflow Management <swamp@suse.de> 2012-10-17 13:08:57 UTC --- openSUSE-RU-2012:1356-1: An update that has one recommended fix can now be installed. Category: recommended (low) Bug References: 783152 CVE References: Sources used: openSUSE 12.2 (src): zfs-fuse-0.7.0-11.4.1 openSUSE 12.1 (src): zfs-fuse-0.7.0-7.4.1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com