Hi, when scripting around in my system I discovered ansible's openrc module is not correctly discovering the status of zfs-import. To check the current status of the service, ansible is looking for the string "started" in the output of rc-service zfs-import status The currently observed output is: # rc-service zfs-import status pool: data state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM data ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 vda4 ONLINE 0 0 0 vdb4 ONLINE 0 0 0 errors: No known data errors NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT data 286G 128K 286G - 0% 0% 1.00x ONLINE - The expected output is: # rc-service zfs-import status * status: started Note that I could cause weird interactions between what tools expect and the output by giving strange names to my zpools or block devices. If this is not considered a bug, could you please explain how a tool should correctly check for service status with openrc, so I can file an appropriate bug with ansible?
generally you are right, expected output is just a status of the service. zfs ebuild uses upstream provided zfs initscript (which I personally don't like) and it redefines status() function to return status of the zpools. I'm not quite sure it's wise to check it that way, but if service if started there will be a symlink in /run/openrc/started ls -la /run/openrc/started/zfs-import lrwxrwxrwx 1 root root 22 Jan 8 22:17 /run/openrc/started/zfs-import -> /etc/init.d/zfs-import but it's openrc-only and probably not portable.
see https://github.com/ansible/ansible/issues/50822 for the corresponding bug at ansible.