「mod/assign/feedback/editpdf/testunoconv/upstart」の版間の差分
提供:MoodleDocs
Toshihiro KITA (トーク | 投稿記録) (ページの作成:「= ubuntuでのunoconvの起動スクリプトの例= unoconvのインストールに戻る このスクリプトは/etc/ini...」) |
Toshihiro KITA (トーク | 投稿記録) 編集の要約なし |
||
9行目: | 9行目: | ||
これがスクリプトです。 | これがスクリプトです。 | ||
<pre> | <pre> | ||
# | # Unoconv listener service | ||
#/etc/init/ | # 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" | description "Unoconv Apache Listener" | ||
30行目: | 30行目: | ||
setuid www-data | setuid www-data | ||
# | # The default of 5 seconds is too low for mysql which needs to flush buffers | ||
pre-start script | 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 | end script | ||
script | script | ||
# 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 | ||
# | # 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の起動スクリプトの例
このスクリプトは/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