1

Whenever the system starts, the zfs-import init script does not run:

root@kapnet:# /etc/init.d/zfs-import status
● zfs-import.service - LSB: Import ZFS pools
   Loaded: loaded (/etc/init.d/zfs-import; generated; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)

There is nothing in /var/log/syslog like it did not even try

If I start it manually, it runs fine:

root@kapnet:# /etc/init.d/zfs-import start
[ ok ] Starting zfs-import (via systemctl): zfs-import.service.

root@kapnet:# /etc/init.d/zfs-import status
● zfs-import.service - LSB: Import ZFS pools
   Loaded: loaded (/etc/init.d/zfs-import; generated; vendor preset: enabled)
   Active: active (exited) since Sun 2019-06-16 08:49:06 EEST; 12s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1463 ExecStart=/etc/init.d/zfs-import start (code=exited, status=0/SUCCESS)
      CPU: 416ms

Jun 16 08:48:59 kapnet systemd[1]: Starting LSB: Import ZFS pools...
Jun 16 08:49:00 kapnet zfs-import[1463]: Warning: You're not running 64bit. Currently native zfs in
Jun 16 08:49:00 kapnet zfs-import[1463]:          Linux is only supported and tested on 64bit.
Jun 16 08:49:05 kapnet zfs-import[1463]: Importing ZFS pool(s) .
Jun 16 08:49:06 kapnet systemd[1]: Started LSB: Import ZFS pools.

also it seems to be enabled:

root@kapnet:~# systemctl enable zfs-import
zfs-import.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zfs-import
insserv: Service mtab has to be enabled to start service zfs-import
insserv: Service mtab has to be enabled to start service zfs-import

root@kapnet:~# systemctl is-enabled zfs-import
zfs-import.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled zfs-import
enabled

Why it doesn't run on boot?

EDIT: I installed ZFS using this guide.

1 Answer 1

2

As you are told by systemd:

zfs-import.service is not a native service, redirecting to systemd-sysv-install.

Old style SysV init system is deprecated and not used anymore. For compatibility it is only emulated by systemd but there are limitations. Look at Compatibility with SysV.

If you encounter problems with SysV emulation then the first step should be to use native services from systemd. It doesn't make sense to fiddle with the emulation. So first have a look for a native service for your script. You could ask at github where you got this guide. If they don't like to help, you can try to make a unit file to start the program (not the init.d script, that starts the program). You can look into the init.d script what program is started and then start it with a systemd unit file. Because lack of information about this I cannot help much more. But to give an idea here is a very simple template of a unit file. Create a new service with:

rpi ~$ sudo --full --force edit my-zfs-import.service  # zfs-imort.service already exists

In the empty editor you insert statements, save them and quit the editor.

[Unit]
Description=Very simple template for zfs import
After=multi-user.target

[Service]
ExecStart=/usr/bin/zfs-import

[Install]
WantedBy=multi-user.target

Enable the new service with:

rpi ~$ sudo systemctl enable my-zfs-import.service

Certainly there are additional conditions needed to get your program to run. You will find many examples for a unit file here on this site. If you encounter problems with your try, just make a new question about it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.