Skip to content

Commit 0a045a6

Browse files
committed
feat: add systemd unit file for turn-me-off
1 parent 03afb5c commit 0a045a6

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

turn-me-off.service

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[Unit]
2+
Description=Turn Me Off - HTTP API for system power management
3+
Documentation=https://github.com/SamyAB/turn-me-off
4+
After=network-online.target
5+
Wants=network-online.target
6+
7+
[Service]
8+
Type=simple
9+
10+
# Update this path according to your installation
11+
ExecStart=/usr/local/bin/turn-me-off
12+
Restart=on-failure
13+
RestartSec=5s
14+
15+
# Environment variables
16+
Environment="TMF_PORT=3000"
17+
Environment="RUST_LOG=turn_me_off=info"
18+
19+
# Security hardening
20+
NoNewPrivileges=true
21+
PrivateTmp=true
22+
ProtectSystem=strict
23+
ProtectHome=true
24+
ReadWritePaths=/var/log
25+
26+
# Logging
27+
StandardOutput=journal
28+
StandardError=journal
29+
SyslogIdentifier=turn-me-off
30+
31+
[Install]
32+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)