-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dist: add a sample systemd service #356
dist: add a sample systemd service #356
Conversation
Concept ACK. Something like this #!/bin/bash
# This script is intended to serve as a demonstration of which setup floresta.service needs to run properly.
# Check if the group 'florestad' exists
if getent group florestad > /dev/null 2>&1; then
echo "Group 'florestad' exists."
else
echo "Group 'florestad' does not exist."
return 1
fi
# Check if the user 'florestad' exists
if id -u florestad > /dev/null 2>&1; then
echo "User 'florestad' exists."
else
echo "User 'florestad' does not exist."
return 11
fi
# Check if the directory /var/lib/florestad exists and has proper permissions
if [ -d "/var/lib/florestad" ]; then
echo "Directory '/var/lib/florestad' exists."
if [ "$(stat -c '%U' /var/lib/florestad)" == "florestad" ] && [ "$(stat -c '%G' /var/lib/florestad)" == "florestad" ]; then
echo "Directory '/var/lib/florestad' is owned by user 'florestad' and group 'florestad'."
else
echo "Directory '/var/lib/florestad' is not owned by user 'florestad' and group 'florestad'."
return 1
fi
else
echo "Directory '/var/lib/florestad' does not exist."
return 1
fi
# Check if the directory /etc/florestad exists and has proper permissions
if [ -d "/etc/florestad" ]; then
echo "Directory '/etc/florestad' exists."
if [ "$(stat -c '%U' /etc/florestad)" == "florestad" ] && [ "$(stat -c '%G' /etc/florestad)" == "florestad" ]; then
echo "Directory '/etc/florestad' is owned by user 'florestad' and group 'florestad'."
else
echo "Directory '/etc/florestad' is not owned by user 'florestad' and group 'florestad'."
return 1
fi
else
echo "Directory '/etc/florestad' does not exist."
return 1
fi
|
72de6b3
to
0e5e187
Compare
Those configurations should come from your package manager. And any decent PM would check those anyway. |
0e5e187
to
9b2a2bc
Compare
@luisschwab done! |
Found a few more issues, but this should be it. |
9b2a2bc
to
8d4b0d8
Compare
Fixed. I'm intentionally making it only group-readable, so I've updated the PR description with mode |
Found a few more. Third time's the charm! |
8d4b0d8
to
66afab5
Compare
Jeez, now I think I got all of them |
ACK 66afab5 |
What is this PR for?
This PR adds a sample systemd service that may be used by package managers.
What is the purpose of this pull request?
Which aspect of floresta its being addresed?
Checklists
just lint
;cargo test
;Description
This PR adds a new
floresta.service
file that contains a fully functionalsystemd
service to run floresta as a system-wide service. It is meant for package managers and automated scripts that installs floresta and makes the environment for it to run.Notes to the reviewers
For this service to work you need a user and group called
florestad
with a home at/var/lib/florestad
and the following directories: