|Summary:||sys-fs/zfs-0.7.9: init script "zfs-import" has weird output for "status"|
|Product:||Gentoo Linux||Reporter:||David Klaftenegger <davidweb>|
|Component:||Current packages||Assignee:||Georgy Yakovlev <gyakovlev>|
|Package list:||Runtime testing required:||---|
Description David Klaftenegger 2018-11-28 02:50:54 UTC
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?
Comment 1 Georgy Yakovlev 2019-01-09 06:51:14 UTC
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.