Bug 910933

Summary: Canna can not start
Product: [openSUSE] openSUSE Distribution Reporter: Mitsutoshi NAKANO <bkbin005>
Component: OtherAssignee: Fuminobu Takeyama <ftake>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: bwiedemann, dvaleev, forgotten_xGw9TrnVng, ftake, maiku.fabian, mgriessmeier, qantas94heavy
Version: 13.2   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 13.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Mitsutoshi NAKANO 2014-12-21 01:28:10 UTC
I installed canna-devel in openSUSE 13.2.
But I can not start Canna.


Steps to Reproduce:

1) install openSUSE 13.2
2) sudo zypper install canna-devel
3) sudo systemctl status canna.service

Actual Results:

mitsutoshi@linux-rvvx:~> sudo systemctl start canna.service
root's password:
Job for canna.service failed. See "systemctl status canna.service" and "journalctl -xn" for details.

mitsutoshi@linux-rvvx:~> sudo systemctl status canna.service
canna.service - Canna Japanese Conversion Engine
   Loaded: loaded (/usr/lib/systemd/system/canna.service; disabled)
   Active: failed (Result: exit-code) since Sun 2014-12-21 09:57:54 JST; 32s ago
  Process: 6362 ExecStart=/usr/sbin/cannaserver -syslog (code=exited, status=1/FAILURE)

Dec 21 09:57:54 linux-rvvx cannaserver[6362]: /usr/sbin/cannaserver: invalid option -- 'y'
Dec 21 09:57:54 linux-rvvx cannaserver[6362]: Usage: cannaserver [-p num] [-l num] [-u us...e]
Hint: Some lines were ellipsized, use -l to show in full.

mitsutoshi@linux-rvvx:~> sudo systemctl -l status canna.service
canna.service - Canna Japanese Conversion Engine
   Loaded: loaded (/usr/lib/systemd/system/canna.service; disabled)
   Active: failed (Result: exit-code) since Sun 2014-12-21 09:57:54 JST; 50s ago
  Process: 6362 ExecStart=/usr/sbin/cannaserver -syslog (code=exited, status=1/FAILURE)

Dec 21 09:57:54 linux-rvvx cannaserver[6362]: /usr/sbin/cannaserver: invalid option -- 'y'
Dec 21 09:57:54 linux-rvvx cannaserver[6362]: Usage: cannaserver [-p num] [-l num] [-u userid] [-syslog] [-inet] [-d] [dichome]

mitsutoshi@linux-rvvx:~> sudo journalctl -xn
-- Logs begin at Sat 2014-12-13 16:32:42 JST, end at Sun 2014-12-21 09:59:12 JST. --
Dec 21 09:57:54 linux-rvvx cannaserver[6362]: Usage: cannaserver [-p num] [-l num] [-u userid]
Dec 21 09:57:54 linux-rvvx sudo[6359]: pam_unix(sudo:session): session closed for user root
Dec 21 09:58:27 linux-rvvx sudo[6367]: mitsutoshi : TTY=pts/1 ; PWD=/home/mitsutoshi ; USER=ro
Dec 21 09:58:27 linux-rvvx sudo[6367]: pam_unix(sudo:session): session opened for user root by
Dec 21 09:58:27 linux-rvvx sudo[6367]: pam_unix(sudo:session): session closed for user root
Dec 21 09:58:45 linux-rvvx sudo[6371]: mitsutoshi : TTY=pts/1 ; PWD=/home/mitsutoshi ; USER=ro
Dec 21 09:58:45 linux-rvvx sudo[6371]: pam_unix(sudo:session): session opened for user root by
Dec 21 09:58:45 linux-rvvx sudo[6371]: pam_unix(sudo:session): session closed for user root
Dec 21 09:59:12 linux-rvvx sudo[6375]: mitsutoshi : TTY=pts/1 ; PWD=/home/mitsutoshi ; USER=ro
Dec 21 09:59:12 linux-rvvx sudo[6375]: pam_unix(sudo:session): session opened for user root by


I can reproduce this issue every time.


Expected Results:

Canna should start.



Build Date & Hardware:

Installed 2014-12-13 on VirtualBox 4.3.20 r96996 in Windows 7 Ultimate SP1.


Please see also:

http://lists.opensuse.org/opensuse-ja/2014-12/msg00017.html
http://lists.opensuse.org/opensuse-ja/2014-12/msg00022.html
Comment 1 Bernhard Wiedemann 2014-12-21 07:20:20 UTC
/usr/sbin/cannaserver -syslog
/usr/sbin/cannaserver: invalid option -- 'y'
Usage: cannaserver [-p num] [-l num] [-u userid] [-syslog] [-inet] [-d] [dichome]

it seems as if it does not understand the -syslog option
even though its Usage suggests that it would
Comment 2 Mitsutoshi NAKANO 2014-12-21 07:48:04 UTC
The security-okir.patch changes -syslog option to -s,
but usage and canna.service have forgotten it.
Comment 3 Fuminobu Takeyama 2014-12-21 08:51:33 UTC
Several mistakes in this commit: https://build.opensuse.org/request/show/204858
Sorry, I could not notice in the review phase.

- "-syslog" option is wrong (as Mitsutoshi says)
- the path in the canna-tmpfiles.conf is wrong
  + should be /tmp or change the path by adding a patch
- user name for cannaserver is wrong
  + wrong fix: https://build.opensuse.org/package/rdiff/M17N/canna?linkrev=base&rev=29


$ sudo -u wnn /usr/sbin/cannaserver -s

still don't work for me. It silently exits.
Comment 4 Mitsutoshi NAKANO 2015-01-02 03:33:13 UTC
*** Bug 911526 has been marked as a duplicate of this bug. ***
Comment 5 Fuminobu Takeyama 2015-01-02 03:41:00 UTC
I've packaged fixed version. Please confirm that it works for your environment:
https://build.opensuse.org/package/show/home:ftake:branches:M17N/canna
Comment 6 Mitsutoshi NAKANO 2015-01-02 04:16:41 UTC
(In reply to Fuminobu Takeyama from comment #5)
> https://build.opensuse.org/package/show/home:ftake:branches:M17N/canna

Your fix seems to run normally on my environment.
Thank you!
Comment 7 Forgotten User xGw9TrnVng 2015-01-02 11:47:51 UTC
The changed version of service.canna now works correctly:

  [Unit]
  Description=Canna Japanese Conversion Engine
  
  [Service]
  Type=forking
  ExecPre=/bin/rm -rf /tmp/.iroha_unix
  ExecStart=/usr/sbin/cannaserver -s -u wnn -r /var/lib/canna
  ExecStopPost=/bin/rm -rf /tmp/.iroha_unix

  [Install]
  WantedBy=multi-user.target

It would be great to add this patch to the openSuSE update repositories.
Thank you very much! ありがとうございます。
Comment 8 Forgotten User xGw9TrnVng 2015-01-06 23:45:38 UTC
While the patch isn't available via YaST online update yet, the simplest work-around is to manually edit /usr/lib/systemd/system/canna.service as follows:

--------------------------------------------------------------
[Unit]
Description=Canna Japanese Conversion Engine

[Service]
Type=forking
ExecPre=/bin/rm -rf /tmp/.iroha_unix
ExecStart=/usr/sbin/cannaserver -s /var/lib/canna/dic
ExecStopPost=/bin/rm -rf /tmp/.iroha_unix

[Install]
WantedBy=multi-user.target
--------------------------------------------------------------

And then executing (as root) the following commands:
# systemctl daemon-reload
# systemctl restart canna.service
Comment 9 Bernhard Wiedemann 2015-01-10 08:00:07 UTC
This is an autogenerated message for OBS integration:
This bug (910933) was mentioned in
https://build.opensuse.org/request/show/280698 13.2 / canna
Comment 10 Matthias Griessmeier 2015-01-19 08:55:45 UTC
Update released for openSUSE 13.2 - resolved fixed
Comment 11 Swamp Workflow Management 2015-01-19 09:05:13 UTC
openSUSE-RU-2015:0072-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 878691,910933
CVE References: 
Sources used:
openSUSE 13.2 (src):    canna-3.7p3-234.4.1
Comment 12 Forgotten User xGw9TrnVng 2015-02-19 11:39:52 UTC
The current fix is still not quite right. The file /tmp/.iroha_unix/IROHA does not get automatically removed when the service starts.  So if the machine crashes while canna is running, canna won't ever start again unless that file is manually removed.
Perhaps "ExecPre" should be "ExecStartPre" in canna.service?
Comment 13 Fuminobu Takeyama 2015-02-19 14:42:30 UTC
confirmed. I submitted a new package to M17N.
Comment 14 Karl Cheng 2017-11-17 11:40:08 UTC
Additional fix mentioned in comment 13 is present since Leap 42.1. 13.2 does not has the fix but it is now EOL.