1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FreeWnn の systemd への登録

Posted at

昔昔だと Fedora の SRPM spec ファイルを変更して rpm を作ってからインストール等としていたけれども、もう Silverblue / ostree にしたので結構面倒だなと思ってしまい、素直に FreeWnn-1.1.1-a023.tar.gz から make install して /usr/local/bin/Wnn4 にインストールしました。

まぁ、ローカル・リポジトリ作って真面目に rpm 管理しても良いのだけれど。

で、起動/停止をどうしようかと迷いましたが、若干の試行錯誤で下記を作成して使っています。

かなり手抜きですが、一応支障無く動いているようです。

/etc/systemd/system/FreeWnn.service:

[Unit]
Description = FreeWnn jserver

[Service]
ExecStart = /usr/local/bin/FreeWnn-start
ExecStop = /usr/sbin/fuser -k /var/log/jserver.log
PIDFile = /run/FreeWnn.pid
Restart = always
RestartSec = 500
Type = forking

[Install]
WantedBy=multi-user.target

/usr/local/bin/FreeWnn-start:

#!/bin/bash
/bin/rm -f /tmp/jd_sockV4
/usr/bin/touch /var/log/jserver.log
/bin/chown wnn:wnn /var/log/jserver.log
/usr/local/bin/Wnn4/jserver -s /var/log/jserver.log
/usr/sbin/fuser /var/log/jserver.log > /run/FreeWnn.pid
exit 0
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?