1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/turtl_ynh.git synced 2024-09-03 20:26:35 +02:00

Add turtl.service

This commit is contained in:
Luc Didry 2017-08-11 13:14:20 +02:00
parent 7963f5e948
commit aa37ae9d53
3 changed files with 24 additions and 0 deletions

17
conf/turtl.service Normal file
View file

@ -0,0 +1,17 @@
[Unit]
Description=Note taking service
Documentation=http://turtl.it
Requires=network.target
Requires=rethinkdb.service
After=network.target
After=rethinkdb.service
[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/turtl/api/
ExecStart=/usr/bin/ccl -Q -b --load start.lisp
Restart=on-failure
[Install]
WantedBy=multi-user.target

View file

@ -161,7 +161,10 @@ sudo cp ../conf/logrotate.conf /etc/logrotate.d/turtl
# ENABLE SERVICE IN ADMIN PANEL # ENABLE SERVICE IN ADMIN PANEL
#================================================= #=================================================
# Add service to Yunohost monitoring # Add service to Yunohost monitoring
sudo cp ../conf/turtl.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo yunohost service add turtl --log "/var/log/turtl/turtl.log" sudo yunohost service add turtl --log "/var/log/turtl/turtl.log"
sudo yunohost service start turtl
#================================================= #=================================================
# NGINX # NGINX

View file

@ -27,6 +27,10 @@ domain=$(ynh_app_setting_get "$app" domain)
if sudo yunohost service status | grep -q turtl # Test l'existence du service dans Yunohost if sudo yunohost service status | grep -q turtl # Test l'existence du service dans Yunohost
then then
echo "Remove turtl service" echo "Remove turtl service"
sudo systemctl stop turtl
sudo systemctl disable turtl
ynh_package_remove "/etc/systemd/system/turtl.service"
sudo systemctl daemon-reload
sudo yunohost service remove turtl sudo yunohost service remove turtl
fi fi