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

systemd: add Conflicts=zfs-import.service #3837

Closed
ggzengel opened this issue Sep 25, 2015 · 7 comments
Closed

systemd: add Conflicts=zfs-import.service #3837

ggzengel opened this issue Sep 25, 2015 · 7 comments
Milestone

Comments

@ggzengel
Copy link
Contributor

For systems with systemd in sysv init compatibility mode you have to prevent that services in /etc/init.d will be executed if there is a equivalent in systemd.
There is zfs-import without a corresponding systemd service. You have to add 'Conflicts=zfs-import.service' to zfs-import-cache.service and zfs-import-scan.service.

[Unit]
Description=Import ZFS pools by cache file
DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
After=cryptsetup.target
ConditionPathExists=/etc/zfs/zpool.cache
Conflicts=zfs-import.service

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs
ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN
ExecStop=/sbin/zpool export -a
@behlendorf behlendorf added this to the 0.6.5.2 milestone Sep 25, 2015
@behlendorf
Copy link
Contributor

@ggzengel could you please open a pull request with the proposed fix. It makes is easier for me to merge, get it reviewed, and properly credit the author.

@ggzengel
Copy link
Contributor Author

First time I made this with github. Now we have #3838.

@FransUrbo
Copy link
Contributor

I'm slowly starting to understand what you're been on about for the last couple of days :).

So you're saying that that zfs-import.service is auto generated from the /etc/init.d/zfs-import file. And when you install both the SYSV scripts and the systemd services files on the same system and systemd is in charge of starting services (not init), this auto generated service file conflicts with the two existing ones, the zfs-import-cache.service and zfs-import-scan.service??

@ggzengel
Copy link
Contributor Author

@FransUrbo Exactly. You got it. That's the way systemd will make smooth migration.

I googled about jessie and systemd: Jessie will always use systemd on normal install and will use systemd on upgrade from Wheezy to Jessie.

@ggzengel
Copy link
Contributor Author

I hope I don't spam too much.
Is this now useful?

@FransUrbo
Copy link
Contributor

Very much so, thanx!

@ggzengel
Copy link
Contributor Author

better solution in #3839

behlendorf pushed a commit to behlendorf/zfs that referenced this issue Oct 2, 2015
For consistency all systemd unit files and init scripts now share
the same names.  This prevents an issue where the zed is started
twice on systems where both the systemd and sysv infrastructure is
installed concurrently.

For backward compatibility a 'zed' alias has been added.  This
allows the user to interact with the service using either the
name 'zed' or 'zfs-zed'.

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3837
nedbass pushed a commit to nedbass/zfs that referenced this issue Aug 26, 2016
For consistency all systemd unit files and init scripts now share
the same names.  This prevents an issue where the zed is started
twice on systems where both the systemd and sysv infrastructure is
installed concurrently.

For backward compatibility a 'zed' alias has been added.  This
allows the user to interact with the service using either the
name 'zed' or 'zfs-zed'.

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3837
nedbass pushed a commit to nedbass/zfs that referenced this issue Sep 3, 2016
For consistency all systemd unit files and init scripts now share
the same names.  This prevents an issue where the zed is started
twice on systems where both the systemd and sysv infrastructure is
installed concurrently.

For backward compatibility a 'zed' alias has been added.  This
allows the user to interact with the service using either the
name 'zed' or 'zfs-zed'.

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3837
nedbass pushed a commit to nedbass/zfs that referenced this issue Sep 5, 2016
For consistency all systemd unit files and init scripts now share
the same names.  This prevents an issue where the zed is started
twice on systems where both the systemd and sysv infrastructure is
installed concurrently.

For backward compatibility a 'zed' alias has been added.  This
allows the user to interact with the service using either the
name 'zed' or 'zfs-zed'.

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3837
nedbass pushed a commit to nedbass/zfs that referenced this issue Sep 5, 2016
For consistency all systemd unit files and init scripts now share
the same names.  This prevents an issue where the zed is started
twice on systems where both the systemd and sysv infrastructure is
installed concurrently.

For backward compatibility a 'zed' alias has been added.  This
allows the user to interact with the service using either the
name 'zed' or 'zfs-zed'.

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3837
tuxoko pushed a commit to tuxoko/zfs that referenced this issue Sep 8, 2016
For consistency all systemd unit files and init scripts now share
the same names.  This prevents an issue where the zed is started
twice on systems where both the systemd and sysv infrastructure is
installed concurrently.

For backward compatibility a 'zed' alias has been added.  This
allows the user to interact with the service using either the
name 'zed' or 'zfs-zed'.

Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3837
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