diff --git a/conf/turtl.service b/conf/turtl.service new file mode 100644 index 0000000..c6d5917 --- /dev/null +++ b/conf/turtl.service @@ -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 diff --git a/scripts/install b/scripts/install index 1846b5b..89cdf30 100755 --- a/scripts/install +++ b/scripts/install @@ -161,7 +161,10 @@ sudo cp ../conf/logrotate.conf /etc/logrotate.d/turtl # ENABLE SERVICE IN ADMIN PANEL #================================================= # 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 start turtl #================================================= # NGINX diff --git a/scripts/remove b/scripts/remove index 8629466..b10ebb6 100755 --- a/scripts/remove +++ b/scripts/remove @@ -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 then 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 fi