-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patharbiter2.service
51 lines (45 loc) · 2.24 KB
/
arbiter2.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
[Unit]
Description=Arbiter2
Documentation=https://github.com/chpc-uofu/arbiter2
# TODO: May need to change these depending on your setup (like adding network file system target)
# Requires network to send mail and correctly get the hostname
Wants=sendmail.service sssd.service network.target network-online.target
After=sendmail.service sssd.service network.target network-online.target
[Service]
# -- User Settings -- #
# Run as unprivileged arbiter for security
User=arbiter
# Enable cgroup accounting by running in user.slice, instead of system.slice (default with Slice=),
# appears to only work for CentOS 7
# TODO: Lookup uid of arbiter and put it here. Systemd's %U variable may work for local system accounts
Slice=user-<ARBITER UID>.slice
CPUAccounting=true
MemoryAccounting=true
# Allows for Arbiter2 to use pss in /proc/<pid>/smaps (assuming pss = true in the
# config), typically you'd use "CapabilityBoundingSet=CAP_SYS_PTRACE", but this
# only works on binaries. Ambient allows for interpreted programs (python) to
# still use these capabilities. See the install guide for more info.
AmbientCapabilities=CAP_SYS_PTRACE
# -- Runtime Settings -- #
Type=simple
# TODO: Set these to the arbiter directory! The working directory defaults to the arbiter/ dir since
# Arbiter2 assumes ../etc exists (or -e flag) by default
Environment=ARBITER_DIR=<ARBITER DIR>
WorkingDirectory=<ARBITER DIR>/arbiter
# TODO: Make sure the Python executable is correct and args are correct (try running this line)
ExecStart=<PYTHON EXE> ${ARBITER_DIR}/arbiter/arbiter.py -e ${ARBITER_DIR}/etc -g ${ARBITER_DIR}/etc/config.toml -s
# -- Restarting Controls -- #
# If Arbiter fails for some reason, we'll want to restart in that case
Restart=on-failure
# If there is a configuration or argument issue, Arbiter2 exits with a error
# code of 2. Don't restart in that case.
RestartPreventExitStatus=2
# If Arbiter2 exits due to the --exit-file functionality, it exits with a code
# of 143. If Restart=on-failure is not set and the --exit-file flag is used,
# you'll want to uncomment the line below
# RestartForceExitStatus=143
[Install]
# TODO: Adjust the WantedBy=
# Some login nodes boot to 'graphical.target' for virtualGL, may need to adjust
# WantedBy=graphical.target
WantedBy=multi-user.target