1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
6 Description=Arvados API server Rails backend
7 Documentation=https://doc.arvados.org/
9 AssertPathExists=/etc/arvados/config.yml
10 StartLimitIntervalSec=0
13 WantedBy=multi-user.target
16 # It would be nicer to write a Type=simple process, but then Passenger
17 # duplicates a lot of logs to stdout.
19 PIDFile=%t/%N/passenger.pid
20 EnvironmentFile=-/etc/arvados/environment
21 # Passenger web server settings come from (highest precedence first):
22 # 1. Command line options
23 # 2. PASSENGER_* environment variables
24 # 3. /var/www/arvados-api/current/Passengerfile.json
25 # You can change or add settings for this unit by running
26 # `systemctl edit arvados-railsapi.service`.
27 # Refer to the Passenger standalone configuration reference at
28 # <https://www.phusionpassenger.com/library/config/standalone/reference>
29 # for more information about options.
30 Environment=PASSENGER_ADDRESS=localhost
31 Environment=PASSENGER_ENVIRONMENT=production
32 Environment=PASSENGER_LOG_FILE=log/production.log
33 Environment=PASSENGER_PORT=8004
34 WorkingDirectory=/var/www/arvados-api/current
35 ExecStartPre=+/bin/install -d log tmp
36 ExecStartPre=+/bin/chmod g+srwx log tmp
37 ExecStartPre=+-/bin/chmod g+rw ${PASSENGER_LOG_FILE}
38 # Note that `bundle exec` lines should have overrides from the package that
39 # use specific versions of `bundle` and `passenger`.
40 ExecStart=/usr/bin/bundle exec passenger start --daemonize --pid-file %t/%N/passenger.pid
41 ExecStop=/usr/bin/bundle exec passenger stop --pid-file %t/%N/passenger.pid
42 ExecReload=/usr/bin/bundle exec passenger-config reopen-logs
46 ReadWritePaths=/var/www/arvados-api/current/log
47 ReadWritePaths=/var/www/arvados-api/current/tmp
48 ReadWritePaths=/var/www/arvados-api/shared/log
53 ProtectControlGroups=true
59 MemoryDenyWriteExecute=true
61 ProtectKernelModules=true
62 ProtectKernelTunables=true
63 RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
64 RestrictNamespaces=true
66 SystemCallFilter=@system-service