Skip to content

Conversation

nithinphilips
Copy link

Adding steps to optionally run Scrutiny as a systemd service.

  • Web will run as scrutiny user.
  • Collector will run as root. Scheduling is done by a systemd timer (every 15 mins, same as it is documented now)

@AnalogJ
Copy link
Owner

AnalogJ commented Oct 2, 2020

Hey @nithinphilips
Thanks for the PR! 🎉

I like the idea of adding systemd documentation, but your PR is based on an older version of the doc (I've updated the instructions to use /opt/scrutiny as the base folder). Can you rebase and fix your PR?

Thanks!

@nithinphilips
Copy link
Author

Sure thing. I've updated the doc. Not sure if I rebased it correctly, but let me know if I need to redo it.

Comment on lines +6 to +13
- [ ] freenas/truenas
- [ ] unraid
- [ ] ESXI
- [ ] Proxmox
- [ ] Synology
- [ ] OMV
- [ ] Amahi
- [ ] Running in a LXC container

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these meant to be "tasks" and not just an unsorted list?

Comment on lines 189 to +204
```
sudo cat > /etc/systemd/system/scrutiny-collector.service <<EOF
[Unit]
Description=Scrutiny disk health data collector
[Service]
Type=idle
ExecStart=/opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run --api-endpoint "http://localhost:8080"
TimeoutStartSec=600
TimeoutStopSec=600
EOF
```

Configure collector systemd timer:

```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migt make sense to specify lang (use ```\sh) and then make it a long list with comments in there like

# Create this file
sudo cat file <EOF
...
EOF
# Create that
sudo cat file <EOF
...
EOF
# Enable timer
systemctl this
systemctl that

Comment on lines +223 to +224
systemctl enable scrutiny-collector.timer
systemctl start scrutiny-collector.timer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could shorten with systemctl enable --now scutiny-collector.timer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added a type correction 🙂 systemctl enable --now scrutiny-collector.timer

@djmattyg007
Copy link

Over the weekend I created Arch packages for the main server and the collector:

https://aur.archlinux.org/packages/scrutiny/

Which includes systemd units:

The server units here are much more restrictive than the ones proposed in this PR, which is important given the collector must be run with root privileges.

@flying-sausages
Copy link

flying-sausages commented Jan 24, 2021

with root privileges

IIRC you do not need root privs, just the privs to be able to query the smartctl which is a specific group called disk.

I'm not sure if the same functionality is present with the smartctl and group management in arch, but on debian based systems this is just enough privileges https://github.com/swizzin/swizzin/pull/418/files#diff-4e73964029fa31d31dea6ae381fa7c27719a7b885b138dceca1ac603bedd6d52R17-R18

@alphamike-1612
Copy link

Hi, i was planning on adding the same systemd configuration. Can I do something to contribute in this PR? Or should I open my own PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants