Bug 908023

Summary: hylafax: cronjob /etc/cron.daily/suse.de-faxcron runs /usr/sbin/faxcron even if hylafax is not running
Product: [openSUSE] openSUSE Distribution Reporter: Giacomo Comes <comes>
Component: OtherAssignee: Bernhard Wiedemann <bwiedemann>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bwiedemann, drankinatty, hharun, lnussel, nix, ro, systemd-maintainers, vetter, whdu, zaitor
Version: 13.2Flags: werner: needinfo? (drankinatty)
Target Milestone: ---   
Hardware: PC   
OS: openSUSE 13.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Giacomo Comes 2014-12-02 16:17:55 UTC
The cronjob /etc/cron.daily/suse.de-faxcron contains the lines:

/usr/sbin/rchylafax status &>/dev/null || exit 0
/usr/sbin/faxcron

After the switch to systemd, '/usr/sbin/rchylafax status' always returns true causing /usr/sbin/faxcron to be executed even if hylafax is not running which gives the following error message:

SCRIPT: suse.de-faxcron exited with RETURNCODE = 1.
SCRIPT: output (stdout && stderr) follows


FATAL ERROR: /var/spool/fax/etc/setup.cache is missing!

The file /var/spool/fax/etc/setup.cache is not present.  This
probably means the machine has not been setup using the faxsetup(8C)
command.  Read the documentation on setting up HylaFAX before you
startup a server system.

SCRIPT: suse.de-faxcron
Comment 1 Bernhard Wiedemann 2014-12-02 20:17:13 UTC
maybe related to bug 901796
Comment 2 Bernhard Wiedemann 2014-12-02 20:30:14 UTC
IMHO, this is a bug in the sysVinit-compat layer of systemd
around the wrapping of classic init scripts

# /etc/init.d/hylafax status >/dev/null; echo $?  
0
^ this is wrong, while the other variants are correct:

# SYSTEMD_NO_WRAP=1 /etc/init.d/hylafax status >/dev/null; echo $?
1
# service hylafax status >/dev/null ; echo $?
3
Comment 3 Dr. Werner Fink 2014-12-03 08:46:52 UTC
(In reply to Bernhard Wiedemann from comment #2)

And what does

  rchylafax status

return?
Comment 4 Bernhard Wiedemann 2014-12-03 09:07:58 UTC
(In reply to Werner Fink from comment #3)
> And what does
> 
>   rchylafax status
> 
> return?

also returns 0 because it is an old-style symlink:
/usr/sbin/rchylafax -> /etc/init.d/hylafax
Comment 5 Dr. Werner Fink 2014-12-03 09:32:36 UTC
(In reply to Bernhard Wiedemann from comment #4)

> also returns 0 because it is an old-style symlink:
> /usr/sbin/rchylafax -> /etc/init.d/hylafax

Which it should not. Otherwise we have to extend

   /etc/rc.status

(which is part of aaa_base and not systemd) to use

  systemctl is-active

after

  systemctl status

which would make /etc/rc.status much more complicated (compare with shell function exec_rc() in /usr/sbin/service)
Comment 6 Bernhard Wiedemann 2014-12-03 13:51:41 UTC
submitted
https://build.opensuse.org/request/show/263866
https://build.opensuse.org/request/show/263867
but there are >=14 more old-style symlinks that can be found with
\ls -l /usr/sbin/rc*|grep init.d
and that does not even count third-party rpms

so fixing /etc/rc.status still sounds like a good option
(especially as otherwise people / scripts calling /etc/init.d/foo
will still get surprised)
Comment 7 Bernhard Wiedemann 2014-12-03 15:00:24 UTC
This is an autogenerated message for OBS integration:
This bug (908023) was mentioned in
https://build.opensuse.org/request/show/263871 Factory / cifs-utils
Comment 8 Weihua Du 2014-12-23 02:14:36 UTC
Bernhard, please following and mark as fixed when update have been pushed.Thanks!
Comment 10 Lars Müller 2015-10-13 07:36:38 UTC
*** Bug 949989 has been marked as a duplicate of this bug. ***
Comment 11 Lars Müller 2015-10-13 09:22:39 UTC
As it isn't obvious to me which information is still missing I'm going
to close this report.
Comment 12 Bernhard Wiedemann 2015-10-13 10:00:11 UTC
This is an autogenerated message for OBS integration:
This bug (908023) was mentioned in
https://build.opensuse.org/request/show/338381 13.2 / cifs-utils
Comment 13 Swamp Workflow Management 2015-10-21 12:10:34 UTC
openSUSE-RU-2015:1794-1: An update that has two recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 902947,908023
CVE References: 
Sources used:
openSUSE 13.2 (src):    cifs-utils-6.4-3.4.1