Files
cloudron-box/setup/start/systemd/box.service
T

30 lines
1.3 KiB
Desktop File
Raw Normal View History

2015-09-07 11:18:44 -07:00
[Unit]
Description=Cloudron Admin
OnFailure=crashnotifier@%n.service
StopWhenUnneeded=true
2016-01-21 22:13:19 -08:00
; journald crashes result in a EPIPE in node. Cannot ignore it as it results in loss of logs.
BindsTo=systemd-journald.service
2017-01-25 11:28:27 -08:00
After=mysql.service nginx.service
2016-12-30 11:27:00 -08:00
; As cloudron-resize-fs is a one-shot, the Wants= automatically ensures that the service *finishes*
Wants=cloudron-resize-fs.service
2015-09-07 11:18:44 -07:00
[Service]
Type=idle
WorkingDirectory=/home/yellowtent/box
Restart=always
2018-11-16 11:36:14 +01:00
; Systemd does not append logs when logging to files, we spawn a shell first and exec to replace it after setting up the pipes
ExecStart=/bin/sh -c 'echo "Logging to /home/yellowtent/platformdata/logs/box.log"; exec /usr/bin/node --max_old_space_size=150 /home/yellowtent/box/box.js >> /home/yellowtent/platformdata/logs/box.log 2>&1'
2015-09-07 11:18:44 -07:00
Environment="HOME=/home/yellowtent" "USER=yellowtent" "DEBUG=box*,connect-lastmile" "BOX_ENV=cloudron" "NODE_ENV=production"
2016-01-21 17:40:41 -08:00
; kill apptask processes as well
KillMode=control-group
; Do not kill this process on OOM. Children inherit this score. Do not set it to -1000 so that MemoryMax can keep working
OOMScoreAdjust=-999
2015-09-07 11:18:44 -07:00
User=yellowtent
Group=yellowtent
2019-01-17 09:20:31 -08:00
; OOM killer is invoked in this unit beyond this. The start script replaces this with MemoryLimit for Ubuntu 16
MemoryMax=400M
TimeoutStopSec=5s
StartLimitInterval=1
StartLimitBurst=60
2015-09-07 11:18:44 -07:00