「mod/assign/feedback/editpdf/testunoconv/upstart」の版間の差分

提供:MoodleDocs
移動先:案内検索
(ページの作成:「= ubuntuでのunoconvの起動スクリプトの例= unoconvのインストールに戻る このスクリプトは/etc/ini...」)
 
編集の要約なし
 
9行目: 9行目:
これがスクリプトです。
これがスクリプトです。
<pre>
<pre>
#Unoconvリスナーサービス
# Unoconv listener service


#/etc/init/フォルダにインストールし、''sudo serviceunoconvstart'' で開始します
# Install to /etc/init/ folder and start with "sudo service unoconv start"
#これにより、unoconvリスナーが起動し、停止した場合は再起動します。リスナー
# This will start a unoconv listener and restart it if it dies. The listener
#apacheユーザ  "www-data" として実行され、同じファイル/フォルダにアクセスできます
# will run as the apache user "www-data" and have access to the same files/folders
#そのユーザとして。
# as that user.
#このリスナーのホームフォルダは、/tmp/およびによって使用される一時ファイルを指します。
# The home folder for this listener will point to /tmp/ and any temporary files used by
#libreofficeがそこに作成されます。
# libreoffice will be created there.


description    "Unoconv Apache Listener"
description    "Unoconv Apache Listener"
30行目: 30行目:
setuid www-data
setuid www-data


#デフォルトの5秒は、バッファをフラッシュする必要があるmysqlには低すぎます
# The default of 5 seconds is too low for mysql which needs to flush buffers


pre-start script
pre-start script
  # 現在実行中のsofficeプロセスをすべて強制終了します
    # Kill any currently running soffice processes.
  /usr/bin/killall soffice.bin || true
    /usr/bin/killall soffice.bin || true


  # 開始時のサービスロギング
    # Service logging when starting
  echo "[`date`] Starting unoconv service" >> /var/log/unoconv.log
    echo "[`date`] Starting unoconv service" >> /var/log/unoconv.log
end script
end script


script
script
# pid file...
    # pid file...
     echo $$ > /var/run/unoconv.pid
     echo $$ > /var/run/unoconv.pid
     exec usr/bin/unoconv --listener
     exec usr/bin/unoconv --listener
47行目: 47行目:


pre-stop script
pre-stop script
     # 最初にpidファイルを削除します
     # Remove pid file first
     rm /var/run/unoconv.pid
     rm /var/run/unoconv.pid
     # 停止時のサービスロギング
     # Service logging when stopping
     echo "[`date`] Stopping unoconv service" >> /var/log/unoconv.log
     echo "[`date`] Stopping unoconv service" >> /var/log/unoconv.log
end script
end script

2020年10月26日 (月) 05:17時点における最新版

ubuntuでのunoconvの起動スクリプトの例

unoconvのインストールに戻る

このスクリプトは/etc/init/unoconv.confにインストールして、次のコマンドで開始できます。

sudo start unoconv

これがスクリプトです。

# Unoconv listener service

# Install to /etc/init/ folder and start with "sudo service unoconv start"
# This will start a unoconv listener and restart it if it dies. The listener
# will run as the apache user "www-data" and have access to the same files/folders
# as that user.
# The home folder for this listener will point to /tmp/ and any temporary files used by
# libreoffice will be created there.

description     "Unoconv Apache Listener"
author          "Damyon Wiese <damyon@moodle.com>"

start on filesystem or runlevel [2345]
stop on starting rc RUNLEVEL=[016]

respawn
respawn limit 2 5

env HOME=/tmp
setuid www-data

# The default of 5 seconds is too low for mysql which needs to flush buffers

pre-start script
    # Kill any currently running soffice processes.
    /usr/bin/killall soffice.bin || true

    # Service logging when starting
    echo "[`date`] Starting unoconv service" >> /var/log/unoconv.log
end script

script
     # pid file...
    echo $$ > /var/run/unoconv.pid
    exec usr/bin/unoconv --listener
end script

pre-stop script
    # Remove pid file first
    rm /var/run/unoconv.pid
    # Service logging when stopping
    echo "[`date`] Stopping unoconv service" >> /var/log/unoconv.log
end script


unoconvインストールに戻る