Skip to content
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

Create systemd setup for backend #138

Conversation

decentralizedb
Copy link
Contributor

@decentralizedb decentralizedb commented Oct 27, 2022

If anyone wants to create a system service to run teos as a system service to start on the background, the instructions to create it are described in a new section in the install.md file.

decentralizedb and others added 3 commits October 27, 2022 18:33
This file contains the necessary steps to create a simple system service file.
Update with markdown format
I have make some changes to the service. 

It's better to create it /etc/systemd/system and let /usr/lib/systemd/system for programs installed from repositories or .deb

Modified [unit] part, only bitcoind is necessary to be running but we want network too.

Modified [service] part. --datadir is not needed, if we add user and group the datadir will be the default folder /home/<USER>/.teos/

Deleted StandardOutput=journal and StandardError=journal and SyslogIdentifier, we have enough info without it. I think it's not necessary.

If the type is "simple" pidfile is not necessary

Added timeout and restartsec, I've put 60 seconds in restartsec because bitcoind needs some time to fully start.

Added some Hardening measures.
Copy link
Member

@sr-gi sr-gi left a comment

Choose a reason for hiding this comment

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

Hey @decentralizedb, thanks for taking care of this.

I think this should be part of INSTALL.md instead of its own file.

It'll also be nice for this PR to have a minimal description.

Update systemd.md
Unnecessary parameters have been cleaned.
Instructions to create a system service to start teosd on the background are described in a new section
Delete this file because instructions were added to install.md file
@mariocynicys
Copy link
Collaborator

Is bitcoind.service installed by default with bitcoin core?
If not I think you should publish it too (or put a hyperlink to it).

Copy link
Member

@sr-gi sr-gi left a comment

Choose a reason for hiding this comment

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

Some nits.

As a general comment, I don't think the text needs to be bolded for all paragraphs (####).

Also, this is missing journal logging.

@sr-gi
Copy link
Member

sr-gi commented Nov 2, 2022

Is bitcoind.service installed by default with bitcoin core? If not I think you should publish it too (or put a hyperlink to it).

Agreed, if this depends on another service it would be nice to have a link to it from a well know guide (such as raspibolt)

Update the install file to make the steps for creating the necessary system services more precise and cleaner.
@decentralizedb
Copy link
Contributor Author

Is bitcoind.service installed by default with bitcoin core? If not I think you should publish it too (or put a hyperlink to it).

I added the link to a guide that is quite detailed and updated instructions.
This guide has just been released and is quite good in and installation oriented on how to set up on most hardware platforms because it only uses standard Debian Linux commands, as the guide indicates.

@decentralizedb
Copy link
Contributor Author

I attended all indications, I hope this time it will be ok, but if not, please let me know. I'm happy to help and learn! xD

@sr-gi
Copy link
Member

sr-gi commented Nov 2, 2022

Tagging @openoms here since he's way more knowledgeable than me

@sr-gi sr-gi added this to the 0.2 milestone Nov 7, 2022
Copy link
Member

@sr-gi sr-gi left a comment

Choose a reason for hiding this comment

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

I think this makes sense, but I'd structure it differently. I think we can follow the same structure followed by Bitcoin Core for their init files (check https://github.com/bitcoin/bitcoin/blob/master/contrib/init and https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service), that is:

  • Create a new folder in the project root called contrib
    • Create a subfolder called init
    • Create a README.md with most of the content added to this file in the PR
    • Create a teosd.service file including the relevant service information
  • Link the contrib/init/README.md file to INSTALL.md under the Systemd setup for backend

This may look like:

[...]
Please refer to the cargo documentation for more detailed instructions.

# Systemd setup for backend
Refer to init(LINK) for a detailed explanation of how to set up your systemd service or something on these lines.

@sr-gi sr-gi closed this in #176 Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants