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

Add systemd init files to CLI-only Linux packages #16866

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

TheLastCicada
Copy link
Contributor

Purpose:

Add Systemd initialization files to the .deb and .rpm CLI-only installers for more friendly process management. This specifically helps hobby and enterprise users running Chia on a headless Linux server, which a big improvement being the ability to easily start Chia services at boot. This is currently a pain-point for the Carbon users attempting to install Chia and the carbon applications in their infrastructure.

These bundled systemd files allow the user to pass in the Linux user that Chia should run as and assumes default ports and locations for the CHIA_ROOT directory. This likely covers a very large percentage of users and those who need customization can modify their own systemd files. By passing in the user to the systemd script, multiple versions of Chia could be run on a single system using different Linux user accounts for the CHIA_ROOT.

Current Behavior:

No bundled init files.

New Behavior:

If installed with the CLI .rpm or .deb file, Linux admins will be able to start Chia services with

systemctl start chia-full-node@username
systemctl start chia-wallet@username
systemctl start chia-data-layer@username

These services will start at boot with the following commands:

systemctl enable chia-full-node@username
systemctl enable chia-wallet@username
systemctl enable chia-data-layer@username

@TheLastCicada TheLastCicada added the Added Required label for PR that categorizes merge commit message as "Added" for changelog label Nov 17, 2023
@TheLastCicada TheLastCicada marked this pull request as ready for review November 27, 2023 18:41
@TheLastCicada TheLastCicada requested a review from a team as a code owner November 27, 2023 18:41
cmmarslender
cmmarslender previously approved these changes Nov 27, 2023
@TheLastCicada TheLastCicada changed the base branch from main to release/2.1.2 November 27, 2023 18:44
@TheLastCicada TheLastCicada dismissed cmmarslender’s stale review November 27, 2023 18:44

The base branch was changed.

Copy link
Contributor

@wjblanke wjblanke left a comment

Choose a reason for hiding this comment

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

aok

@cmmarslender cmmarslender merged commit dcea536 into release/2.1.2 Nov 27, 2023
253 checks passed
@cmmarslender cmmarslender deleted the zb.add-systemd-to-cli-pkgs branch November 27, 2023 23:03
@TCB13
Copy link

TCB13 commented Dec 6, 2023

I've a question about this PR.

Starting the entire thing required the user to enter a password to unlock the wallet, how will that be handled with this?

Thank you.

@cmmarslender
Copy link
Contributor

I've a question about this PR.

Starting the entire thing required the user to enter a password to unlock the wallet, how will that be handled with this?

Thank you.

Currently, the systemd configs are most beneficial to those without password protected keys, or running services that aren't utilizing keys (full node). There are possibly some clever integrations you could come up with that notify you of a need to unlock your keys, but those are a bit out of scope for the current iteration here.

What I personally do to work around this is and successfully farm on boot is to just leave the keys that my plots are tied to without a password, and have my payout addresses all set to pay to another set of keys that aren't online on the farming host.

@TCB13
Copy link

TCB13 commented Dec 6, 2023

@cmmarslender okay... but then this update once it gets released will probably break tons of setups with a simple apt upgrade.

New systemd services will be installed and automatically try to start a full node / wallet and the process will stay in the background asking for password. Meanwhile a user might run the cli manually and have both instances opening the same database.

How are you planning to handle this?

Okay I see, you're not enabling those by default.

@cmmarslender
Copy link
Contributor

@cmmarslender okay... but then this update once it gets released will probably break tons of setups with a simple apt upgrade.

New systemd services will be installed and automatically try to start a full node / wallet and the process will stay in the background asking for password. Meanwhile a user might run the cli manually and have both instances opening the same database.

How are you planning to handle this?

Okay I see, you're not enabling those by default.

Correct, not enabled by default. Just there as an option in case you would like to use them with your setup without having to manually create your own systemd configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added Required label for PR that categorizes merge commit message as "Added" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants