make janitor a systemd timer

one process lesser
This commit is contained in:
Girish Ramakrishnan
2015-09-11 17:41:31 -07:00
parent 6945a712df
commit 29e05b1caa
4 changed files with 17 additions and 10 deletions

View File

@@ -2,8 +2,8 @@
Description=Cloudron Smart Cloud
Documentation=https://cloudron.io/documentation.html
StopWhenUnneeded=true
Requires=apphealthtask.service box.service janitor.service oauthproxy.service
After=apphealthtask.service box.service janitor.service oauthproxy.service
Requires=apphealthtask.service box.service janitor.timer oauthproxy.service
After=apphealthtask.service box.service janitor.timer oauthproxy.service
# AllowIsolate=yes
[Install]

View File

@@ -1,16 +1,15 @@
[Unit]
Description=Cloudron Janitor
OnFailure=crashnotifier@%n.service
StopWhenUnneeded=true
[Service]
Type=idle
Type=simple
WorkingDirectory=/home/yellowtent/box
Restart=always
ExecStart=/usr/bin/node --optimize_for_size --max_semi_space_size=5 --max_old_space_size=30 /home/yellowtent/box/janitor.js
Restart=no
ExecStart=/usr/bin/node /home/yellowtent/box/janitor.js
Environment="HOME=/home/yellowtent" "USER=yellowtent" "DEBUG=box*,connect-lastmile" "BOX_ENV=cloudron" "NODE_ENV=production"
KillMode=process
User=yellowtent
Group=yellowtent
MemoryLimit=50M
WatchdogSec=30

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Cloudron Janitor
StopWhenUnneeded=true
[Timer]
# this activates it immediately
OnBootSec=0
OnUnitActiveSec=30min
Unit=janitor.service