Skip to content

Commit 68db4cc

Browse files
committed
use upstream svc files
1 parent 1efee9b commit 68db4cc

1 file changed

Lines changed: 4 additions & 59 deletions

File tree

install/pve-ups-install.sh

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -33,65 +33,10 @@ chmod 0755 deploy/pve-usv-agent.sh
3333
msg_ok "Set up Application"
3434

3535
msg_info "Creating Services"
36-
cat <<EOF >/etc/systemd/system/pve-usv.service
37-
[Unit]
38-
Description=PVE-UPS - UPS shutdown appliance for Proxmox VE
39-
After=network-online.target
40-
Wants=network-online.target
41-
42-
[Service]
43-
Type=simple
44-
User=pveusv
45-
Group=pveusv
46-
Environment=PVE_USV_CONFIG=/etc/pve-usv/config.yaml
47-
Environment=PVE_USV_DB=/var/lib/pve-usv/events.db
48-
ExecStart=/opt/pve-usv/venv/bin/python -m app.main
49-
WorkingDirectory=/opt/pve-usv
50-
Restart=always
51-
RestartSec=5
52-
NoNewPrivileges=true
53-
ProtectSystem=full
54-
ReadWritePaths=/etc/pve-usv /var/lib/pve-usv
55-
ProtectHome=true
56-
LimitNOFILE=4096
57-
MemoryMax=512M
58-
59-
[Install]
60-
WantedBy=multi-user.target
61-
EOF
62-
cat <<EOF >/etc/systemd/system/pve-usv-agent.service
63-
[Unit]
64-
Description=PVE-UPS deploy agent (privileged update/NTP applier)
65-
StartLimitIntervalSec=0
66-
67-
[Service]
68-
Type=oneshot
69-
ExecStart=/bin/bash /opt/pve-usv/deploy/pve-usv-agent.sh
70-
EOF
71-
cat <<EOF >/etc/systemd/system/pve-usv-agent.path
72-
[Unit]
73-
Description=PVE-UPS deploy agent trigger (update/NTP queue watch)
74-
75-
[Path]
76-
DirectoryNotEmpty=/var/lib/pve-usv/agent/queue
77-
Unit=pve-usv-agent.service
78-
79-
[Install]
80-
WantedBy=multi-user.target
81-
EOF
82-
cat <<EOF >/etc/systemd/system/pve-usv-agent.timer
83-
[Unit]
84-
Description=PVE-UPS deploy agent timer (drain update/NTP queue)
85-
86-
[Timer]
87-
OnBootSec=15s
88-
OnUnitActiveSec=20s
89-
Persistent=true
90-
Unit=pve-usv-agent.service
91-
92-
[Install]
93-
WantedBy=timers.target
94-
EOF
36+
install -m 0644 /opt/pve-usv/deploy/pve-usv.service /etc/systemd/system/pve-usv.service
37+
install -m 0644 /opt/pve-usv/deploy/pve-usv-agent.service /etc/systemd/system/pve-usv-agent.service
38+
install -m 0644 /opt/pve-usv/deploy/pve-usv-agent.path /etc/systemd/system/pve-usv-agent.path
39+
install -m 0644 /opt/pve-usv/deploy/pve-usv-agent.timer /etc/systemd/system/pve-usv-agent.timer
9540
systemctl enable -q --now pve-usv pve-usv-agent.path pve-usv-agent.timer
9641
msg_ok "Created Services"
9742

0 commit comments

Comments
 (0)